Skip to main content

Track bugs with Bugzilla on Linux

A step-by-step installation guide for this popular open source defect tracker

Jason Clark (jclark4@us.ibm.com), developerWorks Systems Integrator, IBM, Software Group
Jason "Jay" Clark is the systems integrator and network administrator for the IBM developerWorks team in Research Triangle Park, NC. He currently holds multiple networking certifications and is well versed in both the Linux and Microsoft operating systems. Contact Jay at jclark4@us.ibm.com.

Summary:  For those in the support arena, keeping track of issues, problems, and the fixes applied to them can be a daunting task; however, there is a perfect open source answer to this challenge: Bugzilla. Once it is installed, you can easily track bugs and be notified when certain issues and solutions are discovered. This article provides a step-by-step guide for installing Bugzilla on a Linux™ system.

Date:  18 Mar 2005
Level:  Introductory
Activity:  674 views
Comments:  

Bugzilla is a defect or bug tracking system -- a system that allows individual or groups of developers to keep track of outstanding bugs in their products. This type of system lets users track bugs and code changes, communicate their actions with other teammates, submit and review repair patches, and manage quality assurance.

Bugzilla is prominent in the developer community because:

  • It is a full-featured implementation.
  • It is actively supported by the developer community and actively upgraded, often by the multitudes of users who work with it every day.
  • It is open source.
  • It is free.

Bugzilla is used by a number of organizations, including IBM at its Linux Technology Center. You can use the Bugzilla installation instructions in this article to add this bug-and-solution tracking tool to your Linux system.

Installation requirements

The latest stable version of Bugzilla, 2.18rc3, requires the following software versions to be installed on your Linux system (see Resources for links):

  • Perl version 5.6.0 or later, which should include the following Perl module versions:
    • AppConfig 1.52
    • CGI 2.93
    • Data::Dumper, any version
    • Date::Format 2.21
    • DBI 1.36
    • DBD::mysql 2.1010
    • File::Spec 0.82
    • File::Temp, any version
    • Template 2.08
    • Text::Wrap 2001.0131
  • MySQL version 3.23.41 or later
  • An HTTP Web server, preferably Apache or IBM_HTTP server (I will be using Apache in this process)
  • A mail transfer agent such as Sendmail 8.7 or later

If you're not sure that the proper Perl and MySQL software revision levels and Apache are installed, you can verify those packages this way:

  • For Perl verification, type $ perl -v
  • For MySQL verification, type $ mysql -V

To verify the Web server version, you can visit the Web server's test page like this:

http://<your-machine-name>/

The test page for the Web server should give you all the basic information about the server and is a pretty good indicator that you have installed it correctly!

Because this article covers only the installation of Bugzilla, it assumes that you already have Perl, MySQL, Apache, and sendmail running or can install them. (See the Resources section if you need them.)


On with the install

In a hurry?

If you're in a hurry, use this checklist to install Bugzilla. (Links are provided to the appropriate code sections for reference.)

  1. Get the latest tarball from the Bugzilla site.
  2. Unpack the Bugzilla tarball.
  3. Install the appropriate Perl modules.
  4. If necessary, get the correct Perl modules from CPAN.
  5. If you had to perform step 4, go back and do step 3 again to check for correct Perl modules.
  6. Create a localconfig file in the bugzilla directory.
  7. Configure the localconfig file to access the MySQL database.
  8. Connect to your instance of MySQL.
  9. Create a database account for Bugzilla.
  10. Rerun the Perl module setup check.
  11. Edit the HTTP server's configuration file.
  12. Visit the Bugzilla page and log in with the administrator account/password that was created with the checksetup.pl Perl script.
  13. Fini

Start by visiting the Bugzilla Web site (see the Resources section for the link) and downloading the latest tarball for the application. Place the tarball into a directory that can be accessed by your Web server user. In this case, because you are using the Apache Web server, you are going to download the tarball into Apache's default directory. The most basic installation of Apache allows the "apache" user to access the /var/www/html/ directory.

Please check the documentation of your Apache installation to ensure that you are placing the tarball in an accessible directory. In any case, you can modify this to suit your needs.

Unpack Bugzilla

Listing 1 shows you how to unpack all of the Bugzilla files into a directory called bugzilla-2.1.8rc3. Just for simplicity, you can optionally rename that directory to just "bugzilla" by executing the move command as shown.


Listing 1. Unpacking the Bugzilla tarball
$ cd /var/www/html/
$ tar zxvf bugzilla-2.18rc3.tgz
$ mv bugzilla-2.18rc3/ bugzilla/

