1080*80 ad

Installing Bugzilla on CentOS 8

Mastering Bugzilla: A Complete Installation Guide for CentOS 8

In the world of software development and project management, effective bug tracking is not just a convenience—it’s a necessity. Bugzilla stands out as a powerful, open-source, and highly customizable bug tracking system that has been trusted by projects of all sizes for decades. If you’re running a CentOS 8 server, deploying your own instance of Bugzilla can streamline your workflow and improve team collaboration.

This comprehensive guide will walk you through every step of installing and configuring Bugzilla on a CentOS 8 system, ensuring a stable and secure setup.

Prerequisites for Installation

Before we begin, ensure you have the following in place:

  • A server running a fresh installation of CentOS 8.
  • Root or sudo access to the server.
  • A static IP address configured on your server.

Step 1: Update Your System and Install Core Dependencies

First, it’s crucial to ensure your system is up-to-date. Open your terminal and run the following command:

sudo dnf update -y

Next, we need to install the essential components that Bugzilla relies on: the Apache webserver, the MariaDB database server, Perl, and various development tools.

sudo dnf install httpd mariadb-server mariadb -y
sudo dnf install perl perl-CGI perl-DBI perl-DBD-MySQL perl-Data-Dumper perl-Template-Toolkit perl-Email-MIME perl-Email-Sender -y
sudo dnf groupinstall "Development Tools" -y

Once installed, enable and start the Apache and MariaDB services to ensure they launch on boot.

sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl start mariadb
sudo systemctl enable mariadb

Step 2: Secure and Configure the MariaDB Database

A secure database is the foundation of a reliable Bugzilla installation. We’ll start by running the MariaDB secure installation script, which helps remove insecure defaults.

sudo mysql_secure_installation

Follow the on-screen prompts. It is highly recommended to set a strong root password, remove anonymous users, disallow remote root login, and remove the test database.

Now, we’ll create a dedicated database and user for Bugzilla. This is a critical security practice that isolates Bugzilla’s data.

Log in to the MariaDB shell as the root user:

sudo mysql -u root -p

Enter the root password you just set. Now, execute the following commands to create the database and user.

  1. Create the database:

    CREATE DATABASE bugzilladb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    
  2. Create a dedicated user and grant privileges. Replace YourStrongPassword with a secure, unique password.

    CREATE USER 'bugzilla_user'@'localhost' IDENTIFIED BY 'YourStrongPassword';
    GRANT ALL PRIVILEGES ON bugzilladb.* TO 'bugzilla_user'@'localhost';
    
  3. Apply the changes and exit.
    sql
    FLUSH PRIVILEGES;
    EXIT;

Step 3: Download and Unpack Bugzilla

Next, we will download the latest stable release of Bugzilla. You can find the latest version on the official Bugzilla download page. We will use wget to download it directly to our server.

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

Once the download is complete, extract the archive:

tar -xvf bugzilla-5.0.4.tar.gz

Now, move the extracted files into the web server’s root directory. We will place it in /var/www/html/bugzilla.

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

Step 4: Install Required Perl Modules

Bugzilla has a number of Perl module dependencies. Fortunately, it includes a helpful script to check for and install them automatically.

Navigate to the Bugzilla directory and run the checksetup.pl script to see which modules are missing.

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

To automatically install all required modules, you can use the following command. This process may take several minutes.

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

Step 5: Configure Bugzilla

After installing the modules, we need to configure Bugzilla to connect to our database. Running checksetup.pl again will generate a configuration file named localconfig.

sudo ./checksetup.pl

This will create the localconfig file in your Bugzilla directory. Now, open this file with a text editor like nano or vim:

sudo nano localconfig

You need to update the database connection parameters. Find and modify the following lines to match the database credentials you created in Step 2:

$db_host = 'localhost';
$db_name = 'bugzilladb';
$db_user = 'bugzilla_user';
$db_pass = 'YourStrongPassword';

Additionally, set the web server group to ‘apache’:

$webservergroup = 'apache';

Save and close the file.

Now, run checksetup.pl 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 administrator account.

sudo ./checksetup.pl

Follow the prompts to set the Administrator email address, real name, and a strong password. Store these credentials in a safe place.

Step 6: Configure Apache and System Security

We need to create an Apache configuration file to tell the web server how to serve Bugzilla.

Create a new configuration file:

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

Paste the following configuration into the file. You can change ServerName to your domain or server IP if needed.

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/bugzilla
    ServerName your-server-ip-or-domain.com
    <Directory /var/www/html/bugzilla>
        AddHandler cgi-script .cgi
        Options +ExecCGI
        DirectoryIndex index.cgi index.html
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog /var/log/httpd/bugzilla_error.log
    CustomLog /var/log/httpd/bugzilla_access.log combined
</VirtualHost>

Save and exit the file. Next, set the correct ownership and permissions for the Bugzilla directory.

sudo chown -R apache:apache /var/www/html/bugzilla
sudo chmod -R 755 /var/www/html/bugzilla

Restart Apache for the changes to take effect:

sudo systemctl restart httpd

Finally, configure the system firewall and SELinux policies to allow web traffic and database connections.

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
sudo setsebool -P httpd_can_network_connect_db 1

Step 7: Access Your Bugzilla Installation

You’re all set! Open your web browser and navigate to your server’s IP address or domain name (e.g., http://your-server-ip-or-domain.com).

You will be greeted by the Bugzilla home page. You can log in using the administrator credentials you created during the checksetup.pl process. Once logged in, you can start configuring your projects, users, and workflows from the administration panel. Congratulations on successfully deploying your own powerful bug tracking system

Source: https://kifarunix.com/install-bugzilla-bug-tracker-on-centos-8/

900*80 ad

      1080*80 ad