GNU/Linux >> Linux Esercitazione >  >> Linux

Guida passo passo all'installazione di Bugzilla per Linux

Bugzilla è il miglior sistema di tracciamento dei bug open source. Molto semplice da usare con molte funzioni. Bugzilla ti consente di tenere traccia dei bug e collaborare in modo efficace con sviluppatori e altri team della tua organizzazione.

Questa è una guida all'installazione di bugzilla dettagliata e dettagliata per Linux.

1. Verifica la versione del Perl

Assicurati che la tua versione di perl sia>=5.8.1 come mostrato di seguito.

# perl -v

This is perl, v5.8.8 built for i386-linux-thread-multi

La maggior parte delle distribuzioni Linux viene fornita con perl. Se non lo hai sul tuo, scaricalo e installalo dal sito web di distribuzione corrispondente.

2. Installa il database MySQL

Assicurati che la tua versione di MySQL sia>=4.1.2 come mostrato di seguito.

# mysql -V
mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1

Se non hai mysql, installalo usando yum groupinstall, o basandoti sull'articolo di installazione di LAMP o basandoti sull'articolo di mysql rpm.

3. Installa Apache

Se hai già installato Apache, assicurati di potervi accedere utilizzando http://{your-ip-address}.

Se non hai apache, install utilizza yum in base all'articolo di installazione LAMP o installa apache dal sorgente.

4. Scarica l'ultima palla di catrame Bugzilla

Scarica l'ultima versione stabile dalla pagina di download di bugzilla. Estrarre il file bugzilla*.tar.gz nella directory principale del documento apache come mostrato di seguito.

# cd ~

# wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.6.tar.gz

# cd /var/www/html

# tar xvfz /usr/save/bugzilla-3.4.6.tar.gz

5. Esegui bugzilla checksetup.pl

Il programma Bugzilla checksetup.pl verificherà se tutti i moduli perl richiesti sono installati. Questo mostrerà anche un elenco di tutti i moduli bugzilla mancanti che devono essere installati.

Puoi eseguire il programma checksetup.pl tutte le volte che vuoi finché non hai verificato che tutti i moduli Perl richiesti siano installati.

Di seguito è riportato l'output della prima esecuzione di checksetup.pl, dove sono elencati tutti i moduli opzionali e obbligatori mancanti.

# cd /var/www/html/bugzilla-3.4.6

# ./checksetup.pl --check-modules

COMMANDS TO INSTALL OPTIONAL MODULES:

             GD: /usr/bin/perl install-module.pl GD
          Chart: /usr/bin/perl install-module.pl Chart::Base
    Template-GD: /usr/bin/perl install-module.pl Template::Plugin::GD::Image
     GDTextUtil: /usr/bin/perl install-module.pl GD::Text
        GDGraph: /usr/bin/perl install-module.pl GD::Graph
       XML-Twig: /usr/bin/perl install-module.pl XML::Twig
     MIME-tools: /usr/bin/perl install-module.pl MIME::Parser
    libwww-perl: /usr/bin/perl install-module.pl LWP::UserAgent
    PatchReader: /usr/bin/perl install-module.pl PatchReader
     PerlMagick: /usr/bin/perl install-module.pl Image::Magick
      perl-ldap: /usr/bin/perl install-module.pl Net::LDAP
    Authen-SASL: /usr/bin/perl install-module.pl Authen::SASL
     RadiusPerl: /usr/bin/perl install-module.pl Authen::Radius
      SOAP-Lite: /usr/bin/perl install-module.pl SOAP::Lite
    HTML-Parser: /usr/bin/perl install-module.pl HTML::Parser
  HTML-Scrubber: /usr/bin/perl install-module.pl HTML::Scrubber
