Install Bugzilla Bug Tracker on CentOS 8

|
Last Updated:
|
|
Install Bugzilla Bug Tracker on CentOS 8

Welcome to our tutorial on how to install Bugzilla bug tracker on CentOS 8. According to the About Bugzilla page, Bugzilla is a robust, featureful and mature defect-tracking system, or bug-tracking system. Defect-tracking systems allow teams of developers to keep track of outstanding bugs, problems, issues, enhancement and other change requests in their products effectively.

Features of Bugzilla

Bugzilla is featureful. Below are some of the features as outlined on the Bugzilla page;

For Users

For Administrators

Installing Bugzilla Bug Tracker on CentOS 8

Prerequisites

In order to install Bugzilla BT, there are a few system considerations you might want to make. These include the system OS, the hardware and software requirements as outlined on Bugzilla requirements page.

Well, once you setup your server with your desired requirements, you can proceed to install Bugzilla.

Install Perl on CentOS 8

Perl is the core requirement of installing and running Bugzilla. Bugzilla 5.0 and newer require Perl 5.10.1. However, if possible you should install Perl 5.12 or newer, as these newer versions have some useful improvements which will make your life easier.

Run system update;

dnf update

Enable other required repos;

dnf install epel-release
dnf config-manager --set-enabled powertools

Install Perl on CentOS 8, and other required package dependencies.

dnf install perl perl-CPAN perl-DBD-MySQL gcc gd gd-devel graphviz patchutils perl-{CGI,DateTime,DateTime-TimeZone,Template-Toolkit,Email-Sender,Email-MIME,List-MoreUtils,Math-Random-ISAAC,JSON-XS,GD} wget curl

You can then verify the version of installed Perl on CentOS 8 using the command below;

perl -v
This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi
(with 51 registered patches, see perl -V for more detail)

Copyright 1987-2018, Larry Wall

Install Apache Web Server

You can use any other web server of your preference, but this guide used Apache. Hence, you can install Apache on CentOS 8 by running the command below;

dnf install httpd httpd-devel

Start and enable Apache service to run on system boot;

systemctl enable --now httpd

Install and Configure Bugzilla Database on CentOS 8

Install MariaDB database on CentOS 8

Similarly, for the database, you can PostgreSQL instead. But this guide used MariaDB, instead. Check that we installed the MySQL perl module above. Hence, to install MariaDB on CentOS 8, run the command belows;

cat << EOF > /etc/yum.repos.d/mariadb.repo
[mariadb]
name = MariaDB-10.5
baseurl=http://yum.mariadb.org/10.5/centos8-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
dnf install galera-4 -y
dnf --disablerepo=appstream install MariaDB-server MariaDB-client

Start and enable MariaDB to run on system boot;

systemctl enable --now mariadb

Run MariaDB initial security script to disable remote root login, remove anonymous users, test databases.

mysql_secure_installation
Create the Bugzilla Database and Database User

Login to MariaDB and create the database and database user with all privileges granted. Be sure to replace the database name, user and the password accordingly.

mysql
create database bugzilla;
grant all on bugzilla.* to bugadmin@localhost identified by 'changeme';

Reload privileges table and exit the database;

flush privileges;
quit

Next, insert the lines below to /etc/my.cnf.d/server.cnf file.

sed -i.bak '/^[mysqld]/a max_allowed_packet=16M\nft_min_word_len=2' /etc/my.cnf.d/server.cnf

Restart MariaDB;

systemctl restart mariadb

Next, you can install Bugzilla BT by simply downloading the latest stable release version of the Bugzilla source code from the downloads page and placing it under the your web root document folder.

 wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.6.tar.gz
mkdir /var/www/html/bugzilla
tar xf bugzilla-5.0.6.tar.gz -C /var/www/html/bugzilla --strip-components=1

Once you have place the Bugzilla source code under the web root directory, you can now check if any required perl module is missing by executing the command below;

cd /var/www/html/bugzilla/
./checksetup.pl
* This is Bugzilla 5.0.6 on perl 5.26.3
* Running on Linux 4.18.0-193.28.1.el8_2.x86_64 #1 SMP Thu Oct 22 00:20:22 UTC 2020

Checking perl modules...
Checking for               CGI.pm (v3.51)     ok: found v4.38 
Checking for           Digest-SHA (any)       ok: found v6.02 
Checking for             TimeDate (v2.23)     ok: found v2.24 
Checking for             DateTime (v0.75)     ok: found v1.50 
Checking for    DateTime-TimeZone (v1.64)     ok: found v2.19 
Checking for                  DBI (v1.614)    ok: found v1.641 
Checking for     Template-Toolkit (v2.24)     ok: found v2.29 
Checking for         Email-Sender (v1.300011) ok: found v1.300031 
Checking for           Email-MIME (v1.904)    ok: found v1.949 
Checking for                  URI (v1.55)     ok: found v1.73 
Checking for       List-MoreUtils (v0.32)     ok: found v0.428 
Checking for    Math-Random-ISAAC (v1.0.1)    ok: found v1.004 
Checking for              JSON-XS (v2.01)     ok: found v3.04 

