you're reading...


How to install bugzilla?

This setup guide is aimed at helping users install and configure Bugzilla on Fedora or RedHat Enterprise Linux (RHEL) platform.


Bugzilla is a web-based general-purpose bug tracker and testing tool originally developed and used by the Mozilla project, and licensed under the Mozilla Public License. Released as open source software by Netscape Communications in 1998, it has been adopted by a variety of organizations for use as a defect tracker for both free software and proprietary products. (Source: Wikipedia)


  • Perl (5.8.1 or above)
  • Database Engine (MySQL or Oracle or PostgreSQL)
  • Webserver (Apache, IIS)
  • Required Perl Modules
  • Mail Transfer Agent (Sendmail 8.7 or above)

In this tutorial, we will be using a Fedora system with MySQL as the database server, apache as the webserver and Sendmail as the MTA. To install all of these prerequisites, you can issue the following command on the terminal as a root user:

yum -y install perl httpd sendmail mod_perl mysql mysql-server mysql-libs mysql-connector-odbc mysqlclient* perl-Class-DBI-mysql libcgi perl-DateManip perl-DateTime-Format-Builder libdbi libdbi-dbd-MySQL libdbi-drivers libdbi-devel perl-CGI-Untaint-email perl-CPAN perl-libxml-perl 

Obtaining Bugzilla

Bugzilla is a free software and you can download it from Bugzilla website. To download the recent stable release, follow this link.

Installation of Prerequisites

  • Be sure you’ve installed all the prerequisites as discussed above.
  • Download the Bugzilla recent stable release tarball.
  • Copy the tarball to the httpd’s DocumentRoot (i.e. /var/www/html/):
cp bugzilla-*.*.*.tar.gz /var/www/html/
  • Extract the tarball:
cd /var/www/html/
tar -zxvf bugzilla-*.*.*.tar.gz
  • The previous command shall create a folder named bugzilla-*.*. Now, you can safely remove the tarball.
rm bugzilla-*.*.*.tar.gz
  • Now we need to check the installed Perl modules and find a list of all the Perl modules to be installed.
cd bugzilla-*.*
./checksetup.pl --check-modules
  • Next step is to install the required Perl modules (this assumes that you have CPAN installed in your computer). The following command will use CPAN LWP agent and install all the required modules.
perl install-module.pl --all


After the installation of all the prerequisites has successfully been done, we configure and tune the installation.

  • Move inside the bugzilla directory (/var/www/bugzilla-*.*) if you are not already inside it
cd /var/www/html/bugzilla-*.*
  • Now run the check setup perl script to begin configuration.

This time, checksetup.pl should tell you that all the correct modules are installed and will display a message about, and write out a file called, localconfig. This file contains the default settings for a number of Bugzilla parameters.

Load this file in your editor. The only two values you need to change are $db_driver and $db_pass, respectively the type of the database and the password for the user you will create for your database. Pick a strong password (for simplicity, it should not contain single quote characters) and put it here. $db_driver can be either ‘MySQL’, ‘Pg’ or ‘oracle’. Since we are using MySQL, the $db_driver variable should be set to ‘MySQL’.

  • Set the $db_driver variable to ‘MySQL’.
$db_driver = 'mysql';
  • Set $db_host to the hostname or ip of the myql server. The preferred value is ‘localhost’, since the same machine is also to be configured as a database server.
$db_host = 'localhost';
  • Set the $db_name as ‘bugs’ and $db_user as ‘bugs’.
$db_name = 'bugs';
$db_user = 'bugs';
  • Set $db_pass to the password of the ‘bugs’ database user in MySQL. Let’s assume that password is bugs123#.
$db_pass = 'bugs123#';

Note: You are encouraged to use your own strong password. This password has just been used as a reference. Remember, the same password needs to be used while creating a MySQL user for Bugzilla.

  • After setting all the above variables, just save the file and exit the editor.
  • Now we need to tune and configure MySQL to allow easy access to Bugzilla and its components. To do so edit the MySQL configuration file (generally /etc/my.cnfon Linux systems) and follow the following procedure:
    • Under the [mysqld] section inside that file, add directive to allow MySQL insert data bigger than 64K (default), since Bugzilla needs to insert data more than the default size. Bugzilla needs to use large attachments.
# Allow packets up to 4MB
  • Also, Bugzilla requires small words to be indexed in full-text search which is not enabled by default. Hence we need to add a directive to allow indexing of even small words in full-text search.
# Allow small words in full-text indexes