Email-MIME-Attachment-Stripper: /usr/bin/perl install-module.pl Email::MIME::Attachment::Stripper
    Email-Reply: /usr/bin/perl install-module.pl Email::Reply
    TheSchwartz: /usr/bin/perl install-module.pl TheSchwartz
 Daemon-Generic: /usr/bin/perl install-module.pl Daemon::Generic
       mod_perl: /usr/bin/perl install-module.pl mod_perl2

YOU MUST RUN ONE OF THE FOLLOWING COMMANDS (depending on which database you use):

PostgreSQL: /usr/bin/perl install-module.pl DBD::Pg
     MySQL: /usr/bin/perl install-module.pl DBD::mysql
    Oracle: /usr/bin/perl install-module.pl DBD::Oracle

COMMANDS TO INSTALL REQUIRED MODULES (You *must* run all these commands and then re-run checksetup.pl):

    /usr/bin/perl install-module.pl CGI
    /usr/bin/perl install-module.pl Digest::SHA
    /usr/bin/perl install-module.pl Date::Format
    /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::Send
    /usr/bin/perl install-module.pl Email::MIME
    /usr/bin/perl install-module.pl Email::MIME::Encodings
    /usr/bin/perl install-module.pl Email::MIME::Modifier
    /usr/bin/perl install-module.pl URI

To attempt an automatic install of every required and optional module with one command, do:

  /usr/bin/perl install-module.pl --all

6. Esegui bugzilla install-module.pl

Come suggerito dall'output di checksetup.pl, puoi eseguire install-module.pl per installare tutti i moduli perl obbligatori e facoltativi di bugzilla.

# /usr/bin/perl install-module.pl --all

Si prega di rivedere l'output di install-module.pl sopra per assicurarsi che tutto sia stato installato correttamente. Esiste la possibilità che alcuni moduli non siano stati installati (potrebbe essere dovuto alla mancanza di alcuni pacchetti del sistema operativo richiesti).

Esegui checksetup.pl per verificare se tutti i moduli sono stati installati correttamente.

Di seguito è riportato l'output della seconda esecuzione di checksetup.pl:

# ./checksetup.pl --check-modules
COMMANDS TO INSTALL OPTIONAL MODULES:

             GD: /usr/bin/perl install-module.pl GD
          Chart: /usr/bin/perl install-module.pl Chart::Base
    Template-GD: /usr/bin/perl install-module.pl Template::Plugin::GD::Image
     GDTextUtil: /usr/bin/perl install-module.pl GD::Text
        GDGraph: /usr/bin/perl install-module.pl GD::Graph
       XML-Twig: /usr/bin/perl install-module.pl XML::Twig
     PerlMagick: /usr/bin/perl install-module.pl Image::Magick
      SOAP-Lite: /usr/bin/perl install-module.pl SOAP::Lite
       mod_perl: /usr/bin/perl install-module.pl mod_perl2

YOU MUST RUN ONE OF THE FOLLOWING COMMANDS (depending on which database
you use):

PostgreSQL: /usr/bin/perl install-module.pl DBD::Pg
     MySQL: /usr/bin/perl install-module.pl DBD::mysql
    Oracle: /usr/bin/perl install-module.pl DBD::Oracle

7. Installa i moduli Perl mancanti

Come vediamo dall'output di checksetup.pl sopra, alcuni dei moduli opzionali e del modulo richiesto installati non sono stati completati quando abbiamo eseguito install-module.pl.

Quindi, dobbiamo installare manualmente i moduli mancanti uno per uno per capire i problemi e risolverli uno per uno.

Fare riferimento alla "Sezione sulla risoluzione dei problemi" alla fine per un elenco di tutti i problemi che ho riscontrato durante l'installazione dei moduli perl richiesti per bugzilla (insieme alla soluzione su come risolvere tali problemi).

8. Checksetup.pl finale –verifica dei moduli di controllo

Esegui di nuovo checksetup.pl –check-modules come mostrato di seguito come verifica finale per assicurarti che tutti i moduli siano stati installati correttamente.

