How to Install Bugzilla on Debian Latest

Bugzilla is an open-source bug tracking system software. In this tutorial, we will learn how to install Bugzilla on Debian Latest.

Prerequisites

Before starting, make sure your system is up-to-date. You also need to have the following components installed on your system:

Step 1: Install Required Perl modules

Bugzilla needs various Perl modules to perform different operations. We need to install these modules using the following command:

sudo apt-get install libappconfig-perl libdate-calc-perl libtemplate-perl libmime-perl \ 
    build-essential libdatetime-timezone-perl libdatetime-perl libemail-address-perl \
    libemail-mime-perl libemail-send-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-tools libjpeg-dev libpng-dev \
    libpangocairo-1.0-0 libcairo2-dev

Step 2: Download and extract the latest version of Bugzilla

Download the latest stable release of Bugzilla using the following command:

wget https://www.bugzilla.org/download.cgi

Extract the downloaded tarball using the following command:

tar xvfz bugzilla-*.tar.gz

Now, move the extracted contents to the Apache web directory or a directory of your choice using the following command:

sudo mv bugzilla-* /var/www/html/bugzilla

Step 3: Create a database for Bugzilla

Create a MySQL/MariaDB database and user for Bugzilla using the following command:

mysql -u root -p

Enter the MySQL/MariaDB root password when prompted, and then execute the following SQL statements:

CREATE DATABASE bugzilla;
GRANT ALL PRIVILEGES ON bugzilla.* TO 'bugzillauser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

Replace the bugzillauser and password with the relevant username and password.

Step 4: Configure Bugzilla

Now we need to configure Bugzilla to connect to the database. Go to the Bugzilla directory using the following command:

cd /var/www/html/bugzilla

Now, copy the localconfig file using the following command:

sudo cp localconfig localconfig.backup

Then, edit the localconfig file using the following command:

sudo nano localconfig

Find the following lines:

$db_name = 'bugs';
$db_user = 'bugs';
$db_pass = 'bugs';

Replace these lines with the following:

$db_name = 'bugzilla';
$db_user = 'bugzillauser';
$db_pass = 'password';

Replace the bugzillauser and password with the relevant username and password that you created.

Save and close the file.

Step 5: Run the setup script

Now we need to run the Bugzilla setup script to complete the installation. Navigate to the Bugzilla directory and execute the following command:

sudo ./checksetup.pl

This command will check the system for any missing Perl modules or other components, and it will also create the database tables and set up the Bugzilla configuration files.

Step 6: Configure Apache to serve Bugzilla

We need to configure Apache to serve Bugzilla. Create a new virtual host file for Bugzilla using the following command:

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

Add the following lines to the file:

<VirtualHost *:80>

   ServerAdmin admin@example.com
   DocumentRoot /var/www/html/bugzilla/

   <Directory /var/www/html/bugzilla/>
          AddHandler cgi-script .cgi .pl
          Options +Indexes +ExecCGI
          DirectoryIndex index.cgi
          AllowOverride Limit FileInfo Indexes Options AuthConfig
          Require all granted
   </Directory>

   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Replace the admin@example.com with your email address.

Save and close the file.

Now, enable the virtual host and restart Apache using the following commands:

sudo a2ensite bugzilla.conf
sudo systemctl restart apache2

Step 7: Access the Bugzilla Web Interface

Bugzilla is now installed and configured. You can access the Bugzilla web interface by opening a web browser and visiting the following URL:

http://your-server-ip/bugzilla/

You will be prompted to log in using the username and password that you created during the installation process.

Conclusion

In this tutorial, you learned how to install Bugzilla on Debian latest. Bugzilla is a powerful bug tracking system that you can use to track and manage bugs in your projects.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!