Checking available perl DBD modules...
Checking for            DBD-mysql (v4.001)    ok: found v4.046 
Checking for           DBD-Oracle (v1.19)     not found 
Checking for               DBD-Pg (v2.7.0)    not found 
Checking for           DBD-SQLite (v1.29)     not found 

The following Perl modules are optional:
Checking for                   GD (v1.20)     ok: found v2.71
...

To attempt an automatic install of every required and optional module with one command, do:

/usr/bin/perl install-module.pl --all
Configure Bugzilla Database Connection

Once you have created the Bugzilla MySQL/MariaDB database,and installed it to your web root directory, configure the database connection details. open the /var/www/html/bugzilla/localconfig configuration file and update the database connection details as created above.

vim /var/www/html/bugzilla/localconfig
...
# What SQL database to use.
$db_driver = 'mysql';

# The DNS name or IP address of the host that the database server runs on.
$db_host = 'localhost';

# The name of the database.
#$db_name = 'bugs';
$db_name = 'bugzilla';

# Who we connect to the database as.
#$db_user = 'bugs';
$db_user = 'bugadmin';

# Enter your database password here.
$db_pass = 'changeme';
...
# port for my database server."
$db_port = 0;
...

Save and exit the file.

Rerun the checksetup.pl script to verify the database connection and initialize some Bugzilla database schemas and create the required database tables and other configuration settings.

/var/www/html/bugzilla/checksetup.pl
...
Reading ./localconfig...
Checking for            DBD-mysql (v4.001)    ok: found v4.046 
Checking for                MySQL (v5.0.15)   ok: found v10.5.8-MariaDB 

Adding new table bz_schema...
Initializing bz_schema...
Creating tables...
Converting attach_data maximum size to 100G...
Setting up choices for standard drop-down fields:
   priority bug_severity rep_platform op_sys resolution bug_status
Creating ./data directory...
Creating ./data/assets directory...
Creating ./data/attachments directory...
Creating ./data/db directory...
...

Once the Bugzilla is done, you are then asked to set the Bugzilla admin email and name and password.

...
Looks like we don't have an administrator set up yet. Either this is
your first time using Bugzilla, or your administrator's privileges
might have accidentally been deleted.

Enter the e-mail address of the administrator: [email protected]
Enter the real name of the administrator: GenToo
Enter a password for the administrator account: 
Please retype the password to verify: 
[email protected] is now set up as an administrator.
Creating initial dummy product 'TestProduct'...

Now that you have installed Bugzilla, you should visit the 'Parameters'
page (linked in the footer of the Administrator account) to ensure it
is set up as you wish - this includes setting the 'urlbase' option to
the correct URL.
checksetup.pl complete.
Create Bugzilla Apache Site Configuration file

To be able to access Bugzilla web interface, you need to create its Apache site configuration file.

vim /etc/httpd/conf.d/bugzilla.conf
<VirtualHost *:80>
ServerName bugzilla.kifarunix-demo.com
DocumentRoot /var/www/html/bugzilla/

<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.error_log
CustomLog /var/log/httpd/bugzilla.access_log common
</VirtualHost>

Save and exit the configuration file.

Set the ownership of Bugzilla document root directory to Apache user;

chown -R apache: /var/www/html/bugzilla/

Check Apache syntax;

httpd -t

If no errors, restart it.

systemctl restart httpd

Disable SELinux if it is enforcing, or set it to permissive mode;

setenforce 0
sed -i 's/=enforcing/=permissive/' /etc/selinux/config

Testing the Bugzilla Installation

Once you are done with the installation and setup of Bugzilla on CentOS 8, you can run the testserver.pl script to verify the installation and testing.

/var/www/html/bugzilla/testserver.pl <URL to this Bugzilla installation>

For example, to test our setup;

/var/www/html/bugzilla/testserver.pl http://bugzilla.kifarunix-demo.com
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 http://bugzilla.kifarunix-demo.com/localconfig.
...

Accessing Bugzilla Web Interface

Once you have confirmed that all is fine, you can then access Bugzilla web interface via the url, http://bugzilla.kifarunix-demo.com, of course as per this setup.

If firewalld is running, open port 80 or 443 depending on whether you are using HTTP or HTTPS;

firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --reload

You can then navigate to the Bugzilla URL on the browser. Such an interface welcomes you.

install Bugzilla bug tracker on CentOS 8

You can then login using the administrator email and password you created above. You can as well create new accounts.

bugzilla admininterface

Navigate through the Bugzilla and manage your application bugs.

Further Reading

Bugzilla Documentation

Other Tutorials

Install latest Apache Solr on CentOS 8

Install and Setup AWStats Log Analyzer on CentOS 8

Install and Configure Tripwire Security Monitoring tool on CentOS 8

Install and Setup Lynis Security Auditing tool on CentOS 8

Install and Setup Suricata on CentOS 8

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
gen_too
Co-founder of Kifarunix.com, Linux Tips and Tutorials. Linux/Unix admin and author at Kifarunix.com.

Leave a Comment