Skip to content

Install Bugzilla on Centos 7

In this guide, we will show you how to install Bugzilla bug tracking system on CentOS 7 hosted on DigitalOcean or Alibaba Cloud or any other cloud engine.

Upgrade your yum packages

sudo yum -y update

If this is successful, the last few lines of the output would look like below.

  Cleanup    : bash-4.2.46-31.el7.x86_64                                                                                                                                                             435/441 
  Cleanup    : nspr-4.19.0-1.el7_5.x86_64                                                                                                                                                            436/441 
  Cleanup    : nss-util-3.36.0-1.el7_5.x86_64                                                                                                                                                        437/441 
  Cleanup    : nss-softokn-freebl-3.36.0-5.el7_5.x86_64                                                                                                                                              438/441 
  Cleanup    : glibc-2.17-260.el7_6.6.x86_64                                                                                                                                                         439/441 
  Cleanup    : tzdata-2018i-1.el7.noarch                                                                                                                                                             440/441 
  Cleanup    : libgcc-4.8.5-36.el7_6.2.x86_64                                                                                                                                                        441/441

Install EPEL repository

sudo yum -y install epel-release

In my case EPEL was already installed.

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.trouble-free.net
 * epel: fedora-epel.mirrors.tds.net
 * extras: mirror.trouble-free.net
 * updates: mirror.trouble-free.net
Package epel-release-7-12.noarch already installed and latest version
Nothing to do

Install Perl and its modules

Bugzilla needs Perl 5.x and Perl modules like CPAN and MySQL.

sudo yum -y install perl perl-CPAN perl-DBD-MySQL

It worked.

Installed:
  perl-CPAN.noarch 0:1.9800-294.el7_6                                                                   perl-DBD-MySQL.x86_64 0:4.023-6.el7                                                                  

Dependency Installed:
  gdbm-devel.x86_64 0:1.10-8.el7                     libdb-devel.x86_64 0:5.3.21-25.el7              perl-ExtUtils-Install.noarch 0:1.58-294.el7_6       perl-ExtUtils-MakeMaker.noarch 0:6.68-3.el7      
  perl-ExtUtils-Manifest.noarch 0:1.61-244.el7       perl-ExtUtils-ParseXS.noarch 1:3.18-3.el7       perl-Test-Harness.noarch 0:3.28-3.el7               perl-devel.x86_64 4:5.16.3-294.el7_6             
  perl-local-lib.noarch 0:1.008010-4.el7             pyparsing.noarch 0:1.5.6-9.el7                  systemtap-sdt-devel.x86_64 0:4.0-10.el7_7          

Complete!

Verify Perl installation

perl -v

It would display the Perl version and the license information.

This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 39 registered patches, see perl -V for more detail)

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Install Perl dependencies

We need a few dependencies for Bugzilla to work with Perl.They are gcc, gd, gd-devel, graphviz, patchutils, rst2pdf.

sudo yum -y install gcc gd gd-devel rst2pdf graphviz patchutils

You will see a message like the one below when the dependencies are installed.

Installed:
  gd-devel.x86_64 0:2.0.35-26.el7                     graphviz.x86_64 0:2.30.1-21.el7                     patchutils.x86_64 0:0.3.3-4.el7                     rst2pdf.noarch 0:0.93-8.el7                    

