How to Install Bugzilla 4.0 Step by Step


I was struggling with this install for about a week. I checked many articles all over the internet, but nothing was any help. I finally figured it out after a painful week. My install might not be the most secure, but it works. Put this behind a hardware firewall or Intranet, and you should be golden. My suggestion would be that once installed, one can go ahead and work on security.

Bugzilla
I tried to install Bugzilla on Centos 5, Centos 5.5, Debian 5, Debian 6, and none of those worked. I was finally able to install Bugzilla 4.0 on Ubuntu 10.04 and 10.10. The install process is exactly the same for both operating systems.
The tools you will need to run this install are Putty, WinSCP, and Webmin. This is what I used and it made my life super duper easy.
From a brand new installation of Ubuntu, here are the steps to take:
You will first login as your standard username that is assigned to you if you don’t already have root access. You need to gain root access to make things easier so you don’t have to type in ‘sudo’ before every command. At the command prompt, type:
$sudo passwd
After that you are asked to type in the new root password twice. Finally, your root user has its own password.
Log out of Putty and log back in as root with your new root password.
Proceed to update and upgrade your server, but not necessary.
$ apt-get update
$ apt-get upgrade
$ apt-get update
The second apt-get update is probably not necessary, but do it just to make sure you are 100% up to date.
Install Perl
Check the version of Perl you have installed on your machine.
$ perl -v
Bugzilla runs with Perl 5.8.1 or higher. If you don’t have Perl installed on your machine, install it.
$ apt-get install perl
Install MySQL
Check the version of MySQL you have installed on your machine.
$ mysql –version
Bugzilla runs with MySQL 4.1.2 or higher. If you don’t have MySQL installed on your machine, install it.
$ apt-get install mysql-admin mysql-client mysql-server
Install Apache
Check if Apache web server is already installed.
$ apache2 -v
If you don’t have Apache installed already, install it.
$ apt-get install apache2
Download Bugzilla Tarball
$ wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.0.tar.gz
Once downloaded, move this file into the /var/www directory on your server. I did this via WinSCP.
$ tar -xvf bugzilla-4.0.tar.gz
Then rename the bugzilla-4.0 directory to bugzilla. This is very important because if you don’t do this, Apache will not be able to find your installation.
$ cd /var/www/bugzilla
Install Perl modules needed for Bugzilla
Check if you have all the Perl modules required for Bugzilla. It is a good idea to install all the required as well as the optional modules.
$ cd /var/www/bugzilla/
$ ./checksetup.pl –check-modules
A lot of the Perl modules might be missing, first try to install all of them in one command
$ /usr/bin/perl install-module.pl –all
Run the check setup script again to see which modules still need to be installed.
$ ./checksetup.pl –check-modules
Install mod_perl & Apache2::SizeLimit modules if they did not get installed.
$ apt-get install libapache2-mod-perl2 libapache2-mod-perl2-dev libapache2-mod-perl2-doc
$ /usr/bin/perl install-module.pl Apache2::SizeLimit
Once all the Perl modules have been installed, run checksetup.pl again, this time without the –check-modules switch, this will create a file called “localconfig”.
$ ./checksetup.pl
Once you reach here, you frustration level will increase because not all pearl modules are installed. I have a solution.
$ apt-get install gcc
$ apt-get install bugzilla3
Proceed with all the options for bugzilla3. When this install completes, you can visit http://yourserverip/bugzilla3 and you will have a working bugzilla3 install. We install this because it will take care of all the dependencies to install bugzilla 4.0. This will not conflict with your bugzilla 4 installation. Follow all the prompts to install bugzilla3.
Once all the Perl modules have been installed by Bugzilla3, run checksetup.pl again, this time without the –check-modules switch, this will create a file called “localconfig”.
$ ./checksetup.pl
Edit the localconfig file and change the following properties to
$webservergroup = ‘www-data’;
$db_pass = ‘your password for bugs@localhost’;
Create the bugs database
The bugs database will be used by the 4.0 installation of Bugzilla.
$ sudo mysql -u root -p
mysql> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| bugzilla3 |
| mysql |
+——————–+
3 rows in set (0.02 sec)
mysql> create database bugs;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| bugs |
| bugzilla3 |
| mysql |
+——————–+
4 rows in set (0.00 sec)
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY ‘your password for bugs@localhost’;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
Setup the Administrative User for Bugzilla
Rerun checksetup.pl. It 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.
If all goes well, it will ask you for an email for the Bugzilla Administrator account and the password for that account.
$ ./checksetup.pl
When I ran this, I got an error. Proceed to your webmin tool, and expand the MYSQL Server. Set the password for the bugs user here to the exact same password used in local config and assign it all privileges. You can assign it less for security reasons, but if you want it to work quickly, this is optimum.
Run checksetup.pl again.
$ ./checksetup.pl
If all goes well, it will ask you for an email for the Bugzilla Administrator account and the password for that account. This time it will go perfect.
Add the following to the httpd.conf as mine was empty. This assumes you installed Bugzilla in the default path.
<Directory “/var/www/bugzilla”>
AddHandler cgi-script cgi
DirectoryIndex index.cgi
Options +Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Restart Apache web server.
$ /etc/init.d/apache2 stop
$ /etc/init.d/apache2 start
This command is optional but I like to clean up my mess even though this is not required.
$ shutdown now -r
Browse to http://youripaddress/bugzilla Your Bugzilla instance should be running now.
Login with the Bugzilla Administrator credentials that you setup earlier and configure your Bugzilla instance.
Enjoy.