Instalación de Bugzilla en windows

De ChuWiki

Instalación de bugzilla en windows[editar]

Bugzilla es un conjunto de cgi que nos pemiten llevar una base de datos de incidencias de un proyecto desde un navegador web. Supuestamente, cuando alguien da de alta una incidencia, envía correos a las personas implicadas y los devuelve cuando las incidencias se van corrigiendo.

Necesita un servidor web con base de datos. En la instalación yo tengo apache y mysql sobre windows. También necesita perl, así que hay que instalarlo.

  • Bugzilla se puede bajar de http://www.bugzilla.org/download/#v222 y me bajo la 2.22 que es la última estable en este momento.
  • Una vez bajado el fichero, lo desempaqueto en el directorio de mi sitio web donde quiero que corra bugzilla. Me crea un subdirectorio bugzilla-2.22 y dentro un montón de ficheros.
  • Instalo perl que es necesario. Una vez hecho, abro una ventana de ms-dos, voy al directorio bugzilla-2.22 y ejecuto
c:\> perl checksetup.pl

esto me indica si tengo o no todo lo necesario para correr bugzilla. De momento me da errores de que necesito ciertos módulos de perl adicionales

Bugzilla requires some Perl modules which are either missing from
your system, or the version on your system is too old.
They can be installed by running (as Administrator) the following:
   ppm install MailTools
   Minimum version required: 1.67
   ppm install MIME-Tools
   Minimum version required: 5.406
   ppm install AppConfig
   Minimum version required: 1.52
   ppm install Template-Toolkit
   Minimum version required: 2.08
   ppm install TimeDate
   Minimum version required: 2.21
   ppm install DBI
   Minimum version required: 1.38

Instalo el primer paquete con perl, y obtengo lo siguiente

c:\> ppm install MailTools
====================
Install 'MailTools' version 1.74 in ActivePerl 5.8.8.817.
====================
Installing C:\Perl\html\site\lib\Mail\Address.html
Installing C:\Perl\html\site\lib\Mail\Cap.html
Installing C:\Perl\html\site\lib\Mail\Field.html
Installing C:\Perl\html\site\lib\Mail\Filter.html
Installing C:\Perl\html\site\lib\Mail\Header.html
Installing C:\Perl\html\site\lib\Mail\Internet.html
Installing C:\Perl\html\site\lib\Mail\Mailer.html
Installing C:\Perl\html\site\lib\Mail\Send.html
Installing C:\Perl\html\site\lib\Mail\Util.html
Installing C:\Perl\html\site\lib\Mail\Field\AddrList.html
Installing C:\Perl\site\lib\auto\Mail\Internet\add_signature.al
Installing C:\Perl\site\lib\auto\Mail\Internet\autosplit.ix
Installing C:\Perl\site\lib\auto\Mail\Internet\escape_from.al
Installing C:\Perl\site\lib\auto\Mail\Internet\nntppost.al
Installing C:\Perl\site\lib\auto\Mail\Internet\reply.al
Installing C:\Perl\site\lib\auto\Mail\Internet\send.al
Installing C:\Perl\site\lib\auto\Mail\Internet\sign.al
Installing C:\Perl\site\lib\auto\Mail\Internet\smtpsend.al
Installing C:\Perl\site\lib\auto\Mail\Internet\unescape_from.al
Installing C:\Perl\site\lib\auto\Mail\Internet\_prephdr.al
Installing C:\Perl\site\lib\auto\Mail\Util\autosplit.ix
Installing C:\Perl\site\lib\auto\Mail\Util\mailaddress.al
Installing C:\Perl\site\lib\auto\Mail\Util\maildomain.al
Installing C:\Perl\site\lib\auto\Mail\Util\read_mbox.al
Installing C:\Perl\site\lib\Mail\Address.pm
Installing C:\Perl\site\lib\Mail\Cap.pm
Installing C:\Perl\site\lib\Mail\Field.pm
Installing C:\Perl\site\lib\Mail\Filter.pm
Installing C:\Perl\site\lib\Mail\Header.pm
Installing C:\Perl\site\lib\Mail\Internet.pm
Installing C:\Perl\site\lib\Mail\Mailer.pm
Installing C:\Perl\site\lib\Mail\Send.pm
Installing C:\Perl\site\lib\Mail\Util.pm
Installing C:\Perl\site\lib\Mail\Field\AddrList.pm
Installing C:\Perl\site\lib\Mail\Field\Date.pm
Installing C:\Perl\site\lib\Mail\Mailer\qmail.pm
Installing C:\Perl\site\lib\Mail\Mailer\rfc822.pm
Installing C:\Perl\site\lib\Mail\Mailer\sendmail.pm
Installing C:\Perl\site\lib\Mail\Mailer\smtp.pm
Installing C:\Perl\site\lib\Mail\Mailer\testfile.pm
Successfully installed MailTools version 1.74 in ActivePerl 5.8.8.817.