# ./checksetup.pl --check-modules
* This is Bugzilla 3.4.6 on perl 5.8.8
* Running on Linux 2.6.18-164.el5PAE #1 SMP Thu Sep 3 04:10:44 EDT 2009

Checking perl modules...
Checking for              CGI.pm (v3.21)   ok: found v3.49
Checking for          Digest-SHA (any)     ok: found v5.48
Checking for            TimeDate (v2.21)   ok: found v2.24
Checking for            DateTime (v0.28)   ok: found v0.55
Checking for   DateTime-TimeZone (v0.71)   ok: found v1.17
Checking for                 DBI (v1.41)   ok: found v1.52
Checking for    Template-Toolkit (v2.22)   ok: found v2.22
Checking for          Email-Send (v2.00)   ok: found v2.198
Checking for          Email-MIME (v1.861)  ok: found v1.903
Checking for Email-MIME-Encodings (v1.313)  ok: found v1.313
Checking for Email-MIME-Modifier (v1.442)  ok: found v1.903
Checking for                 URI (any)     ok: found v1.54 

Checking available perl DBD modules...
Checking for              DBD-Pg (v1.45)    not found
Checking for           DBD-mysql (v4.00)   ok: found v4.013
Checking for          DBD-Oracle (v1.19)    not found 

The following Perl modules are optional:
Checking for                  GD (v1.20)   ok: found v2.44
Checking for               Chart (v1.0)    ok: found v2.4.1
Checking for         Template-GD (any)     ok: found v1.56
Checking for          GDTextUtil (any)     ok: found v0.86
Checking for             GDGraph (any)     ok: found v1.44
Checking for            XML-Twig (any)     ok: found v3.34
Checking for          MIME-tools (v5.406)  ok: found v5.427
Checking for         libwww-perl (any)     ok: found v5.834
Checking for         PatchReader (v0.9.4)  ok: found v0.9.5
Checking for          PerlMagick (any)     ok: found v6.2.8
Checking for           perl-ldap (any)     ok: found v0.4001
Checking for         Authen-SASL (any)     ok: found v2.1401
Checking for          RadiusPerl (any)     ok: found v0.17
Checking for           SOAP-Lite (v0.710.06) ok: found v0.711
Checking for         HTML-Parser (v3.40)   ok: found v3.65
Checking for       HTML-Scrubber (any)     ok: found v0.08
Checking for Email-MIME-Attachment-Stripper (any)     ok: found v1.316
Checking for         Email-Reply (any)     ok: found v1.202
Checking for         TheSchwartz (any)     ok: found v1.10
Checking for      Daemon-Generic (any)     ok: found v0.61
Checking for            mod_perl (v1.999022) ok: found v2.000004

9. Crea il file localconfig usando checksetup.pl

Esegui checksetup.pl senza alcun argomento, che creerà un file localconfig nella directory corrente. Il file localconfig contiene i parametri di configurazione della chiave usati da bugzilla (ad esempio mysql db username e password).

# ./checksetup.pl
Reading ./localconfig...

This version of Bugzilla contains some variables that you may want to
change and adapt to your local settings. Please edit the file
./localconfig and rerun checksetup.pl.

The following variables are new to ./localconfig since you last ran
checksetup.pl:  create_htaccess, webservergroup, db_driver, db_host, db_name, db_user, db_pass, db_port, db_sock, db_check, index_html, cvsbin, interdiffbin, diffpath, site_wide_secret

10. Modifica il file localconfig.

L'unica cosa di cui hai bisogno per modificare il file localconfig è la password db del database MySQL modificando la variabile $db_pass come mostrato di seguito.

# vi ./localconfig
$db_pass = 'Bugs4All';

11. Modifica /etc/my.cnf per aumentare la dimensione dell'allegato bugzilla

Imposta max_allowed_packet su 4M in /etc/my.cnf per aumentare la dimensione dell'allegato bugzilla.

# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

# Allow packets up to 4MB
max_allowed_packet=4M

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Riavvia mysqld dopo questa modifica.

