Friday, April 16, 2010

Installing Bugzilla 3.2

Bugzilla is an open source, web-based bug-tracking application.



Prerequisites
Web server configured to process CGI requests
Perl 5.8.1 and above
MySQL 4.2.1 and above
Internet connection

Versions used
Apache 2.2.8
MySQL 5.0.45
ActivePerl 5.8.8.820

Steps
  • Download the package [tarball] from the bugzilla website, bugzilla.org.
  • Unzip the package to a folder in the web server's document root, e.g. Bugzilla
  • Create a database on the MySQL server e.g.
mysql> create database bugs;
mysql> grant all on bugs.* to bugs@localhost' identified by 'password';
mysql> quit;
  • Confirm/enable CGI support in Apache by including the following line in the section of the httpd.conf file
AddHandler cgi-script .cgi
  • Allow running of .cgi scripts by adding the ExecCGI option to the section of the the httpd.conf file
Options Indexes FollowSymLinks ExecCGI
  • Allow Bugzilla's .htaccess file to restrict access to sensitive documents by allowing it to override the defaults. This involves changing AllowOverride None to AllowOverride All
  • To tell Apache to use Perl to execute .cgi files, use the ScriptInterpreterSource directive. Add ScriptInterpreterSource Registry-Strict to the httpd.conf file. In order for ScriptInterpreterSource Registry-Strict to work, you also need to add an entry to the Registry. Create a key HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command with the default value of the full path of perl.exe with a -T parameter e.g. C:\Perl\bin\perl.exe -T . This will cause this path to be used to run the cgi scripts rather than the path specified in the first line of the scripts themselves. Bugzilla's cgi scripts specify the path of the perl executable as /usr/bin/perl
  • Add index.cgi to the DirectoryIndex list in the httpd.conf file
  • Restart Apache
  • To confirm that perl cgi scripts process OK, create a file test.cgi in the document root folder with the following contents and then navigate to localhost/test.cgi. If Hello, World is displayed on the browser, cgi configuration was successful
#!/perl/bin/perl
# test cgi execution of perl script
print "Content-type: text/html\r\n\r\n";
print "Hello, World.";
  • Open a command prompt window and run checksetup.pl in the bugzilla folder. This checks for perl modules required for bugzilla and guides on which ones to install if they aren't present
cd \apache\htdocs\bugzilla
perl checksetup.pl
  • With an internet connection available, run the commands given to install the relevant perl packages/modules using PPM [Perl Package Manager]. Add the suggested repository and install at least the mandatory packages. Alternatively download and unzip the individual packages from the suggested website e.g. theoryx5.uwinnipeg.ca/ppms for perl 5.8 packages or ppm.activestate.com/PPMPackages/zips/, and then use PPM to install them offline. e.g. ppm install c:\tmp\TimeDate.ppd
  • After all mandatory packages are installed and the script has read the ./localconfig file, edit the file C:\apache\htdocs\bugzilla\localconfig, updating the database variables, $db_driver, $db_name, $db_user, $db_pass, with details bugzilla will use to connect to the database created.
  • Run checksetup.pl again. This time it will build your database tables and initialise Bugzilla. Enter the hostname of the SMTP server to use [or localhost to continue installation]. Also enter the admin email, name and password. Installation is now complete.
  • Navigate to yourserver/bugzilla/ using your browser and login using the administrator account created. Use the email address as the login.
  • Click on the parameters link to update some required settings. Set at least the maintainer email address and urlbase. This is the final configuration step and after this bugzilla is ready for use.
 
  • Add a Scheduled Task to run collectstats.pl nightly
  • Add a Scheduled Task to run whineatnews.pl nightly
  • Add a Scheduled Task to run whine.pl nightly. whine.pl needs to run in Perl's Taint mode. The command line needs to include the -T option e.g. C:\Perl\bin\perl.exe -T C:\apache\htdocs\bugzilla\whine.pl
  • Backup the entire Bugzilla directory
  • Backup the Bugzilla Database. It contains all the Bugs, Users, Attachments etc. Schedule the mysqldump utility to create the database dump [backup file], and add the resulting file to your backup media 

Note
If the main bugzilla page doesn't load, check that the web server is properly configured by running the perl script testserver.pl in the bugzilla folder to get an idea of what may be wrong e.g.
cd \apache\htdocs\bugzilla
perl testserver.pl http://localhost/bugzilla

2 comments:

  1. Another option is use a hosting service like devZing who specializes in hosting Bugzilla.
    http://devzing.com/bugzilla.php

    ReplyDelete