repito con los demás paquetes. Hay uno que me da un error de que no puede instalar determinadas caracteríasticas adicionales. Lo ignoro y continuo con los demás paquetes.

Una vez instalados, vuelvo a ejecutar

c:/> perl checksetup.pl

Checking perl modules ...
Checking for       AppConfig (v1.52)   ok: found v1.55
Checking for             CGI (v2.93)   ok: found v3.15
Checking for    Data::Dumper (any)     ok: found v2.121_08
Checking for    Date::Format (v2.21)   ok: found v2.22
Checking for             DBI (v1.38)   ok: found v1.50
Checking for      File::Spec (v0.84)   ok: found v3.12
Checking for      File::Temp (any)     ok: found v0.16
Checking for        Template (v2.08)   ok: found v2.13
Checking for      Text::Wrap (v2001.0131) ok: found v2005.082401
Checking for    Mail::Mailer (v1.67)   ok: found v1.74
Checking for    MIME::Base64 (v3.01)   ok: found v3.07
Checking for     MIME::Tools (v5.406)  ok: found v5.411
Checking for        Storable (any)     ok: found v2.15

The following Perl modules are optional:
Checking for              GD (v1.20)    not found
Checking for     Chart::Base (v1.0)     not found
Checking for       XML::Twig (any)      not found
Checking for       GD::Graph (any)      not found
Checking for GD::Text::Align (any)      not found
Checking for     PatchReader (v0.9.4)   not found
Checking for   Image::Magick (any)      not found

All the required modules are available at:
    http://landfill.bugzilla.org/ppm/
You can add the repository with the following command:
    ppm rep add bugzilla http://landfill.bugzilla.org/ppm/

If you you want to see graphical bug charts (plotting historical data over
time), you should install libgd and the following Perl modules:

GD:          ppm install GD
Chart:       ppm install Chart

If you want to use the bug import/export feature to move bugs to
or from other bugzilla installations, you will need to install
 the XML::Twig module by running (as Administrator):

   ppm install XML::Twig

If you want to convert BMP image attachments to PNG to conserve
disk space, you will need to install the ImageMagick application
Available from http://www.imagemagick.org, and the Image::Magick
Perl module by running (as Administrator):

   ppm install Image::Magick

If you you want to see graphical bug reports (bar, pie and line charts of
current data), you should install libgd and the following Perl modules:

GD:              ppm install GD
GD::Graph:       ppm install GDGraph
GD::Text::Align: ppm install GDTextUtil

If you want to see pretty HTML views of patches, you should install the
PatchReader module:
PatchReader: ppm install PatchReader
Checking user setup ...

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:   index_html cvsbin interdiffbin diffpath create_htaccess webserv
ergroup db_driver db_host db_pass db_sock db_check

Veo que hay una serie de módulos opcionales que se pueden instalar si se quieren determinadas caracteríasticas, pero de momento los ignoro. Me fijo en las últimas líneas que indican que editemos el fichero ./localconfig para cambiar el valor de las variables que nos resulten interesantes. Edito el fichero y toco más o menos a ojo (básicamente poner el nombre de la base de datos a usar, usuario y password).

Vuelvo a ejecutar el checksetup

c:\> perl checksetup.pl

Checking perl modules ...
Checking for       AppConfig (v1.52)   ok: found v1.55
Checking for             CGI (v2.93)   ok: found v3.15
Checking for    Data::Dumper (any)     ok: found v2.121_08
Checking for    Date::Format (v2.21)   ok: found v2.22
Checking for             DBI (v1.38)   ok: found v1.50
Checking for      File::Spec (v0.84)   ok: found v3.12
Checking for      File::Temp (any)     ok: found v0.16
Checking for        Template (v2.08)   ok: found v2.13
Checking for      Text::Wrap (v2001.0131) ok: found v2005.082401
Checking for    Mail::Mailer (v1.67)   ok: found v1.74
Checking for    MIME::Base64 (v3.01)   ok: found v3.07
Checking for     MIME::Tools (v5.406)  ok: found v5.411
Checking for        Storable (any)     ok: found v2.15

The following Perl modules are optional:
Checking for              GD (v1.20)    not found
Checking for     Chart::Base (v1.0)     not found
Checking for       XML::Twig (any)      not found
Checking for       GD::Graph (any)      not found
Checking for GD::Text::Align (any)      not found
Checking for     PatchReader (v0.9.4)   not found
Checking for   Image::Magick (any)      not found

