How to install Bugzilla on Centos7

Bugzilla is a free open source bug-tracking system from Mozilla. It can be integrated into the source code management environments. After migrating from it into the Jira software few years ago, I wanted to install and give it another go.

All the details and screenshots are correct for below:

OS: Centos 7.5
Bugzille 5.0.4 latest stable release
Webserver: Apache 2.4
Database: PostgreSQL-9.2

Preparation

Before start, you need to decide where to download your resources. I usually have my resources in one place. Create a folder for it if you haven’t got one.

sudo yum update
sudo yum install wget perl git cpan gcc

sudo selinux

Web server

sudo yum install httpd

Database server

Atlassian’s recommended database engine for Jira is PostgreSQL. It is also easiest option to install because it doesn’t need extra steps to download Java connector separately.

The version  that Centos7 repository includes at the moment is v9.2. It not supported by Atlassian products any more. So will need to use community repository the get the latest version of v9.6.

Install

sudo yum install postgresql-server postgresql-devel

After installing the packages, you need to initialise and configure it.

Initialise

sudo postgresql-setup initdb

Initializing database ... OK

Control service

sudo systemctl enable postgresql
sudo systemctl start postgresql

create and set-up database

sudo -u postgres -i
-bash-4.2$ psql
psql (9.6.9)
Type "help" for help.

postgres=# CREATE USER bugzilladbuser PASSWORD 'bugzilladbpassword';
postgres=# CREATE DATABASE bugzilladb WITH ENCODING 'UNICODE' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0;
postgres=# GRANT ALL PRIVILEGES ON DATABASE bugzilladb to bugzilladbuser;
\q

configure authentication methods

default authentication method for local connections in PostgreSQL is set to ‘ident’ that means it will get the operating system user name of the client by contacting the ident server on the client and check if it matches the requested database user name. You can read more on this on official PostgreSQL site.

As we are not planing to have a ident server this needs to be updated. I use md5 method. You can consider other methods too depending on the situation. All these settings resting in pg_hba.conf file in data folder of the postgresql installation.

so need to do below:

sudo -u postgres -i 
-bash-4.2$ vim /var/lib/pgsql/data/pg_hba.conf

Update the line beginning with host. It is towards the end of the file (line 82 in my case) the one starts with host.

this line:

host    all             all             127.0.0.1/32            ident

change it to:

host    all             all             127.0.0.1/32            md5

then restart the service.

Open firewall ports

Centos 7 now comes with firewalld pre-installed and activated in some templates by default. You need to open the needed ports to get access to the server through web browser.

First check the active zones:

firewall-cmd --get-active-zones
public
  interfaces: eth0

then you can add the ports needed to the zones you want (public here)

sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent

reboot the system

Download and Install Bugzilla

cd /opt
sudo wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.4.tar.gz
sudo tar -xvf bugzilla-5.0.4.tar.gz

To check whether you have all the required modules, run:
./checksetup.pl --check-modules

If you have not already installed the necessary modules you can install all of them by this command:
sudo ./install-module.pl --all
sudo ./install-module.pl DBD::Pg
Allow few minutes for all modules to be installed. It is unattended so you can grab your coffee while it is doing its job 🙂
After installation complete, check the modules again:
./checksetup.pl last lines of the check should look like this


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.

And that’s it!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.