In questo post del blog, spiegheremo passo dopo passo come installare Bugzilla su Ubuntu 20.04.
Bugzilla è un sistema di tracciamento dei bug basato sul Web open source scritto in Perl. Questo strumento di test è sviluppato e mantenuto dal progetto Mozilla e il team di sviluppatori sta ancora sviluppando ed espandendo le sue funzionalità. Lo scopo principale di questo software di rilevamento del rilevamento è tenere traccia di bug, problemi e altre richieste di modifica. La compatibilità del software su più sistemi operativi come Windows, macOS e Linux lo rende più popolare di qualsiasi altro.
L'installazione di Bugzilla su Ubuntu 20.04 è un processo molto semplice e potrebbe richiedere fino a 10 minuti. Iniziamo!
Prerequisiti
- Un server con sistema operativo Ubuntu 20.04
- Un VPS con almeno 4 GB di RAM disponibili
- Privilegi utente:utente root o non root con privilegi sudo
Passaggio 1. Aggiorna il sistema
Dato che abbiamo una nuova installazione di Ubuntu 20.04, dobbiamo aggiornare i pacchetti alle ultime versioni disponibili:
sudo apt update -y && sudo apt upgrade -y
Passaggio 2. Installa Apache2
Useremo Apache come server web in questo tutorial. Per installarlo eseguire il comando seguente:
sudo apt install apache2
Al termine dell'installazione, avvia e abilita il servizio
sudo systemctl start apache2 && sudo systemctl enable apache2
Per verificare se tutto è a posto, esegui il seguente comando per lo stato del servizio Apache2:
sudo systemctl status apache2
Dovresti ricevere il seguente output:
root@vps:~# sudo systemctl status apache2 ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2022-04-02 12:35:15 UTC; 36min ago Docs: https://httpd.apache.org/docs/2.4/ Main PID: 44676 (apache2) Tasks: 7 (limit: 4617) Memory: 15.5M CGroup: /system.slice/apache2.service
Passaggio 3. Installa Perl e dipendenze
Poiché Bugzilla è scritto nel linguaggio di programmazione Perl, dobbiamo installarlo insieme alle dipendenze.
sudo apt install build-essential libappconfig-perl libdate-calc-perl libtemplate-perl libmime-tools-perl build-essential libdatetime-timezone-perl libdatetime-perl libemail-sender-perl libemail-mime-perl libemail-mime-perl libdbi-perl libdbd-mysql-perl libcgi-pm-perl libmath-random-isaac-perl libmath-random-isaac-xs-perl libapache2-mod-perl2 libapache2-mod-perl2-dev libchart-perl libxml-perl libxml-twig-perl perlmagick libgd-graph-perl libtemplate-plugin-gd-perl libsoap-lite-perl libhtml-scrubber-perl libjson-rpc-perl libdaemon-generic-perl libtheschwartz-perl libtest-taint-perl libauthen-radius-perl libfile-slurp-perl libencode-detect-perl libmodule-build-perl libnet-ldap-perl libfile-which-perl libauthen-sasl-perl libfile-mimeinfo-perl libhtml-formattext-withlinks-perl libgd-dev libmysqlclient-dev graphviz sphinx-common rst2pdf libemail-address-perl libemail-reply-perl
Passaggio 4. Installa il server del database MariaDB
Per installare il server del database MariaDB, eseguire il comando seguente.
sudo apt install mariadb-server
Avvia e abilita mariadb.service con i seguenti comandi:
sudo systemctl start mariadb && sudo systemctl enable mariadb
Controlla lo stato di mariadb.service
sudo systemctl status mariadb
Dovresti ricevere il seguente output:
root@vps:~# sudo systemctl status mariadb ● mariadb.service - MariaDB 10.3.34 database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2022-04-02 13:30:06 UTC; 7min ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Main PID: 70881 (mysqld) Status: "Taking your SQL requests now..." Tasks: 30 (limit: 4617) Memory: 65.3M CGroup: /system.slice/mariadb.service └─70881 /usr/sbin/mysqld
Fase 5. Crea il database e l'utente Bugzilla
Successivamente, dobbiamo creare un database Bugzilla, l'utente Bugzilla, e concedere le autorizzazioni per quell'utente al database.
CREATE USER 'bugzilla'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere'; CREATE DATABASE bugzilla; GRANT ALL PRIVILEGES ON bugzilla.* TO 'bugzilla'@'localhost'; FLUSH PRIVILEGES; EXIT;
Passaggio 6. Installa Bugzilla
Prima di poter installare Bugzilla dobbiamo scaricare l'ultima versione stabile.
cd /var/www/html wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.6.tar.gz
Una volta scaricato, estrai il file bugzilla.
tar -xvf bugzilla-5.0.6.tar.gz -C /var/www/html/ mv bugzilla-5.0.6 bugzilla
Una volta fatto, vai nella directory "bugzilla" e controlla l'installazione.
cd /var/www/html/bugzilla/ ./checksetup.pl
Se l'installazione fallisce a causa di alcuni moduli Perl mancanti, dovresti ricevere il seguente output:
COMMANDS TO INSTALL REQUIRED MODULES (You *must* run all these commands and then re-run checksetup.pl): /usr/bin/perl install-module.pl DateTime /usr/bin/perl install-module.pl DateTime::TimeZone /usr/bin/perl install-module.pl Template /usr/bin/perl install-module.pl Email::Sender /usr/bin/perl install-module.pl Email::MIME /usr/bin/perl install-module.pl List::MoreUtils /usr/bin/perl install-module.pl Math::Random::ISAAC /usr/bin/perl install-module.pl JSON::XS To attempt an automatic install of every required and optional module with one command, do: /usr/bin/perl install-module.pl --all *** Installation aborted. Read the messages above. ***
Esegui i comandi seguenti per installare i moduli richiesti:
/usr/bin/perl install-module.pl DateTime /usr/bin/perl install-module.pl DateTime::TimeZone /usr/bin/perl install-module.pl Template /usr/bin/perl install-module.pl Email::Sender /usr/bin/perl install-module.pl Email::MIME /usr/bin/perl install-module.pl List::MoreUtils /usr/bin/perl install-module.pl Math::Random::ISAAC /usr/bin/perl install-module.pl JSON::XS /usr/bin/perl install-module.pl ExtUtils::PkgConfig module
Una volta installati i moduli richiesti, è necessario ricontrollare la configurazione:
./checksetup.pl
Ora, quando i moduli sono installati, il prossimo messaggio che dovresti ricevere è che c'è un errore con la connessione al database:
There was an error connecting to MySQL: Access denied for user 'bugs'@'localhost' This might have several reasons: * MySQL is not running. * MySQL is running, but there is a problem either in the server configuration or the database access rights. Read the Bugzilla Guide in the doc directory. The section about database configuration should help. * Your password for the 'bugs' user, specified in $db_pass, is incorrect, in './localconfig'. * There is a subtle problem with Perl, DBI, or MySQL. Make sure all settings in './localconfig' are correct. If all else fails, set '$db_check' to 0.
Per risolvere questo problema, devi aprire "/var/www/html/bugzilla/localconfig ” con il tuo editor preferito e apporta le seguenti modifiche:
sudo nano /var/www/html/bugzilla/localconfig
Immettere il nome del database, l'utente e la password impostati al passaggio 5.
$webservergroup = 'www-data'; $db_driver = 'mysql'; $db_host = 'localhost'; $db_name = 'bugzilla'; $db_user = 'bugzilla'; $db_pass = 'YourStrongPasswordHere'; $db_port = 0;
Al termine di queste impostazioni, eseguire ./checksetup.pl di nuovo.
./checksetup.pl
Dovresti definire l'e-mail, il nome utente e la password del tuo amministratore una volta che la connessione al database è riuscita.
Checking for DBD-mysql (v4.001) ok: found v4.050 Checking for MySQL (v5.0.15) ok: found v5.5.5-10.3.34-MariaDB-0ubuntu0.20.04.1 Removing existing compiled templates... Precompiling templates...done. Fixing file permissions... Initializing "Product/Component Changes" email_setting ... Initializing "Dependency Tree Changes" email_setting ... Marking closed bug statuses as such... Creating default classification 'Unclassified'... Setting up foreign keys... Setting up the default status workflow... Creating default groups... Setting up user preferences... Looks like we don't have an administrator set up yet. Either this is your first time using Bugzilla, or your administrator's privileges might have accidentally been deleted. Enter the e-mail address of the administrator: [email protected] Enter the real name of the administrator: admin Enter a password for the administrator account: Please retype the password to verify: [email protected] is now set up as an administrator. Creating initial dummy product 'TestProduct'... Now that you have installed Bugzilla, you should visit the 'Parameters' page (linked in the footer of the Administrator account) to ensure it is set up as you wish - this includes setting the 'urlbase' option to the correct URL. checksetup.pl complete.
Passaggio 7. Crea un file di configurazione dell'host virtuale
Per poter accedere all'interfaccia Web di Bugzilla, dobbiamo creare un file di configurazione dell'host virtuale in cui possiamo definire il nostro dominio, la radice del documento e alcuni parametri di script.
Innanzitutto, crea il file di configurazione con il seguente comando:
touch /etc/apache2/sites-available/bugzilla.conf
Apri il file e incolla le seguenti righe di codice:
<VirtualHost *:80> ServerName yourdomain.com DocumentRoot /var/www/html/bugzilla/ <Directory /var/www/html/bugzilla/> AddHandler cgi-script .cgi Options +Indexes +ExecCGI DirectoryIndex index.cgi AllowOverride Limit FileInfo Indexes Options AuthConfig </Directory> ErrorLog /var/log/apache2/yourdomain.com.error_log CustomLog /var/log/apache2/yourdomain.com.access_log common </VirtualHost>
Abilita il file di configurazione di Apache2 e altri moduli:
sudo a2ensite bugzilla.conf sudo a2enmod headers env rewrite expires cgi
Verifica la sintassi della configurazione di Apache2.
apachectl -t
Dovresti ricevere il seguente output:
root@host:~# apachectl -t Syntax OK
Se ricevi questo output puoi tranquillamente riavviare il servizio Apache.
sudo systemctl restart apache2
Ora puoi accedere all'interfaccia Web di Bugzilla su http://YourDomain.com
Congratulazioni! Hai installato e configurato correttamente il software di tracciamento Bugzilla su Ubuntu 20.04. Se trovi difficoltà nell'installazione, puoi sempre contattare il nostro supporto tecnico e loro faranno il resto per te. Siamo disponibili 24 ore su 24, 7 giorni su 7.
Se ti è piaciuto questo post su come installare Bugzilla su Ubuntu 20.04, condividilo con i tuoi amici sui social network usando i pulsanti a sinistra o semplicemente lascia una risposta qui sotto. Grazie.