# service mysqld restart

12. Crea bug utente mysql

Aggiungi l'utente bugzilla (bug) al database mysql come mostrato di seguito.

# mysql -u root -p

mysql> GRANT SELECT, INSERT,
UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*
TO bugs@localhost IDENTIFIED BY 'Bugs4All';

mysql> FLUSH PRIVILEGES;

13. Crea il database di bugzilla

Esegui di nuovo checksetup.pl (senza alcun argomento) per creare il database mysql bugzilla. Poiché il file localconfig esiste già, la seconda volta che esegui checksetup.pl, creerà il database mysql in base alle informazioni del file localconfig.

# ./checksetup.pl 

Creating database bugs...

Building Schema object from database...
Adding new table bz_schema ...
Initializing the new Schema storage...
Adding new table attach_data ...
Adding new table attachments ...
Adding new table bug_group_map ...
Adding new table bug_see_also ...
Adding new table bug_severity ...
Adding new table bug_status ...

Inserting values into the 'priority' table:
Inserting values into the 'bug_status' table:
Inserting values into the 'rep_platform' table:

Creating ./data directory...
Creating ./data/attachments directory...
Creating ./data/duplicates directory...

Adding foreign key: attachments.bug_id -> bugs.bug_id...
Adding foreign key: attachments.submitter_id -> profiles.userid...
Adding foreign key: bug_group_map.bug_id -> bugs.bug_id...

14. Crea un account amministratore bugzilla.

Al termine dell'esecuzione di ./checksetup.pl, rileverà che non hai un account amministratore e ti chiederà di inserire le informazioni di accesso dell'amministratore come mostrato di seguito.

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: Ramesh Natarajan
Enter a password for the administrator account: NotRealPwd
Please retype the password to verify: welcome
[email protected] is now set up as an administrator.
Creating default classification 'Unclassified'...
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.

15. Configura Apache per mod_perl

Rinomina la directory di bugzilla. (vale a dire rimuovere il numero di versione in esso)

# cd /var/www/html

# mv bugzilla-3.4.6/ bugzilla

Aggiungi le seguenti due righe a httpd.conf

# tail -2 /etc/httpd/conf/httpd.conf
PerlSwitches -I/var/www/html/bugzilla -I/var/www/html/bugzilla/lib -w -T
PerlConfigRequire /var/www/html/bugzilla/mod_perl.pl

Verifica che il gruppo in httpd.conf corrisponda al webservergroup in localconfig

# cd /var/www/html/bugzilla/

# grep webservergroup localconfig
$webservergroup = 'apache';

# grep Group /etc/httpd/conf/httpd.conf
Group apache

16. Esecuzione finale di checksetup.pl

Esegui di nuovo checksetup.pl.

# ./checksetup.pl
Reading ./localconfig...

Removing existing compiled templates...
Precompiling templates...done.
Fixing file permissions...

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.

17. Accedi a bugzilla e completa la configurazione una tantum.

Avvia l'apache, vai su http://{your-ip-address}/bugzilla e accedi utilizzando l'account amministratore che hai creato sopra.
Dall'interfaccia utente di bugzilla, a piè di pagina -> Amministrazione -> Parametri -> ' Sezione Impostazioni richieste -> Compila le seguenti informazioni:
maintainer:[email protected]

urlbase:http://{your-ip-address}/
Nota:a seconda della configurazione, vai a -> Autenticazione utente -> e potresti voler modificare il parametro requiredlogin e emailregexp.

Risoluzione dei problemi di installazione di Bugzilla

Problema 1:modulo DBD::mysql non riuscito

Il modulo DBD:mysql perl non è riuscito con il messaggio di errore "mysql.h:No such file or directory" come mostrato di seguito.

# /usr/bin/perl install-module.pl DBD::mysql

