Bugzilla on RHEL

July 17, 2013

These are the commands used to install bugzilla from source on a RHEL system. Apache is already installed and working with NameVirtualHost, but not configured for bugzilla.

Database

First, install a database. In my case, I'm using PostgreSQL:

# yum install postgresql
# yum install postgresql-server
# yum install postgresql-devel

The database is initialised and started with the following commands:

# service postgresql initdb
# service postgresql start

Bugzilla

Next, download and unpack bugzilla:

# wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.4.tar.gz
# tar xzvf bugzilla-4.4.tar.gz
# chown -R apache:apache bugzilla-4.4
# chmod -R a+rwx bugzilla-4.4
# cd bugzilla-4.4

Next, use checksetup.pl to identify the perl modules that are required:

# ./checksetup.pl

I'm using bugzilla against PostgreSQL, so I needed to run:

# /usr/bin/perl install-module.pl DBD::Pg
# /usr/bin/perl install-module.pl --all

Keep running checksetup.pl until it comes back with no mandatory modules missing.

You'll then need to modify the local config file to point at your database. I had an existing dump of a bugzilla database as I was migrating to a new server, so I created the database and imported it using the following commands:

# su postgres
$ psql
postgres=# create user bugs with password 'password';
postgres=# create database bugs with owner bugs;
postgres=# \c bugs
bugs=# \i bugs.sql

Finally, run checksetup.pl again, this will upgrade the database shape to match the bugzilla version downloaded.

Apache Integration with mod_perl

We're going to install bugzilla into Apache using mod_perl.

Install mod_perl:

# yum install mod_perl

Edit /etc/httpd/conf/httpd.conf and add the following line before the modules are added:

PerlSwitches -w -T

Create a new bugzilla.conf file in the same directory, with the following contents:

<VirtualHost *:80>
  ServerName dashrepos01
  ErrorLog /var/log/httpd/bugzilla-error_log
  CustomLog /var/log/httpd/bugzilla-access_log common
  DocumentRoot /path/to/bugzilla/
  PerlConfigRequire /path/to/bugzilla/mod_perl.pl
</VirtualHost>

Troubleshooting

I got the following error when restarting Apache:

Starting httpd: Syntax error on line 1 of /etc/httpd/conf.d/bugzilla.conf: 
Can't locate object method "set_max_unshared_size" via package "Apache2::SizeLimit" at 
/home/dashboard/apps/bugzilla/mod_perl.pl line 56.\nCompilation failed in require at (eval 2) line 1.\n

To fix this, make sure that Apache2::SizeLimit is built correctly. I did this using the following commands:

# yum install httpd-devel
# /usr/bin/perl install-module.pl Linux::Pid
# /usr/bin/perl install-module.pl ModPerl::MM
# /usr/bin/perl install-module.pl Apache2::SizeLimit
# service httpd restart

References