How to install Mantis Bug Tracker on Linux

Install Mantis Bug Tracker on Linux Ubuntu Centos RHEL debian

Mantis Bug Tracker is a popular open-source web-based bug tracking system. It is written in PHP and uses a MySQL/MariaDB database to store data. Mantis Bug Tracker is a great tool for developers and project managers to keep track of issues, bugs, and tasks in software development projects. In this article, we will go through the steps to install Mantis Bug Tracker on a Linux system.

Prerequisites

Before we begin the installation process, we need to ensure that our system meets the following prerequisites:

  1. Web Server: You will need a web server installed on your Linux system. Apache HTTP Server is a popular choice, and we will use it in this guide.
  2. PHP: Mantis Bug Tracker is written in PHP, so you will need to have PHP installed on your system. We recommend using the latest stable version of PHP, which at the time of writing is PHP 8.1.
  3. Database Server: Mantis Bug Tracker requires a MySQL or MariaDB database to store its data. We will be using MariaDB in this guide.
  4. Additional PHP Extensions: Mantis Bug Tracker requires several PHP extensions to be installed and enabled, including:
    • php-gd (for image processing)
    • php-mbstring (for multi-byte string handling)
    • php-curl (for HTTP client functionality)

Once you have verified that your system meets these prerequisites, you can proceed with the installation process.

Step 1: Install Apache HTTP Server

If you don’t already have Apache HTTP Server installed on your Linux system, you can install it using your distribution’s package manager. For example, on Ubuntu/Debian, you can use the following command:

$ sudo apt-get install apache2

On CentOS/RHEL, you can use:

$ sudo yum install httpd

After installing Apache, make sure to start the service and enable it to start automatically on system boot:

$ sudo systemctl start apache2    # On Ubuntu/Debian and CentOS/RHEL
$ sudo systemctl enable apache2   # On Ubuntu/Debian and CentOS/RHEL

Step 2: Install MariaDB

Next, we need to install the MariaDB database server. On Ubuntu / Debian, you can use the following command:

$ sudo apt-get install mariadb-server

On CentOS/RHEL, you can use:

$ sudo yum install mariadb-server

After installing MariaDB, secure the installation by running the following command and following the on-screen prompts:

$ sudo mysql_secure_installation

Step 3: Install PHP and Required Extensions

Mantis Bug Tracker requires PHP and several additional PHP extensions. On Ubuntu/Debian, you can install PHP and the required extensions using the following command:

$ sudo apt-get install php php-gd php-mbstring php-curl

On CentOS/RHEL, you can use:

$ sudo yum install php php-gd php-mbstring php-curl

After installing PHP and the required extensions, restart the Apache web server to ensure that the changes take effect:

$ sudo systemctl restart apache2   # On Ubuntu/Debian
$ sudo systemctl restart httpd     # On CentOS/RHEL

Step 4: Download Mantis Bug Tracker

Now that we have all the required dependencies installed, we can download the latest version of Mantis Bug Tracker from the official website. At the time of writing, the latest stable version is 2.26.2.

You can download the Mantis Bug Tracker package from the official website using the following command:

$ wget https://sourceforge.net/projects/mantisbt/files/mantis-stable/2.26.2/mantisbt-2.26.2.tar.gz

Once the download is complete, extract the package using the following command:

$ tar -xvzf mantisbt-2.26.2.tar.gz

This will create a new directory called mantisbt-2.26.2.

Step 5: Configure Apache for Mantis Bug Tracker

Next, we need to configure Apache to serve the Mantis Bug Tracker application. We will create a new virtual host configuration file for Mantis Bug Tracker.

  • Create a new configuration file for Mantis Bug Tracker:
$ sudo nano /etc/apache2/sites-available/mantis.conf
  • Add the following content to the file, replacing /path/to/mantis with the actual path to the extracted Mantis Bug Tracker directory:
<VirtualHost *:80>
      ServerName mantis.example.com
      DocumentRoot /path/to/mantis
      <Directory /path/to/mantis>
         Options FollowSymLinks
         AllowOverride All
         Require all granted
      </Directory>
      ErrorLog ${APACHE_LOG_DIR}/mantis_error.log
      CustomLog ${APACHE_LOG_DIR}/mantis_access.log combined
</VirtualHost>

This configuration tells Apache to serve the Mantis Bug Tracker application from the specified directory and sets up a virtual host for mantis.example.com. You can replace mantis.example.com with the domain or IP address you want to use for accessing Mantis Bug Tracker.

  • Save and close the file.
  • Enable the new virtual host configuration:
$ sudo a2ensite mantis.conf
  • Disable the default Apache virtual host configuration (if necessary):
$ sudo a2dissite 000-default.conf
  • Restart Apache to apply the changes:
$ sudo systemctl restart apache2

Step 6: Create a Database for Mantis Bug Tracker

Mantis Bug Tracker requires a MySQL/MariaDB database to store its data. We need to create a new database and a user with appropriate permissions for Mantis Bug Tracker.

  • Log in to the MariaDB shell:
$ sudo mysql -u root -p

Enter the root password when prompted.

  • Create a new database for Mantis Bug Tracker:
CREATE DATABASE mantisdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  • Create a new user and grant privileges to the new database:
CREATE USER 'mantisuser'@'localhost' IDENTIFIED BY 'YourStrongPassword';
GRANT ALL PRIVILEGES ON mantisdb.* TO 'mantisuser'@'localhost';

Replace YourStrongPassword with a strong password of your choice.

  • Flush the privileges to apply the changes:
FLUSH PRIVILEGES;
  • Exit the MariaDB shell:
EXIT;

Step 7: Configure Mantis Bug Tracker

Now that we have the database set up, we can proceed with configuring Mantis Bug Tracker.

  • Navigate to the Mantis Bug Tracker directory:
$ cd /path/to/mantis
  • Copy the sample configuration file:
$ cp config_defaults_inc.php.sample config_inc.php
  • Open the config_inc.php file for editing:
$ nano config_inc.php
  • Locate the following lines in the file and update them with your database credentials:
$g_database_type = 'mysqli';
$g_hostname      = 'localhost';
$g_db_username   = 'mantisuser';
$g_db_password   = 'YourStrongPassword';
$g_database_name = 'mantisdb';

Replace YourStrongPassword with the password you set for the mantisuser user earlier.

  • Save and close the file.

Step 8: Install Mantis Bug Tracker

Now that we have configured the database and updated the configuration file, we can proceed with installing Mantis Bug Tracker.

  • Open your web browser and navigate to the following URL, replacing mantis.example.com with the domain or IP address you configured earlier:
http://mantis.example.com/admin/install.php
  • You should see the Mantis Bug Tracker installation page. Follow the on-screen instructions to complete the installation process.
  • During the installation process, you will be prompted to enter the database credentials you configured earlier.
  • After completing the installation, you will be asked to create an administrator user account.
  • Once the installation is complete, you can log in to the Mantis Bug Tracker administration panel using the administrator account you just created.

Step 9: Configure Mantis Bug Tracker (Optional)

After the installation is complete, you may want to configure Mantis Bug Tracker to suit your needs. Here are some common configuration options:

  • Email Notifications: Mantis Bug Tracker can send email notifications for various events, such as new issues, updates, and comments. To configure email settings, go to the administration panel and navigate to “Manage” > “Configuration” > “Email Notifications”.
  • User Management: You can create and manage user accounts, assign user roles, and control access permissions. Navigate to “Manage” > “Manage Users” in the administration panel.
  • Project Management: Mantis Bug Tracker allows you to create and manage multiple projects. You can configure project settings, assign users to projects, and customize project-specific workflows. Go to “Manage” > “Manage Projects” in the administration panel.
  • Workflow Configuration: Mantis Bug Tracker provides a flexible workflow system that allows you to define custom issue statuses, priorities, and resolutions. You can customize these settings by navigating to “Manage” > “Manage Config” > “Workflow”.
  • Customization: Mantis Bug Tracker offers various customization options, such as themes, plugins, and language translations. You can explore these options by navigating to the respective sections in the administration panel.

Remember to thoroughly review the Mantis Bug Tracker documentation and community resources for more advanced configuration options and best practices.

Step 10: Secure Mantis Bug Tracker

After installing and configuring Mantis Bug Tracker, it’s important to take steps to secure your installation. Here are some recommended security measures:

  1. Update Regularly: Keep Mantis Bug Tracker, PHP, and other dependencies up to date with the latest security patches and updates.
  2. Configure Access Permissions: Restrict access to the Mantis Bug Tracker installation directory and sensitive configuration files by properly setting permissions.
  3. Enable HTTPS: Configure Apache to serve Mantis Bug Tracker over HTTPS to encrypt communication between the server and clients.
  4. Implement Authentication: Consider implementing additional authentication measures, such as two-factor authentication or integration with a centralized authentication system like LDAP or Active Directory.
  5. Restrict Access to Admin Panel: Limit access to the Mantis Bug Tracker administration panel to authorized users only.
  6. Monitor Logs: Regularly monitor Apache and Mantis Bug Tracker logs for any suspicious activity or errors.
  7. Backup Data: Implement a regular backup strategy for your Mantis Bug Tracker database and configuration files to ensure data recovery in case of any issues.
  8. Disable Unused Features: Disable any unused features or plugins in Mantis Bug Tracker to reduce the attack surface.
  9. Follow Best Practices: Adhere to industry-standard security best practices, such as using strong passwords, limiting system permissions, and keeping software up to date.

By following these security measures, you can help protect your Mantis Bug Tracker installation and ensure the confidentiality, integrity, and availability of your bug tracking data.

Conclusion

Mantis Bug Tracker is a powerful and feature-rich bug tracking system that can greatly improve the efficiency and organization of your software development projects. By following the steps outlined in this article, you should now have a working installation of Mantis Bug Tracker on your Linux system.

Remember to regularly update Mantis Bug Tracker, PHP, and other dependencies to ensure security and stability. Additionally, take advantage of the various configuration options and customization features offered by Mantis Bug Tracker to tailor the system to your specific needs.

If you encounter any issues during the installation or configuration process, refer to the official Mantis Bug Tracker documentation or seek assistance from the active community forums and support channels.

LEAVE A COMMENT