dbdimp.h:22:49: error: mysql.h: No such file or directory
dbdimp.h:23:45: error: mysqld_error.h: No such file or directory
dbdimp.h:25:49: error: errmsg.h: No such file or directory
In file included from dbdimp.c:20:
dbdimp.h:144: error: expected specifier-qualifier-list before âMYSQLâ
dbdimp.h:236: error: expected specifier-qualifier-list before âMYSQL_RESâ

Soluzione1:installa mysql-devel

Il messaggio di errore "mysql.h:No such file or directory" è dovuto al fatto che il pacchetto mysql-devel era mancante come mostrato di seguito.

# rpm -qa | grep -i mysql
MySQL-python-1.2.1-1
mysql-5.0.77-4.el5_4.2
mysql-connector-odbc-3.51.26r1127-1.el5
mysql-server-5.0.77-4.el5_4.2
libdbi-dbd-mysql-0.8.1a-1.2.2
perl-DBD-MySQL-3.0007-2.el5

Installa il pacchetto mysql-devel come mostrato di seguito.

# yum install mysql-devel

# rpm -qa | grep -i "mysql-devel"
mysql-devel-5.0.77-4.el5_4.2

L'installazione di DBD::mysql andrà a buon fine senza alcun problema.

# /usr/bin/perl install-module.pl DBD::mysql

Problema 2:GD fallito con gdlib-config / libgd mancante

Installazione del modulo GD non riuscita con il seguente messaggio di errore.

# /usr/bin/perl install-module.pl GD

**UNRECOVERABLE ERROR**
Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher.
If you want to try to compile anyway, please rerun this script with the option --ignore_missing_gd.
Running make test
  Make had some problems, maybe interrupted? Won't test
Running make install
  Make had some problems, maybe interrupted? Won't install

Soluzione2:installa il pacchetto gd-devel

Installa libgd (ovvero il pacchetto gd-devel) come mostrato di seguito per risolvere il problema del modulo GD.

# yum install gd-devel

# rpm -qa | grep gd
gd-2.0.33-9.4.el5_4.2
gd-devel-2.0.33-9.4.el5_4.2

GD è stato installato senza problemi dopo aver inserito il pacchetto gd-devel.

# /usr/bin/perl install-module.pl GD

Problema 3:Twig non riuscito con errore expat.h

Impossibile installare il modulo Twig con il messaggio di errore "expat.h:No such file or directory" come mostrato di seguito.

# /usr/bin/perl install-module.pl XML::Twig

Expat.xs:12:19: error: expat.h: No such file or directory
Expat.xs:60: error: expected specifier-qualifier-list before XML_Parser

Soluzione 3:installa expat ed expat-devel per Twig

Installa il pacchetto expat ed expat-devel come mostrato di seguito.

# yum install expat

# yum install expat-devel

Ora installa Twig senza problemi.

# /usr/bin/perl install-module.pl XML::Twig

Problema 4:Immagine::Installazione di Magick non riuscita

Immagine::Installazione di Magick non riuscita con messaggio di errore "magick/MagickCore.h:No such file or directory" come mostrato di seguito.

# /usr/bin/perl install-module.pl Image::Magick

Note (probably harmless): No library found for -lMagickCore
Magick.xs:64:31: error: magick/MagickCore.h: No such file or directory
Magick.xs:171: error: expected specifier-qualifier-list before ‘MagickRealType’
Magick.xs:192: error: expected specifier-qualifier-list before ‘ImageInfo’
Magick.xs:214: error: ‘MagickNoiseOptions’ undeclared here (not in a function)
Magick.xs:214: warning: missing initializer

Soluzione4:Immagine::Installazione di Magick non riuscita

Assicurati che siano presenti i seguenti pacchetti correlati a ImageMagic.

# rpm -qa | grep -i Image
ImageMagick-6.2.8.0-4.el5_1.1
ImageMagick-c++-devel-6.2.8.0-4.el5_1.1
ImageMagick-devel-6.2.8.0-4.el5_1.1
ImageMagick-c++-6.2.8.0-4.el5_1.1
ImageMagick-perl-6.2.8.0-4.el5_1.1

