Bugzilla is a free and open-source bug tracking system that allows us to track the bugs and collaborate with developers and other teams in our organization. It helps us to keep track of bugs, issues, and other change requests in their products effectively. It was adopted by thousands of organizations across the globe due to its robust features. It is written in Perl and uses MySQL/MariaDB as a database backend.

In this article, I will explain how to install Bugzilla on Debian 11.

Prerequisites

  • A server running Debian 11.
  • A valid domain name pointed with your server IP.
  • A root password is configured on your server.

Install Required Dependencies

First, update all the system packages to the updated version using the following command:

apt-get update -y

Next, install all the required Perl modules using the following command:

apt-get install build-essential libdatetime-timezone-perl libappconfig-perl libdate-calc-perl libtemplate-perl libmime-tools-perl libdatetime-perl libemail-sender-perl libemail-mime-perl libemail-mime-perl libdbi-perl libdbd-mysql-perl libcgi-pm-perl libmath-random-isaac-perl libmath-random-isaac-xs-perl libapache2-mod-perl2 libapache2-mod-perl2-dev libchart-perl libxml-perl libxml-twig-perl perlmagick libgd-graph-perl libtemplate-plugin-gd-perl libsoap-lite-perl libhtml-scrubber-perl libjson-rpc-perl libdaemon-generic-perl libtheschwartz-perl libtest-taint-perl libauthen-radius-perl libhtml-formattext-withlinks-perl libgd-dev graphviz sphinx-common rst2pdf libemail-address-perl libemail-reply-perl libfile-slurp-perl libencode-detect-perl libmodule-build-perl libnet-ldap-perl libfile-which-perl libauthen-sasl-perl libfile-mimeinfo-perl -y

Once you are done, you can proceed to the next step.

Install Apache and MariaDB

Next, install the Apache and MariaDB database server by running the following command:

apt-get install apache2 mariadb-server mariadb-client -y

Once both packages are installed, start the Apache and MariaDB service using the following command:

systemctl start apache2

systemctl start mariadb

Once you are finished, you can proceed to the next step.

Configure MariaDB Database

Next, you will need to create a database and user for Bugzilla.

First, log in to the MariaDB shell using the command given below:

mysql

Once you are log in, create a database and user with the following command:

MariaDB [(none)]> CREATE DATABASE bugzilla;

MariaDB [(none)]> CREATE USER 'buguser'@'localhost' IDENTIFIED BY 'password';

Next, grant all the privileges to the Bugzilla database with the following command:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON bugzilla.* TO 'buguser'@'localhost';

Next, flush the privileges and exit from the MariaDB shell using the following command:

MariaDB [(none)]> FLUSH PRIVILEGES;

MariaDB [(none)]> EXIT;

Next, edit the MariaDB default configuration file and tweak some configuration:

nano /etc/mysql/mariadb.conf.d/50-server.cnf

Add the following lines inside [mysqld]:

max_allowed_packet=16M
ft_min_word_len=2

Save and close the fiel the restart the MariaDB service to apply the changes:

systemctl restart mariadb

Install and Configure Bugzilla

First, download the latest version of Bugzilla using the following command:

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

Once the download is completed, create a directory for Bugzilla and extract the downloaded file to the Bugzilla directory:

mkdir /var/www/html/bugzilla

tar xf bugzilla-5.0.6.tar.gz -C /var/www/html/bugzilla --strip-components=1

Next, edit the localconfig file inside the Bugzilla directory:

cd /var/www/html/bugzilla

nano localconfig

Make the following changes:

$create_htaccess = 1;
$webservergroup = 'www-data';
$use_suexec = 1;
$db_driver = 'mysql';
$db_host = 'localhost';
$db_name = 'bugzilla';
$db_user = 'buguser';
$db_pass = 'password';

Save and close the file then run the following command to set up Bugzilla:

./checksetup.pl

Enter the e-mail address of the administrator: [email protected]
Enter the real name of the administrator: Hitesh Jethva
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.