All the required modules are available at:
    http://landfill.bugzilla.org/ppm/
You can add the repository with the following command:
    ppm rep add bugzilla http://landfill.bugzilla.org/ppm/

If you you want to see graphical bug charts (plotting historical data over
time), you should install libgd and the following Perl modules:

GD:          ppm install GD
Chart:       ppm install Chart

If you want to use the bug import/export feature to move bugs to
or from other bugzilla installations, you will need to install
 the XML::Twig module by running (as Administrator):

   ppm install XML::Twig

If you want to convert BMP image attachments to PNG to conserve
disk space, you will need to install the ImageMagick application
Available from http://www.imagemagick.org, and the Image::Magick
Perl module by running (as Administrator):

   ppm install Image::Magick

If you you want to see graphical bug reports (bar, pie and line charts of
current data), you should install libgd and the following Perl modules:

GD:              ppm install GD
GD::Graph:       ppm install GDGraph
GD::Text::Align: ppm install GDTextUtil

If you want to see pretty HTML views of patches, you should install the
PatchReader module:
PatchReader: ppm install PatchReader
Checking user setup ...
Creating data directory (./data) ...
Creating local attachments directory ...
Creating graphs directory...
Creating .htaccess...
Creating ./data/attachments/.htaccess...
Creating Bugzilla/.htaccess...
Creating ./data/.htaccess...
Creating ./template/.htaccess...
Creating ./data/webdot/.htaccess...

Bugzilla requires an SMTP server to function on Windows.
Please enter your SMTP server's hostname: "AQUI PONGO MI SERVIDOR SMTP"
Precompiling templates ...
Bugzilla requires that perl's DBD::mysql be installed.
To install this module, you can do:
    ppm install DBD-mysql

En un momento se para y me pide mi servidor de smtp (supongo que para enviar los correos, ver en las últimas líneas de la salida). Le pongo el nombre/ip de dicho servidor. Luego me dice que necesito instalar el módulo de perl para mysql, así que ejecuto

c:\> ppm install DBD-mysql
====================
Install 'DBD-mysql' version 3.0002 in ActivePerl 5.8.8.817.
====================
Installing C:\Perl\site\lib\auto\DBD\mysql\mysql.bs
Installing C:\Perl\site\lib\auto\DBD\mysql\mysql.dll
Installing C:\Perl\site\lib\auto\DBD\mysql\mysql.exp
Installing C:\Perl\site\lib\auto\DBD\mysql\mysql.lib
Installing C:\Perl\html\site\lib\Mysql.html
Installing C:\Perl\html\site\lib\Bundle\DBD\mysql.html
Installing C:\Perl\html\site\lib\DBD\mysql.html
Installing C:\Perl\html\site\lib\DBD\mysql\INSTALL.html
Files found in blib\arch: installing files in blib\lib into architecture depende
nt library tree
Installing C:\Perl\site\lib\Mysql.pm
Installing C:\Perl\site\lib\Bundle\DBD\mysql.pm
Installing C:\Perl\site\lib\DBD\mysql.pm
Installing C:\Perl\site\lib\DBD\mysql\GetInfo.pm
Installing C:\Perl\site\lib\DBD\mysql\INSTALL.pod
Installing C:\Perl\site\lib\Mysql\Statement.pm
Successfully installed DBD-mysql version 3.0002 in ActivePerl 5.8.8.817.

Vuelvo a ejecutar el checksetup.pl (quito de la salida todo lo que es repetido...). Crea también un montón de tablas en la base de datos, también me salto esa salida. Al final me pide un correo para el administrador de la base de datos de bugzilla.

c:\> perl checksetup.pl
...
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: "AQUI PONGO MI CORREO DE ADMINISTRADOR"
You entered "AQUI SALE MI CORREO DE ADMINISTRADOR".  Is this correct? [Y/n] Y
Enter the real name of the administrator: "AQUI PONGO MI NOMBRE"
Enter a password for the administrator account: "AQUI PONGO UNA PASSWORD"

Please retype the password to verify: "AQUI PONGO LA MISMA PASSWORD"

"AQUI SALE MI CORREO DE ADMINISTRADOR" is now set up as an administrator account.
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.

Configurar apache para Bugzilla[editar]

Ahora me toca configurar apache para que todo esto vaya bien.

Edito el fichero de configuracion de apache: "inicio", "programas", "apache http server", "configure apache server", "edit de httpd.conf apache configuration file".

Voy a la linea que pone

#AddHandler cgi-script .cgi

y la descomento quitándole la # de delante.

Justo después de un sitio que pone

#
# "C:/Archivos de programa/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Archivos de programa/Apache Software Foundation/Apache2.2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

