1080*80 ad

Installing Bugzilla on Ubuntu 20.04

A Step-by-Step Guide to Installing Bugzilla on Ubuntu 20.04

In the world of software development and project management, effective bug tracking is not just a feature—it’s a necessity. Bugzilla stands out as a powerful, open-source, and server-based tool designed to help teams track bugs and manage complex workflows efficiently. Its web-based interface makes it accessible, while its robust feature set makes it a favorite for countless organizations.

This comprehensive guide will walk you through the entire process of installing and configuring Bugzilla on an Ubuntu 20.04 server. We will cover everything from setting up the necessary web server and database to configuring Bugzilla for its first use.

Prerequisites

Before we begin, it’s crucial to ensure your system is up-to-date. Open a terminal and run the following commands to update your package lists and upgrade existing packages:

sudo apt update
sudo apt upgrade

With your system prepared, you’re ready to start the installation process.

Step 1: Install Apache, MariaDB, and Required Tools

Bugzilla is built on Perl and requires a web server and a database to function. We will use the popular Apache web server and MariaDB, a highly compatible fork of MySQL.

Install all the necessary components with a single command:

sudo apt install apache2 mariadb-server git build-essential

Once the installation is complete, start and enable the Apache and MariaDB services to ensure they launch automatically on boot:

sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mariadb
sudo systemctl enable mariadb

Step 2: Create and Secure the Bugzilla Database

A secure database is the foundation of a stable Bugzilla installation. First, run the MariaDB security script to set a root password and remove insecure default settings.

sudo mysql_secure_installation

Follow the on-screen prompts to set a strong root password and answer “Y” (yes) to all subsequent questions.

Next, log in to the MariaDB shell to create a dedicated database and user for Bugzilla.

sudo mysql -u root -p

Enter the root password you just set. Now, execute the following SQL commands. Remember to replace 'your-strong-password' with a secure password of your own.

CREATE DATABASE bugs;
CREATE USER 'bugzilla'@'localhost' IDENTIFIED BY 'your-strong-password';
GRANT ALL PRIVILEGES ON bugs.* TO 'bugzilla'@'localhost';
FLUSH PRIVILEGES;
EXIT;

This creates a database named bugs, a user named bugzilla, and grants that user full control over the database.

Step 3: Download and Configure Bugzilla

It’s best practice to install Bugzilla directly from its official Git repository to ensure you have the latest stable version. We will clone it into the /var/www/html/ directory, the default web root for Apache.

sudo git clone --branch release-5.0-stable https://github.com/bugzilla/bugzilla /var/www/html/bugzilla

Next, navigate into the new Bugzilla directory and run the checksetup.pl script. This script is a powerful tool that checks for required Perl modules, creates configuration files, and sets up the database schema.

cd /var/www/html/bugzilla
sudo ./checksetup.pl --check-modules

The script will list all the required and optional Perl modules. Don’t worry about installing them manually; Bugzilla provides a helper script for that.

Step 4: Install Required Perl Modules

Bugzilla simplifies the process of installing its dependencies. Run the following command to automatically install all the necessary Perl modules:

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

This process may take several minutes as it downloads and installs dozens of modules. Once it’s finished, you’re ready to configure Bugzilla’s connection to the database.

Step 5: Finalize the Bugzilla Configuration

The checksetup.pl script we ran earlier created a configuration file named localconfig. We now need to edit this file to provide our database credentials.

Open the file with a text editor like nano:

sudo nano localconfig

Find these three lines and update them with the database details you created in Step 2:

$db_name = 'bugs';
$db_user = 'bugzilla';
$db_pass = 'your-strong-password';

Save the file and exit the editor (Ctrl+X, then Y, then Enter).

Now, run the checksetup.pl script one more time. This time, it will use the localconfig file to connect to the database, create the necessary tables, and prompt you to create the Bugzilla administrator account.

sudo ./checksetup.pl

Follow the prompts carefully:

  • Enter the email address for the administrator.
  • Enter the administrator’s real name.
  • Enter and confirm a strong password for the administrator account.

Step 6: Configure Apache Virtual Host for Bugzilla

To make Bugzilla accessible via a web browser, we need to tell Apache how to serve its files. Create a new Apache virtual host configuration file:

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

Paste the following configuration into the file. This basic setup tells Apache where the Bugzilla files are located and sets the necessary permissions.

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/bugzilla
    ServerName your-domain.com

    <Directory /var/www/html/bugzilla>
        AllowOverride All
        Options -Indexes +ExecCGI
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/bugzilla-error.log
    CustomLog ${APACHE_LOG_DIR}/bugzilla-access.log combined
</VirtualHost>

Important: Replace your-domain.com with your actual domain name or server’s IP address.

Next, enable the new virtual host configuration and the required CGI module for Apache:

sudo a2ensite bugzilla.conf
sudo a2enmod cgi

Finally, set the correct file ownership for the Bugzilla directory to allow Apache to read and write files, then restart the service for the changes to take effect.

sudo chown -R www-data:www-data /var/www/html/bugzilla/
sudo systemctl restart apache2

Step 7: Accessing and Securing Your Installation

Your Bugzilla installation is now complete! Open your web browser and navigate to http://your-domain.com. You should see the Bugzilla login screen. Log in with the administrator credentials you created during the checksetup.pl process.

Security Tip: For any production environment, it is highly recommended to secure your Bugzilla instance with an SSL certificate (HTTPS). You can obtain a free certificate from Let’s Encrypt and configure Apache to use it, ensuring that all data transmitted between your users and the server is encrypted.

You are now ready to start configuring your projects, adding users, and streamlining your bug-tracking workflow with one of the most reliable tools in the industry.

Source: https://kifarunix.com/install-bugzilla-bug-tracker-on-ubuntu-20-04/

900*80 ad

      1080*80 ad