Rebuilding the indexes can be done based on documentation found at http://www.MySQL.com/doc/en/Fulltext_Fine-tuning.html.

  • Now we add a database user defined by the variable $db_user (i.e. bugs) and set the password to $db_pass (i.e. bugs123#), though you are encouraged to use your own password. Further we set this user to have all sort of privileges over the $db_name (i.e. bugs) database.

Note: Please use the same password that you specified in the localconfig file identified by the variable $db_pass.

  • Next we allow MySQL to have attachment tables to grow beyond 4 GB (the default maximum limit is just 4 GB and Bugzilla might require more space). Although this step forms a part of database configuration, we will postpone this step until the rest part of the configuration is complete.
use bugs;
ALTER TABLE attachments AVG_ROW_LENGTH=1000000, MAX_ROWS=20000;

This command sets MySQL to let the attachment table grow up to 20 GB.

  • Now after the local configuration file (i.e. localconfig) has been edited and all the other necessary configuration has been made, we again rerun the script to make Bugzilla bind to the configuration and create necessary files and setting parameters. Running the script reconfirms that all the modules are present, and notices the altered localconfig file, which it assumes you have edited to your satisfaction. It compiles the UI templates, connects to the database using the ‘bugs’ user you created and the password you defined, and creates the ‘bugs’ database and the tables therein. After that, it asks for details of an administrator account. Bugzilla can have multiple administrators – you can create more later – but it needs one to start off with. Enter the email address of an administrator, his or her full name, and a suitable Bugzilla password.
  • Next comes the configuration of the web-server to correctly display the Bugzilla pages and apply appropriate permissions to the Bugzilla installation base directory. Since we are using Apache web-server, we have two options to run Bugzilla. Bugzilla is written using Perl CGI, and hence two apache modules are available to run and show CGI scripts. You can choose any one of them (remember to install the required apache module before performing this step). Using mod_cgi is preferred.
    • Apache httpd with mod_cgi
      • Open the httpd configuration file (/etc/httpd/conf/httpd.conf).
      • Now we add a <directory> directive to the configuration file to permit fine-grained permission setting over the Bugzilla installation base.
Alias /bugzilla/ /var/www/html/bugzilla-*.*/

<Directory "/var/www/html/bugzilla-*.*">
	AddHandler cgi-script cgi
	DirectoryIndex index.cgi
	Options +Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch +FollowSymLinks
	AllowOverride None
	Order allow,deny
	Allow from all

<Directory "/var/www/html/bugzilla-*.*/data">
	Options FollowSymLinks
	AllowOverride None
	Order allow,deny
	Allow from all
  • Save the configuration file and exit the editor.
  • Run the checksetup.pl script to complete the configuration.
  • Apache httpd with mod_perl
  • Open the httpd configuration file (/etc/httpd/conf/httpd.conf).
  • Add the following directive in the http configuration file before any other mod_perl directives:

PerlSwitches -I/var/www/html/bugzilla -w -T
PerlConfigRequire /var/www/html/bugzilla/mod_perl.pl
  • Save the file and exit the editor.
  • Run the checksetup.pl script to complete the configuration.
  • Now restart the httpd daemon to apply the settings.
/sbin/service httpd restart
  • Now, you can point your browser at http://localhost/bugzilla/ to open the Bugzilla page.
  • At this point, you are required to login with the administrator account which you created while running the checksetup.pl script. Generally the user name is the email address that you provided while running the script.
  • After logging in to the Bugzilla system, you are required to edit some key parameters. To edit the parameters, follow the “Administration” link on the top navigation bar, and from the page that opens, you can follow the “Parameters” link. Alternatively, you can point your browser to http://localhost/bugzilla/editparams.cgi.
    • Set the maintainer parameter to your email address <yourname@yourdomain.tld>.
    • Set the urlbase parameter to http://<hostname>/bugzilla/. Remember to replace the <hostname> with the appropriate hostname of the bugzilla server machine and don’t use “localhost” for this parameter.
    • Save the parameters by clicking on the “Save Changes” button at the bottom of the page.
  • On the Parameters page, there is a vertical navigation bar on the left most part. The navigation bar contains links to various settings that you might want to change according to your need. After editing any of the parameters, don’t forget to save the changes. Unless the changes are saved, they are not applied to the Bugzilla system.
  • Next you need to add products, components, versions, and milestones. For this purpose follow the “Administration” link on the top navigation bar and then follow the appropriate links. By default a test product and a test component is already added. You can edit those and replace by your own. The administration page also contains other link to other settings, you can choose to change them according to your need.
  • From the administration page, follow the “Users” link and add new user and/or edit existing users.
  • To change the preferences of the currently logged in user, follow the “Preferences” link at the bottom or top navigation bar, alternatively, you can point your browser to http://localhost/bugzilla/userprefs.cgi.
  • You can file a new bug by following the “New” link on the navigation bar, alternatively you can point your browser to http://localhost/bugzilla/enter_bug.cgi.
  • You can use the “Search” or the “Reports” features to get information about the bugs that have been filed by various users of the system.

Enjoy a robust bugtracker and testing platform.


2 Responses to “How to install bugzilla?”

  1. You have “Add the following directive in the http configuration file before any other mod_perl directives:” but nothing follows other than another bullet point. Is there some directive missing?

    Posted by WR | July 7, 2011, 11:42 pm

Post a Comment