How To Install Mantis Bug Tracker on AlmaLinux 8

Install Mantis Bug Tracker on AlmaLinux 8

In this tutorial, we will show you how to install Mantis Bug Tracker on AlmaLinux 8. For those of you who didn’t know, Mantis Bug Tracker (MantisBT) is a free, open-source, and web-based bug tracking software written in PHP. It is simple, easy to use, user-friendly, and comes with a lot of tools that help you collaborate with teams to resolve bugs and issues quickly. It offers a rich set of features including, Notification via email, Role-based access control, Projects, sub-projects, and category support, Issue relationship graph, customizable dashboard, and many more.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the MantisBT free web-based bug tracking system on AlmaLinux 8. You can follow the same instructions for CentOS and Rocky Linux.

Install Mantis Bug Tracker on AlmaLinux 8

Step 1. First, let’s start by ensuring your system is up-to-date.

sudo dnf install epel-release
sudo dnf update

Step 2. Installing the LAMP stack.

An AlmaLinux LAMP server is required. If you do not have LAMP installed, you can follow our guide here.

Step 3. Installing Mantis Bug Tracker on AlmaLinux 8.

Now we download the latest stable version of MantisBT from the MantisBT official page:

wget https://sourceforge.net/projects/mantisbt/files/mantis-stable/2.25.2/mantisbt-2.25.2.zip

Unzip the downloaded file with the following command:

unzip mantisbt-2.25.2.zip

Next. move the extracted file to /var/www/html/ as below:

sudo mv mantisbt-2.25.2 /var/www/html/mantisbt

We will need to change some folders permissions:

sudo chown -R apache:apache /var/www/html/mantisbt

Step 4. Configuring MariaDB.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. You should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB.

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next, we will need to log in to the MariaDB console and create a database for the Mantis Bug Tracker. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Mantis Bug Tracker installation:

MariaDB [(none)]> CREATE DATABASE mantisdb;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON mantisdb.* TO 'mantis'@'localhost' IDENTIFIED BY 'your-strong-passwd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Step 5. Configure Apache.

Now create an Apache virtual host configuration file for Mantis:

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

Add the following file:

<VirtualHost *:80>
    DocumentRoot "/var/www/html/mantisbt"

    ServerNamemantisbt.your-domain.com ErrorLog "/var/log/httpd/mantisbt_error_log"
    CustomLog "/var/log/httpd/mantisbt_access_log" combined

        <Directory "/var/www/html/mantisbt/">
            DirectoryIndex index.php 
            Options -Indexes +FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

</VirtualHost>

Save and close the file when you are finished then restart the Apache service to apply the changes:

sudo a2ensite mantisbt.conf
sudo a2enmod rewrite
sudo systemctl restart httpd

Step 6. Configure the Firewall.

Allow ports 80 and 443 through the firewall:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Then, configure the SELinux with the following command below:

sudo setsebool httpd_can_network_connect on -P
sudo chcon -R -u system_u -t httpd_sys_rw_content_t -r object_r /var/www/html/mantisbt

Step 7. Accessing Mantis Bug Tracker Web Interface.

Once successfully installed, open your web browser and access the Mantis web interface using the URL https://mantis.your-domain.com. You should see the following screen:

Install Mantis Bug Tracker on AlmaLinux 8

Congratulations! You have successfully installed Mantis. Thanks for using this tutorial for installing Mantis Bug Tracker on your AlmaLinux 8 system. For additional help or useful information, we recommend you check the official Mantis website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!