Next, run the following command to install all required Perl modules:

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

Next, change the ownership of the Bugzilla directory to www-data:

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

Next, verify the Bugzilla setup using the following command:Advertisement

./checksetup.pl

If everything is fine, you will get the following output:

* APACHE MODULES                                                      *
***********************************************************************
* Some Apache modules allow to extend Bugzilla functionalities.       *
* These modules can be enabled in the Apache configuration file       *
* (usually called httpd.conf or apache2.conf).                        *
* - mod_headers, mod_env and mod_expires permit to automatically      *
*   refresh the browser cache of your users when upgrading Bugzilla.  *
* - mod_rewrite permits to write shorter URLs used by the REST API.   *
* - mod_version permits to write rules in .htaccess specific to       *
*   Apache 2.2 or 2.4.                                                *
* The modules you need to enable are:                                 *
*                                                                     *
*    mod_expires, mod_headers, mod_rewrite                            *
*                                                                     *
***********************************************************************
Reading ./localconfig...

OPTIONAL NOTE: If you want to be able to use the 'difference between two
patches' feature of Bugzilla (which requires the PatchReader Perl module
as well), you should install patchutils from:

    
patchutils
Checking for DBD-mysql (v4.001) ok: found v4.050 Checking for MySQL (v5.0.15) ok: found v10.5.12-MariaDB-0 deb11u1 Removing existing compiled templates... Precompiling templates...done. Fixing file permissions... 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.

Once you are finished, you can proceed to the next step.

Configure Apache for Bugzilla

Next, you will need to create an Apache virtual host configuration file for Bugzilla.

nano /etc/apache2/sites-available/bugzilla.conf

Add the following lines:

ServerName bugzilla.example.com
DocumentRoot /var/www/html/bugzilla/


AddHandler cgi-script .cgi
Options  Indexes  ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit FileInfo Indexes Options AuthConfig


ErrorLog /var/log/apache2/bugzilla.error_log
CustomLog /var/log/apache2/bugzilla.access_log common

Save and close the file then activate the Bugzilla virtual host and enable other required modules using the following command:

a2ensite bugzilla.conf

a2enmod headers env rewrite expires cgi

Next, restart the Apache service to apply the configuration changes:

systemctl restart apache2

You can check the status of the Apache using the following command:

systemctl status apache2

You will get the following output:

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2021-12-19 08:57:08 UTC; 7s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 43005 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 43011 (apache2)
      Tasks: 56 (limit: 4679)
     Memory: 13.5M
        CPU: 46ms
     CGroup: /system.slice/apache2.service
             ??43011 /usr/sbin/apache2 -k start
             ??43012 /usr/sbin/apache2 -k start
             ??43013 /usr/sbin/apache2 -k start
             ??43014 /usr/sbin/apache2 -k start

Dec 19 08:57:08 taiga systemd[1]: Starting The Apache HTTP Server...

Once you are finished, you can proceed to the next step.

Access Bugzilla Web Interface

Now, open your web browser and access the Bugzilla web interface using the URL http://bugzilla.example.com. You should see the following screen:

<img alt="BugZilla" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/01/echo/p1.png61d2ff6f6e1e3.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="340" loading="lazy" src="data:image/svg xml,” width=”750″>

Click on the Login button. You should see the following screen:

<img alt="BugZilla Login" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/01/echo/p2.png61d2ff6f8c5ff.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="205" loading="lazy" src="data:image/svg xml,” width=”750″>

Provide your admin email, password and click on the Login button. You should see the Bugzilla dashboard on the following screen:

<img alt="BugZilla dashboard" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/01/echo/p3.png61d2ff6fddcaf.jpg" ezimgfmt="rs rscb5 src ng ngcb5" height="340" loading="lazy" src="data:image/svg xml,” width=”750″>

Conclusion

Congratulations! you have successfully installed Bugzilla with Apache on Debian 11. You can now implement Bugzilla in your development environment to manage and track your project. Feel free to ask me if you have any questions.