Install the Perl modules

The Perl script in Listing 2 checks to see if you have the required Perl modules installed on your system. It also determines if you have the optional Perl modules that support features such as graphical charts and reports.


Listing 2. Perl module installation
$ su root
$ ./checksetup.pl

Once this script has run, it should tell you what modules you need and the corresponding CPAN command needed to install them from the CPAN repository. That CPAN command looks like this: $ perl -MCPAN -e 'install "<module-name>"'. Issue this command for each Perl module that you need to install. If you are connected to the Internet, this downloads and installs the requested module automatically.

Once you have completed all the required module installs, rerun the checksetup.pl script. If all is well, you should see the output indicating that all of the required Perl modules are installed.

Configure Bugzilla

The script creates a file in your bugzilla directory called localconfig (as shown in Listing 3).


Listing 3. Bugzilla configuration
$ vi localconfig

Configure the Bugzilla application to use your local database server. The command simply opens this file inside the vi editor. From here, you only need to change one value inside this file, the $db_pass field, the password used by the bugzilla's MySQL account (which you'll create in a moment). In case you have a more "customized" installation of MySQL, you may want to check all of the $db settings, since they correspond to hostname, communications port, and so on.

Create a database account for Bugzilla

Next, you need to create the MySQL database account for Bugzilla. Connect to your MySQL database instance and issue the following command:


Listing 4. Adding the Bugzilla MySQL account(version 4.0 or newer)
mysql>  GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
          CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* TO bugs@localhost
          IDENTIFIED BY '$db_pass';
mysql>  FLUSH PRIVILEGES;

This set of commands creates the bugs user and grants that user account numerous levels of access to the "bugs" database when connecting locally. Refer to the MySQL Administration documentation (see Resources) for similar commands if you are connecting to a remote database or for any other custom configurations.

Check those Perl modules again

To reassure yourself that the required modules are present, rerun the checksetup.pl script from the Bugzilla directory (Listing 5). It now detects that localconfig has been modified, and it starts the user interface compilation process. After that occurs, the "bugs" database is created using the account specified in the localconfig file and populates the database with all the necessary tables.


Listing 5. Rerun checksetup.pl from the Bugzilla directory
$ ./checksetup.pl

Finally, during this process you are asked how you would like to configure Bugzilla's administrator account.

Edit the HTTP server's configuration

With the most basic installation of Apache, the httpd.conf file is located in the /etc/httpd/conf/ directory. Be sure to check your installation to ensure that you are opening your Apache configuration file from the proper directory. Open it with the following command: $ vi /etc/httpd/conf/httpd.conf.

You need to edit a few lines inside this file to prepare Apache to utilize Bugzilla. First, you need to allow Apache to run CGI scripts outside of the cgi-bin directory. To do so, you must add (or uncomment) this line in httpd.conf: AddHandler cgi-script .cgi.

Next, you need to allow Bugzilla's .cgi files to run from the Bugzilla directory. Add these next two lines inside the <Directory /var/www/html > directive:

<Directory /var/www/html>
     ......
Options ExecCGI FollowSymLinks        <---- add this line.
AllowOverride Limit                     <---- add this line.

</Directory>

For the last step, you need to configure Apache to expect the index.cgi file when entering the Bugzilla directory by adding the following to the end of the DirectoryIndex line in httpd.conf: DirectoryIndex index.html index.html.var index.cgi.

That's it! You should now be able to visit the Bugzilla page at http://<your-server-name>/bugzilla. Remember to log in with the administrator account/password created with the checksetup.pl Perl script earlier in the installation.


Conclusion

With your new installation of Bugzilla, you can set up and configure many additional features. I encourage you to explore the various features of Bugzilla and figure out how you want to use them (I plan to use my Bugzilla server as a means of tracking the many issues that arise within our department). As a code-versioning system or as a problem-ticketing system, Bugzilla is versatile enough to meet your business needs.


Resources

About the author

Jason "Jay" Clark is the systems integrator and network administrator for the IBM developerWorks team in Research Triangle Park, NC. He currently holds multiple networking certifications and is well versed in both the Linux and Microsoft operating systems. Contact Jay at jclark4@us.ibm.com.

Comments



Trademarks

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Linux, Open source
ArticleID=56438
ArticleTitle=Track bugs with Bugzilla on Linux
publish-date=03182005
author1-email=jclark4@us.ibm.com
author1-email-cc=