Dependency Installed:
  adobe-mappings-cmap.noarch 0:20171205-3.el7                             adobe-mappings-cmap-deprecated.noarch 0:20171205-3.el7           adobe-mappings-pdf.noarch 0:20180407-1.el7                        
  expat-devel.x86_64 0:2.1.0-10.el7_3                                     fontconfig-devel.x86_64 0:2.13.0-4.3.el7                         freetype-devel.x86_64 0:2.8-14.el7                                
  libX11-devel.x86_64 0:1.6.7-2.el7                                       libXau-devel.x86_64 0:1.0.8-2.1.el7                              libXaw.x86_64 0:1.0.13-4.el7                                      
  libXpm-devel.x86_64 0:3.5.12-1.el7                                      libgs.x86_64 0:9.25-2.el7_7.3                                    libjpeg-turbo-devel.x86_64 0:1.2.90-8.el7                         
  libpaper.x86_64 0:1.1.24-8.el7                                          libpng-devel.x86_64 2:1.5.13-7.el7_2                             librsvg2.x86_64 0:2.40.20-1.el7                                   
  libtool-ltdl.x86_64 0:2.4.2-22.el7_3                                    libuuid-devel.x86_64 0:2.23.2-61.el7_7.1                         libwebp.x86_64 0:0.3.0-7.el7                                      
  libxcb-devel.x86_64 0:1.13-1.el7                                        openjpeg2.x86_64 0:2.3.1-1.el7                                   python-docutils.noarch 0:0.11-0.3.20130715svn7687.el7             
  python-pdfrw.noarch 0:0.2-5.el7                                         python-pillow.x86_64 0:2.0.0-19.gitd1c6db8.el7                   python-pygments.noarch 0:1.4-10.el7                               
  python-reportlab.x86_64 0:2.5-9.el7                                     python2-simplejson.x86_64 0:3.10.0-2.el7                         urw-base35-bookman-fonts.noarch 0:20170801-10.el7                 
  urw-base35-c059-fonts.noarch 0:20170801-10.el7                          urw-base35-d050000l-fonts.noarch 0:20170801-10.el7               urw-base35-fonts.noarch 0:20170801-10.el7                         
  urw-base35-fonts-common.noarch 0:20170801-10.el7                        urw-base35-gothic-fonts.noarch 0:20170801-10.el7                 urw-base35-nimbus-mono-ps-fonts.noarch 0:20170801-10.el7          
  urw-base35-nimbus-roman-fonts.noarch 0:20170801-10.el7                  urw-base35-nimbus-sans-fonts.noarch 0:20170801-10.el7            urw-base35-p052-fonts.noarch 0:20170801-10.el7                    
  urw-base35-standard-symbols-ps-fonts.noarch 0:20170801-10.el7           urw-base35-z003-fonts.noarch 0:20170801-10.el7                   xorg-x11-font-utils.x86_64 1:7.5-21.el7                           
  xorg-x11-proto-devel.noarch 0:2018.4-1.el7                              zlib-devel.x86_64 0:1.2.7-18.el7                                

Complete!

Install Apache Server

Please follow this post to install Apache Server on Centos 7.

See also  How to Install Kubectl in Ubuntu?

Install MariaDB

Please follow this post to install MariaDB on Centos 7.

Download Bugzilla package

wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-5.0.4.tar.gz
wget https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-STABLE.tar.gz


--2019-12-25 01:59:21--  https://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-STABLE.tar.gz
Resolving ftp.mozilla.org (ftp.mozilla.org)... 99.84.181.113, 99.84.181.108, 99.84.181.126, ...
Connecting to ftp.mozilla.org (ftp.mozilla.org)|99.84.181.113|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5736607 (5.5M) [application/x-tar]
Saving to: ‘bugzilla-STABLE.tar.gz’

100%[===================================================================================================================================================================>] 57,36,607   7.58MB/s   in 0.7s   

2019-12-25 01:59:22 (7.58 MB/s) - ‘bugzilla-STABLE.tar.gz’ saved [5736607/5736607]

Unarchive bugzilla package

sudo tar -C /opt -zxvf bugzilla-STABLE.tar.gz

Create a soft link to ensure future updates

sudo ln -s /opt/bugzilla-5.0.6 /var/www/html/bugzilla

Check for missing Perl modules

sudo /var/www/html/bugzilla/checksetup.pl

You will see a list of all missing modules and the command to install them all.

COMMANDS TO INSTALL REQUIRED MODULES (You *must* run all these commands
and then re-run checksetup.pl):

    /usr/bin/perl install-module.pl CGI
    /usr/bin/perl install-module.pl Date::Format
    /usr/bin/perl install-module.pl DateTime
    /usr/bin/perl install-module.pl DateTime::TimeZone
    /usr/bin/perl install-module.pl Template
    /usr/bin/perl install-module.pl Email::Sender
    /usr/bin/perl install-module.pl Email::MIME
    /usr/bin/perl install-module.pl URI
    /usr/bin/perl install-module.pl List::MoreUtils
    /usr/bin/perl install-module.pl Math::Random::ISAAC
    /usr/bin/perl install-module.pl JSON::XS

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

  /usr/bin/perl install-module.pl --all

Running the install-module.pl –all didnt work for me. So I had to install the modules one by one. After running all the commands, I ran the checksetup.pl command.

