How to Install Bugzilla 5.0.4 on CentOS 7
Bugzilla is a widely adopted, free, and open source bug tracking tool. Many developers and vendors rely on it to systematically refine their software products.
This guide walks you through the installation process of Bugzilla version 5.0.4 on a CentOS 7 server instance.
Prerequisites
- A clean CentOS 7 x64 instance (e.g., IP: 203.0.113.1).
- Access to a user account with sudo privileges.
- The system must be up-to-date using the EPEL YUM repository.
Bugzilla 5.0.4 needs Perl 5.14 or higher, alongside a functioning web server and a database server. In this tutorial, we will set up Perl 5.16.x, Apache 2.4.x, and MariaDB 10.2.x as part of the installation.
Step 1: Installing Perl 5.16.x and Dependencies
After logging in with sudo rights, install Perl and necessary Perl components via YUM:
sudo yum install perl perl-CPAN perl-DBD-MySQL -y
Verify the installed Perl version meets the requirement (should be 5.14 or newer):
perl -v
Version 5.16.3 should be displayed, which is compatible with Bugzilla 5.0.4.
Next, install additional necessary packages:
sudo yum install gcc gd gd-devel rst2pdf graphviz patchutils -y
Step 2: Setting Up Apache 2.4.x
Use the following commands to install and configure Apache version 2.4.6:
sudo yum install httpd httpd-devel -y
sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf
sudo systemctl start httpd.service
sudo systemctl enable httpd.service
Step 3: Setting Up MariaDB 10.2.x
Start by installing the latest stable MariaDB release:
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
sudo yum install MariaDB-server MariaDB-devel -y
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
Secure the MariaDB setup by executing the following:
sudo /usr/bin/mysql_secure_installation
Follow the prompts:
- Enter current password for root (enter for none): Press Enter
- Set root password? [Y/n]: Y
- New password: your-MariaDB-root-password
- Re-enter new password: your-MariaDB-root-password
- Remove anonymous users? [Y/n]: Y
- Disallow root login remotely? [Y/n]: Y
- Remove test database and access to it? [Y/n]: Y
- Reload privilege tables now? [Y/n]: Y
Log into MySQL using root credentials:
mysql -u root -p
Create a database and user for Bugzilla. Be sure to personalize the credentials:
CREATE DATABASE bugzilla;
CREATE USER 'bugzillauser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON bugzilla.* TO 'bugzillauser'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
Adjust MariaDB’s server configuration to accommodate Bugzilla:
sudo vi /etc/my.cnf.d/server.cnf
Add these entries beneath the [mysqld]
section:
# Bugzilla
# Allow packets up to 16M
max_allowed_packet=16M
# Allow small words in full-text indexes
ft_min_word_len=2
Exit and save:
:wq!
Restart MariaDB to apply changes:
sudo systemctl restart mariadb.service
Step 4: Download and Set Up Bugzilla 5.0.4
First, grab the Bugzilla 5.0.4 archive from the official Mozilla servers:
cd
wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.4.tar.gz
Extract the contents to your preferred directory:
sudo tar -C /opt -zxvf bugzilla-5.0.4.tar.gz
Create a symbolic link to the Bugzilla folder to make future upgrades easier:
sudo ln -s /opt/bugzilla-5.0.4 /var/www/html/bugzilla
Run the setup script to identify missing Perl modules:
sudo /var/www/html/bugzilla/checksetup.pl
You can either install modules individually:
sudo /usr/bin/perl /var/www/html/bugzilla/install-module.pl CGI
Or install all required and optional modules at once:
sudo /usr/bin/perl /var/www/html/bugzilla/install-module.pl --all
Once the installation completes, rerun the setup script to ensure all necessary modules, including DBD::mysql
, are in place:
sudo /var/www/html/bugzilla/checksetup.pl
Edit the localconfig
file to configure the database settings:
sudo vi /var/www/html/bugzilla/localconfig
Update the values to match your setup:
$webservergroup = 'apache';
$db_driver = 'mysql';
$db_host = 'localhost';
$db_name = 'bugzilla';
$db_user = 'bugzillauser';
$db_pass = 'yourpassword';
Save the file and rerun the setup script to complete the installation:
sudo /var/www/html/bugzilla/checksetup.pl
You’ll be prompted to enter admin details such as:
- Email address: admin@example.com
- Name: John Doe
- Password: your-admin-password
Make sure Apache has ownership of Bugzilla files:
sudo chown -R apache:apache /opt/bugzilla-5.0.4
Create an Apache virtual host file for Bugzilla:
sudo vi /etc/httpd/conf.d/bugzilla.conf
Add the following configuration:
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/bugzilla/
ServerName bugzilla.example.com
ServerAlias www.bugzilla.example.com
<Directory /var/www/html/bugzilla/>
AddHandler cgi-script .cgi
Options +Indexes +ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit FileInfo Indexes Options AuthConfig
</Directory>
ErrorLog /var/log/httpd/bugzilla.example.com-error_log
CustomLog /var/log/httpd/bugzilla.example.com-access_log common
</VirtualHost>
Save the file and restart Apache:
sudo systemctl restart httpd.service
Step 5: Configure the Firewall
Update your firewall to permit HTTP traffic:
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --reload
Step 6: Verify and Access Bugzilla
Use the test script to validate the Bugzilla installation:
sudo /var/www/html/bugzilla/testserver.pl http://203.0.113.1
Expected output includes:
- TEST-OK Webserver is running under group id in $webservergroup.
- TEST-OK Got padlock picture.
- TEST-OK Webserver is executing CGIs via mod_cgi.
- TEST-OK Webserver is preventing fetch of /localconfig.
- TEST-OK GD version and libgd version match.
- TEST-OK GD library generated a good PNG image.
- TEST-OK Chart library generated a good PNG image.
- TEST-OK Template::Plugin::GD is installed.
Now visit http://203.0.113.1/
in your browser. Click “Log In” and enter the admin credentials to access and manage Bugzilla.
Step 7: (Optional) Enable Apache mod_perl for Performance
Install mod_perl and its development package to enhance Apache’s handling of Perl:
sudo yum install mod_perl mod_perl-devel -y
Check if it’s loaded:
apachectl -M | grep perl
The output should include:
- perl_module (shared)
Edit the mod_perl configuration file:
sudo vi /etc/httpd/conf.d/perl.conf
Display line numbers and uncomment these:
:set nu
Uncomment lines 15 and 24, and add the following at the end:
PerlSwitches -w
PerlSwitches -T
PerlConfigRequire /var/www/html/bugzilla/mod_perl.pl
Restart Apache to apply the configuration:
sudo systemctl restart httpd.service
Conclusion
By following these detailed steps, you’ve successfully set up Bugzilla 5.0.4 on a CentOS 7 instance. From installing the necessary software stack (Perl, Apache, MariaDB) to configuring the web interface and database, your system is now ready to manage bug tracking effectively. You can further enhance performance using Apache’s mod_perl module. Access the Bugzilla dashboard via your server IP and start organizing your software development process with this powerful tool.