Nel mio caso mancava ImageMagic-devel. Quindi, installalo come mostrato di seguito. Successivamente, il modulo perl Image::Magick è stato installato correttamente.

# yum install ImageMagick-devel

# /usr/bin/perl install-module.pl Image::Magick

Problema 5:Impossibile installare SOAP::Lite

Impossibile installare il modulo SOAP::Lite con il messaggio "Impossibile individuare version.pm in @INC" come mostrato di seguito.

#/usr/bin/perl install-module.pl SOAP::Lite

Failed test 'use SOAP::Lite;' at t/SOAP/Data.t line 5.
Tried to use 'SOAP::Lite'.
Error:  Can't locate version.pm in @INC

Soluzione5:installa version.pm richiesto per SOAP::Lite

Installato version.pm come mostrato di seguito. Successivamente, SOAP::Lite è stato installato senza alcun problema.

# perl -MCPAN -e 'install version' 

# /usr/bin/perl install-module.pl SOAP::Lite

Problema6 (e Soluzione6):mancava mod_perl

Non installare mod_perl usando /usr/bin/perl install-module.pl mod_perl2 . Insetad, usa yum per installare mod_perl come mostrato di seguito.

# yum install mod_perl

Problema 7:avvio di Apache non riuscito

Avvio di Apache non riuscito con messaggio di errore "Impossibile individuare Template/Config.pm in @INC".

# service httpd restart
Stopping httpd:                                            [  OK  ]

Starting httpd: Syntax error on line 994 of /etc/httpd/conf/httpd.conf:
Can't locate Template/Config.pm in @INC

Soluzione7:installa Template-Tool Kit come mostrato di seguito

Installa il kit Template-Tool per correggere il messaggio di errore di Apache sopra

# cpan
cpan> i /Template-Toolkit/
Distribution    A/AB/ABEL/Eidolon-Driver-Template-Toolkit-0.01.tar.gz
Distribution    A/AB/ABW/Template-Toolkit-1.07.tar.gz
Distribution    A/AB/ABW/Template-Toolkit-2.22.tar.gz
Distribution    I/IN/INGY/Template-Toolkit-Simple-0.03.tar.gz
4 items found

cpan> install A/AB/ABW/Template-Toolkit-2.22.tar.gz

Problema 8:l'avvio di Apache non è riuscito di nuovo

Avvio di Apache non riuscito con messaggio di errore "Impossibile individuare DateTime/Locale.pm in @INC".

# service httpd restart
Stopping httpd:                                            [  OK  ]

Starting httpd: Syntax error on line 994 of /etc/httpd/conf/httpd.conf:
Can't locate DateTime/Locale.pm in @INC

Soluzione8:installa DateTime/Locale.pm come mostrato di seguito

Installa DateTime/Locale.pm per correggere il messaggio di errore di Apache sopra

# cpan

cpan> install DateTime:Locale

Inoltre, nel tuo apache error_log se vedi il problema Digest/SHA.pm, dovresti installarlo come mostrato di seguito.

# tail -f /etc/httpd/logs/error_log
Can't locate Digest/SHA.pm in @INC (@INC contains: 

# cpan
cpan> install Digest::SHA

Linux
  1. Una guida al terminale Linux per principianti

  2. Kali Linux su VirtualBox:una guida all'installazione passo passo

  3. Come installare Arch Linux:Guida all'installazione passo passo per principianti

  4. Come installare Void Linux:una guida passo passo completa

  5. Guida completa per l'utilizzo di AsciiDoc in Linux

20 passaggi per preparare il tuo PC all'installazione di Linux

Guida rapida ad Ansible per amministratori di sistema Linux

Guida per la configurazione del server SFTP in Linux

Guida dettagliata alle variabili d'ambiente Linux

Crea una partizione in Linux:una guida passo passo

Installa Golang su Linux – Guida passo passo