JaVa
   

Bugzilla Setup

We will use Bugzilla version 2.16, the current stable release at the time of this writing, for the examples. Bugzilla is freely available under the GPL from http://www.bugzilla.org/. Once you have downloaded the gnu zipped tar, installation can begin.

Installation

First, there are some dependencies to be resolved before installing Bugzilla itself. These are a Web server, a database, and the Perl scripting language. Bugzilla highly recommends the most current version of Perl, the Apache Web server, and the MySQL database (There are many MySQL-specific function calls and data types buried in the Bugzilla code.)

MySQL

Currently Bugzilla is closely tied to the MySQL database, so if your server does not already have MySQL installed, you should install it before you attempt to install Bugzilla itself. MySQL is a freely available RDBMS that is available through http://www.mysql.com. For the purposes of this appendix we will install the MySQL server and the basic client tools. Make sure to download the following files:

Install the server and client tools using the Package Manager by typing the following, as root:

rpm -i MySQL-3.23.52-1.i386.rpm MySQL-client-3.23.52-1.i386.rpm 


The installation should produce output something like the following:

Preparing db table Preparing host table Preparing user table Preparing func table Preparing tables_priv table Preparing columns_priv table Installing all prepared tables
020929 15:56:33 /usr/sbin/mysqld: Shutdown Complete PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h linuxserver password 'new-password'
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at https://order.mysql.com Starting mysqld daemon with databases from /var/lib/mySQL


So, we should set the MySQL root user password immediately before trying to use MySQL. We'll set the password to "wrox" for our purposes here.

/usr/bin/mysqladmin -u root password 'wrox'


MySQL should now be up and running. Verify this by typing ps aux |grep mysqld or using the MySQL status command mysqladmin -u root -p status. Once the MySQL installation is complete, we can move onto Bugzilla proper.

Bugzilla

Now that we have a Bugzilla-compatible system, its time to install the Perl modules needed for Bugzilla. We can do this automatically using CPAN. CPAN (Comprehensive Perl Archive Network) is a site that Perl will connect to and automatically get all the Perl modules needed for Bugzilla to run. This is the best way to begin configuration. Note: If you are not a Perl expert, you may wish to upgrade to the latest version of the CPAN module first, in order to avoid possible pitfalls later.

perl -MCPAN -e 'install Bundle::CPAN'


Then:

perl -MCPAN -e 'install "Bundle::Bugzilla" '


When CPAN starts, it will ask if you'd like to use manual configuration or autoconfiguration. If you don't want CPAN to use its defaults, enter the manual setup; otherwise type no for autoconfiguration and let CPAN autoconfigure itself. Once CPAN is configured, it will begin downloading and building the Perl modules needed. The output is verbose and may require minimal user interaction. For example, it will ask to delete temporary files used during the install process, etc. Once all of the builds are complete, it's time for the next step. CPAN is usually very good about resolving dependencies and installing the modules you ask for. However, usually does not mean always. The most common error message for a missing dependency reports is "Module Module.pm could not be found in @INC. @INC contains…." In this case, resolve the dependency by going to http://www.cpan.org and finding the module.

Apache

There are some Apache settings needed for Bugzilla to run. Since Bugzilla functions as a series of CGI scripts, Apache must be set up to allow .cgi execution. Using your favorite editor, open /etc/httpd/conf/ httpd.conf. Most Apache distributions will contain the following lines, commented out by default. If your httpd.conf file does not contain them, add the following lines:

 # To use CGI scripts:
 #
 AddHandler cgi-script .cgi


Again, make sure the AddHandler line is not commented out. Now we need to set up the directory to hold the Bugzilla files. Create or alter an Apache Directory tag as shown below:

<Directory "/var/www/html/bugzilla">
 Options ExecCGI
</Directory>


Change the directory path within the opening Directory tag to point to the Bugzilla directory underneath your site root location. In newer distributions this is most likely /var/www/html, but it may be found beneath /home/httpd or some other location for older versions of Apache.

MySQL

First, you will need to create a database that Bugzilla can use for storing defects and a user that Bugzilla can connect as. Connect to the MySQL command-line interface and create the database using the following commands:

mysql -u root -p


Once you have logged in, create the bugs database and the bugzilla user with the following two SQL commands:

mysql>create database bugs;
mysql> insert into user (Host, User, Password) values ('%', 'bugzilla', 'wrox');


Some additional configuration needs to occur on the MySQL side for Bugzilla to be able to use it. We must create a user that Bugzilla will connect as and give that user access to the MySQL bugs database. We'll give the user the name bugzilla and the password wrox. To do this, we need to enter the MySQL command-line tool and issue two SQL statements, as shown below:

[root@linuxserver bin]# mysql -u root -p Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10 to server version: 3.23.52
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,INDEX, ALTER,CREATE,DROP,REFERENCES ON bugs.* TO bugzilla@localhost IDENTIFIED BY 'wrox';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>


Now the database is ready. Note that we gave the database the name "bugs," the user "bugzilla," and the password "wrox." We will need to know these in the final section.

Bugzilla

At last it's time to untar Bugzilla and complete the installation. Copy the bugzilla-2.16.tar.gz file downloaded at the beginning of the chapter into the site root directory. Now issue the command to expand the .tar file:

tar zxvf bugzilla-2.16.tar.gz


This creates a directory called bugzilla-2.16. Rename the directory to "bugzilla" instead. Make sure the user that the Apache Web server runs as on your system has write access to this directory. Determine the location of the Perl executable on your server with the command which perl. The Bugzilla .cgi files contain references to /usr/bonsaitools/bin/perl for the Perl executable. In order to point this to your own Perl executable, create a symbolic link in this directory. Assuming your Perl executable is found in /usr/bin/perl, you can do this by first creating the /usr/bonsaitools/bin directory, changing to it, and issuing the following command to create the symbolic link:

ln –s /usr/bin/perl perl


Bugzilla comes with a Perl file called checksetup.pl to finalize the installation; this file should be in our Bugzilla root directory created earlier. You will need to run this program twice, once as root and once as the user that Apache runs as. After the first time, the file will create a settings file called localconfig. Add the Bugzilla database and user settings defined above into this file. Run the file again, restart Apache, and Bugzilla should be ready to go. By browsing to http://yourServerAndPort/bugzilla, you should be greeted with the following screen.

Java Click To expand

Click the Log In link in the lower right-hand corner of the yellow box at the bottom of the page. Enter the e-mail address and password you created when checksetup.pl prompted you for them. You are now ready to begin setting up Bugzilla for your project!

Configuration

There are a few things you'll want to configure right away. Once you have logged in as the administrator account, the yellow box near the bottom of the screen should contain many more options, as shown here:

Java Click To expand

Click Parameters first. In order for Bugzilla to be useful, you must assign meaningful values to the following options right away:

Submit the form. You are now ready to move on to bug management.


JaVa
   
Comments