1080*80 ad

How to Install Mantis Bug Tracker on Debian 10

This guide provides a detailed walkthrough for installing the Mantis Bug Tracker system on a Debian 10 server. MantisBT is a popular open-source web-based bug tracking system that helps teams manage software defects and project issues efficiently. By following these steps, you will set up MantisBT with a web server and database backend.

Before you begin, ensure your Debian 10 server is updated and has the necessary components installed. You will need a web server (like Apache or Nginx), PHP, and a database server (like MySQL or MariaDB). This guide assumes you have these basic components ready.

Prerequisites

Ensure you have the following installed:

  • Apache2 or Nginx web server
  • PHP 7.3 (the default on Debian 10) with essential extensions
  • MySQL Server or MariaDB Server

You can install the required PHP extensions with the following command if you are using Apache:
sudo apt update
sudo apt install php libapache2-mod-php php-mysql php-gd php-imagick php-curl php-intl php-mbstring php-soap php-xml php-zip

If you are using Nginx and PHP-FPM, install php-fpm instead of libapache2-mod-php:
sudo apt install php-fpm php-mysql php-gd php-imagick php-curl php-intl php-mbstring php-soap php-xml php-zip

Database Setup

MantisBT requires a database to store its data. We will create a new database and a dedicated user for MantisBT.

Connect to your MySQL or MariaDB server as the root user:
sudo mysql -u root -p

Enter your root password when prompted. Then, run the following SQL commands to create the database and user. Replace 'mantis_user', 'your_password', and 'mantis_db' with your desired values.

CREATE DATABASE mantisdb CHARACTER SET utf8 COLLATE utf8generalci;
CREATE USER ‘mantis
user’@’localhost’ IDENTIFIED BY ‘yourpassword’;
GRANT ALL PRIVILEGES ON mantis
db.* TO ‘mantis_user’@’localhost’;
FLUSH PRIVILEGES;
EXIT;

Remember the database name, username, and password you chose, as you will need them during the web installation.

Download MantisBT

Navigate to a temporary directory, such as /tmp, and download the latest stable version of MantisBT. You can usually find the download link on the official MantisBT website. Use wget or curl to download the archive.

cd /tmp
wget https://downloads.sourceforge.net/project/mantisbt/mantis-stable/2.25.2/mantisbt-2.25.2.tar.gz (Replace the version number with the latest stable release)

Extract the downloaded archive:
tar -xvzf mantisbt-2.25.2.tar.gz (Replace the filename)

This will create a directory named mantisbt-2.25.2.

Install MantisBT Files

Move the extracted MantisBT files to your web server’s document root directory. A common location for Apache is /var/www/html/. You might want to place it in a subdirectory, for example, /var/www/html/mantis.

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

Now, set the correct ownership and permissions for the web server user (www-data is common for Apache and Nginx on Debian) so it can read and write files.

sudo chown -R www-data:www-data /var/www/html/mantis
sudo chmod -R 755 /var/www/html/mantis

Configure Web Server (Apache Example)

If you are using Apache, you need to create a virtual host configuration file for MantisBT. This tells Apache how to handle requests for your MantisBT installation.

Create a new configuration file:
sudo nano /etc/apache2/sites-available/mantis.conf

Add the following configuration block. Adjust ServerName and DocumentRoot as needed for your setup.

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName your_domain_or_ip_address
    DocumentRoot /var/www/html/mantis

    <Directory /var/www/html/mantis>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

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

Save and close the file. Enable the new virtual host and the rewrite module (often required by web applications).

sudo a2ensite mantis.conf
sudo a2enmod rewrite

Test the Apache configuration for syntax errors:
sudo apache2ctl configtest

If the test reports Syntax OK, restart Apache to apply the changes:
sudo systemctl restart apache2

Run the Web-Based Installer

Now that the files are in place and the web server is configured, you can complete the installation through your web browser.

Open your web browser and navigate to the URL where you installed MantisBT. If you used the configuration above and your server’s IP or domain is your_domain_or_ip_address, you would go to:

http://yourdomainoripaddress or http://yourdomainoripaddress/mantis (depending on your DocumentRoot)

The MantisBT installer page should appear.

  1. The installer will perform checks to ensure your system meets the requirements. Address any warnings or errors displayed.
  2. Enter the database details you set up earlier (Database Host: localhost, Database Name: mantis_db, Database User: mantis_user, Password: your_password).
  3. The default database type is MySQL; keep this if you are using MySQL or MariaDB.
  4. Click Install Database or Upgrade Database if prompted.

The installer will create the necessary database tables.

Post-Installation Steps

Once the installation is complete, you will be prompted to delete or rename the admin directory inside your MantisBT installation for security reasons. This is crucial to prevent unauthorized access to the installer.

sudo mv /var/www/html/mantis/admin /var/www/html/mantis/admin_OLD

Now you can access your MantisBT login page. The default administrator username is administrator and the password is root. It is highly recommended to log in immediately and change the password for the ‘administrator’ account and delete or disable the ‘root’ user (which is the default installer user, distinct from the system root).

Your Mantis Bug Tracker is now installed and ready to use on Debian 10. You can start configuring projects, users, and begin tracking issues.

Source: https://kifarunix.com/install-mantis-bug-tracker-on-debian/

900*80 ad

      1080*80 ad