le añado mi directorio de bugzilla con lo siguiente

#
# "C:/Archivos de programa/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Archivos de programa/Apache Software Foundation/Apache2.2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

<Directory "C:/PATH_DE_MI_SITIO_WEB/bugzilla-2.22">
    Options +ExecCGI
    AllowOverride Limit
    DirectoryIndex index.cgi
</Directory>

Reinicio el servidor apache: "inicio", "programas", "apache http server", "control apache server", "restart".

Un problemilla con Bugzilla y la ubicación de Perl[editar]

Abro el navegador, me voy a donde tengo bugzilla http://localhost/bugzilla-2.22

y me sale un "internal server error". Al final, investigando, veo que el index.cgi de bugzilla busca perl en /usr/bin/perl, que supongo es la ubicación en unix/linux. En mi pc, perl se instaló en c:\perl\bin\perl.exe, así que cambio c:\perl por c:\usr

Nuevamente al nevegador y ya funciona.

Cuando necesitas instalar algún plugin de Bugzilla por ejemplo el testopia debes cambiar nuevamente el nombre de la carpeta a Perl para ejecutar nuevamente el checksetup.pl y para visualizarlo en el navegador debes renombrar nuevamente la carpeta Perl como usr. Para evitar este cambio puedes descargarte una herramienta como MB-SearchReplace Pro 1.1 para reemplazar en todos los archivos .pl .cgi y .pm el string #!/usr/bin/perl por #!C:/Perl/bin/perl

Hacer que Bugzilla pueda enviar correos[editar]

Para que bugzilla envíe correos pueden pasar varias cosas.

En bugzilla, entrando como administrador y seleccionando "parameters", "email", podemos configurar qué queremos usar para que bugzilla envíe emails.

Una opción es poner "smtp" y el nombre del servidor smtp. Esto puede que le funcione a gente normal, pero no a mí, que estoy dentro de una empresa con proxy que requiere usuario/password y con un servidor de smtp de la empresa que requiere usuario/password. Como no encontré ningún sitio para poner ese usuario/password o el proxy, me decidí por otra opción.

Otra opción, la que usé, es "sendmail". Para usar "sendmail" desde windows, debemos instalarlo. Me bajé un gratuito y que tiene instalador de sendmail para bugzilla. Para que todo funcione como debe, este sendmail debería instalarse en C:\usr\lib\sendmail.exe. Este es el sitio en el que bugzilla lo busca. sendmail tiene un fichero sendmail.ini en el que podemos tocar cosas como servidor smtp que vamos a usar, usuario y password de ese servidor, etc, etc.

Si queremos instalar sendmail en otro sitio, lo hacemos, pero debemos tocar el fichero ./Bugzilla/Constants.pm de donde hayamos instalado bugzilla. Ahí hay una línea al final que pone algo así como

use constant SENDMAIL_EXE => '/usr/lib/sendmail.exe';

debemos tocarla para que apunte al sitio donde tenemos sendmail.exe

Luego, en mi caso, tuve un problema secundario que pongo por si a alguien le pasa, pero que no tiene por qué. El servidor de smtp de mi empresa no me permite enviar un correo con el campo "from" cambiado (que no sea mi usuario). Como bugzilla se conecta con mi cuenta (a través de sendmail) y pone en el campo "from" algo como "bugzilla-admin-daemon" o "bugzilla-admin", tuve que buscar por todos los ficheros de bugzilla y en la configuración de correo para cambiar ese "from" por mi usuario. Con esto todo listo.

Los ficheros que toqué de bugzilla son estos

./data/template/template/en/default/account/cancel-token.txt.tmpl:    $output .=  "\n\nFrom: bugzilla-admin-daemon\nTo: ";

./data/template/template/en/default/account/email/change-new.txt.tmpl:    $output .=  "\nFrom: bugzilla-admin-daemon\nTo: ";

./data/template/template/en/default/account/email/change-old.txt.tmpl:    $output .=  "\nFrom: bugzilla-admin-daemon\nTo: ";

./data/template/template/en/default/account/password/forgotten-password.txt.tmpl:    $output .=  "\nFrom: bugzilla-admin-daemon\nTo: ";

./template/en/default/account/cancel-token.txt.tmpl~:From: bugzilla-admin-daemon

./template/en/default/account/email/change-old.txt.tmpl~:From: bugzilla-admin-daemon

./template/en/default/account/password/forgotten-password.txt.tmpl~:From: bugzilla-admin-daemon

En cuanto a la configuración, en "parameters", "email" hay varias cajas con los textos que se van a enviar por los correos en los que está el "from".

Enlaces sobre Bugzilla[editar]