I got this error.

Can't locate autodie.pm in @INC (@INC contains: . lib/x86_64-linux-thread-multi lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at Bugzilla/Config.pm line 1

I opened Config.pm and commented the line that had autodie import.

After running ./checksetup.pl I got this message..

Reading ./localconfig...

This version of Bugzilla contains some variables that you may want to
change and adapt to your local settings. The following variables are
new to ./localconfig since you last ran checksetup.pl:

create_htaccess, webservergroup, use_suexec, db_driver, db_host,
db_name, db_user, db_pass, db_port, db_sock, db_check,
db_mysql_ssl_ca_file, db_mysql_ssl_ca_path, db_mysql_ssl_client_cert,
db_mysql_ssl_client_key, index_html, interdiffbin, diffpath,
site_wide_secret

Please edit the file ./localconfig and then re-run checksetup.pl
to complete your installation.

We need to edit localconfig file and update our database details.

Edit localconfig file

Open the file.

sudo vi /var/www/html/bugzilla/localconfig

Update your MariaDB bugzilla database details.

$webservergroup = 'apache';
$db_driver = 'mysql';
$db_host = 'localhost';
$db_name = 'bugzilla'; // Make sure you enter the correct name
$db_user = 'ubugzilla';
$db_pass = 'your_password';

Rerun checksetup

sudo /var/www/html/bugzilla/checksetup.pl

Now you need to setup administrator for Bugzilla. Enter those details and you setup is done.

Reading ./localconfig...
Checking for            DBD-mysql (v4.001)    ok: found v4.023 
Checking for                MySQL (v5.0.15)   ok: found v5.5.5-10.4.11-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_status rep_platform resolution bug_severity op_sys
Creating ./data directory...
Creating ./data/assets directory...
Creating ./data/attachments directory...
Creating ./data/db directory...
Creating ./data/extensions directory...
Creating ./data/mining directory...
Creating ./data/webdot directory...
Creating ./graphs directory...
Creating ./skins/custom directory...
Creating ./data/extensions/additional...
Creating ./data/mailer.testfile...
Creating ./Bugzilla/.htaccess...
Creating ./data/.htaccess...
Creating ./data/assets/.htaccess...
Creating ./data/attachments/.htaccess...
Creating ./data/webdot/.htaccess...
Creating ./graphs/.htaccess...
Creating ./lib/.htaccess...
Creating ./template/.htaccess...
Creating contrib/.htaccess...
Creating t/.htaccess...
Creating xt/.htaccess...
Precompiling templates...done.
Fixing file permissions...
Initializing "Dependency Tree Changes" email_setting ...
Initializing "Product/Component Changes" email_setting ...
Marking closed bug statuses as such...
Creating default classification 'Unclassified'...
Setting up foreign keys...
Setting up the default status workflow...
Creating default groups...
Setting up user preferences...

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: anand@poopcode.com
Enter the real name of the administrator: Anand Chandran
Enter a password for the administrator account: 
Please retype the password to verify: 
anand@poopcode.com 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.

Give access for Apache server to Bugzilla

sudo chown -R apache:apache /opt/bugzilla-5.0.6

Create a virtual host

Open Bugzilla configuration.

sudo vi /etc/httpd/conf.d/bugzilla.conf

Add these lines.

<VirtualHost *:80>
ServerAdmin anand@poopcode.com
DocumentRoot /var/www/html/bugzilla/
ServerName bugzilla.poopcode.com
ServerAlias www.bugzilla.poopcode.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.poopcode.com-error_log
CustomLog /var/log/httpd/bugzilla.poopcode.com-access_log common
</VirtualHost>

By default, Apache Server redirects to the default :80 port when you access Bugzilla. When you want to assign a different port for bugzilla, you need to change Apache Server configuration and provide the port number in Bugzilla configuration.

See also  How to change Apache Httpd default port in Linux?

Restart Apache server

sudo systemctl restart httpd.service

Test Bugzilla

You should see Bugzilla screen when you visit root URL (IP Address of the server, 127.0.01 if local system) of your server.

Bugzilla installed.

By default, apache httpd runs at the port 80. If you want to change it, you can check this post. Please change the port in the Bugzilla configuration too.

Leave a Reply

Your email address will not be published. Required fields are marked *

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