Home / How To / How to install and configure Mantis Bug Tracker on Ubuntu 18.04 LTS

How to install and configure Mantis Bug Tracker on Ubuntu 18.04 LTS

Mantis is a free and open source bug tracking web-based application tool available for Windows, OS X and Linux. It is written in PHP and supports various databases. Mantis Bug Tracker is also known as MantisBT.

MantisBT is easy to use and it has lots of features that

  • Users can customize fields to create problems / view / execute workflow as well as notification
  • Mantis support Release functions to manage different editions of a project
  • Easy collaboration with team members and client
  • Report problems via email
  • Email notification when changes are made to questions
  • Easy to use Dashboard
  • User-based access levels, the user can have a different type of access levels for different project
  • Support for lots of plug-in

In this tutorial we will teach you how to install MantisBT on Ubuntu 1

8.04 LTS.

Prerequisites [19659013] An Ubuntu 18.04 operating system with minimal installation.

A sudo user with root privileges.

1 Getting Started

First, log on to your server with sudo privileges and update the system with the latest stable version using foll due command:

  sudo apt update && apt upgrade -y 

2 Installing LAMP Server

Mantis requires Apache2, PHP and Database Server to be installed on your server.

Install Apache Web Server

You can install apache web server with the following command: –

  sudo apt install apache2-y 

Now let's check the apache service

  sudo systemctl status apache2 

If apache web server not running, run the following command [19659017] sudo systemctl start apache2

Now enable apache service to start at start time by running the following command:

  sudo systemctl enable apache2 

Install PHP

Mantis is written in PHP so you need to install PHP and other required modules in your system. Run the following command in Terminal

  sudo apt install wget php php-cli php-fpm php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath 

Now check the version of PHP with the following command

  php -v 

You will see the output as

PHP 7.2.24-0ubuntu0.18.04.1 (cli) (built: October 28, 2019 12:07:07 PM) (NTS)
Copyright (c) 1997-2018 PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

Now you can set PHP settings by editing the following file.

  sudo vim /etc/php/7.2/apache2/php.iniebrit19659023'and upload file size according to your requirement 

  upload_max_filesize = 50M 

Install and configure database server for Mantis

Then run the following command for to install the MariaDB server.

  sudo apt install mariadb server mariadb-client 

Now start MariaDB serv ice and allow it to start at boot time and then check MariaDB service status with the following command:

  sudo systemctl start mariadb 
sudo systemctl enable mariadb
sudo systemctl status mariadb

Next, secure MariaDB installation with the following command:

  sudo mysql_secure_installation 

Answer all questions as below:

  Set root password? [Y/n] Y 
New password:
Enter new password:
Remove anonymous users? [Y/n] Y
Reject root login remotely? [Y/n] Y
Delete the test database and access it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Your MariaDB installation is now secure.

Log in to the MariaDB console shown below:

  sudo mysql -u root -p 

Enter your root password when prompted. [19659053] NOTE: - If you cannot log in to mysql without sudo and it shows ERROR 1698 (28000): Access denied to user & # 39; root & # 39; @ & # 39; localhost
For this ERROR, run commands

sudo mysql - u root

mysql> USING mysql;
mysql> UPDATE user SET plugin = & # 39; mysql_native_password & # 39; WHERE User = & # 39; root & # 39 ;;
mysql> exit;

sudo restart mariadb

Then create a database for Mantis:

  MariaDB [(none)]> CREATE DATABASE mantisdb; 

Then create a user and password with the following command:

  MariaDB [(none)]> CREATE USER & # 39; mantis & # 39; @ & # 39; localhost & # 39; IDENTIFIED BY & # 39; mentispassword & # 39 ;; 

Then grant privileges to the mantisdb database with the following command:

  MariaDB [(none)]> GIVE ALL PRIVILEGES ON mantisdb. * TO & # 39; mantis & # 39; @ & # 39; localhost & # 39; IDENTIFIED BY & # 39; mentispassword & # 39; WITH GRANT OPTION; 

Then run the following command to reload the privilege table

  MariaDB [(none)]> FLUSH PRIVILEGES; 

Now run the exit from the MariaDB console with the following command:

  MariaDB [(none)]> exit; 

Install Mantis BT

You can download the latest version of mantis from their official website. You can download it with the wget command:

  wget https://excellmedia.dl.sourceforge.net/project/mantisbt/mantis-stable/2.22.1/mantisbt-2.22.1.zipebrit19659023vardAfter downloading Mantis BT, extract the downloaded file and move it to apache web directory with the following commands: 

  unzip mantisbt-2.22.1.zip 
sudo mv mantisbt-2.22.1 / var / www / html / mantis / [19659023] Next Set right permissions for mantis directory

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

Then run the following command to create a virtual host file for apache for Mantis. [19659017] sudo vim /etc/apache2/sites-available/mantis.conf Chapter19659023 ?? Now add the following lines to mantis.conf

ServerAdmin [email protected]
DocumentRoot "/ var / www / html / mantis "
Server name yourdomain.com
ServerAlias ​​www.yourdomain.com
ErrorLog" / var / log / apache2 / mantis-error_log "
CustomLog" / var / log / apache2 / mantis -acc ess_log "combined

DirectoryIndex index.php index.html
Options FollowSymLinks
AllowOverride All
Require all granted

Save and close the file . Then activate the virtual host with the following command.

  sudo a2ensite mantis.conf 

Finally, restart the apache service by running the following command.

  sudo systemctl restart apache2 

Configure the firewall

You must allow port 80 through the UFW firewall for Mantis BT. You can enable the UFW firewall and check its status with the following command:

  sudo ufw enable 
systemctl status ufw

Then port 80 allows the following command

  sudo ufw allow 80 

Access Mantis BT Web Interface

Open your browser and enter the URL http://yourdomain.com, you should see the following page:

 Preinstallation check

  Check 2

Now, enter all necessary information, such as database name, database username, password, admin username and password. Then click on the "Install / Upgrade" database button. When the installation is complete, see the following page:

 Database settings

Then click on the "Continue" button and you will see the login page for Mantis BT as below

 Mantis login

 Log in as administrator

Enter a standard Mantis BT username "administrator" and password "root". Then click on the "Login" button and you will see Mantis BT Dashboard in the following image:

 Mantis Bug Tracker Dashboard

Finally you have installed Mantis BT on Ubuntu 18.04 server.

Source link