f you are a developer you know that bugs are always present in the process of building a program. Especially if we work as a team on certain projects. Therefore, it is necessary to have software that can distribute the workflow of the project or simply track these problems. That is why today I will show you how to install Mantis Bug tracker on a server with Ubuntu 18.04.
Mantis Bug Tracker is an open source application that is used to test automated solutions, keeping a historical record of alterations and managing work teams remotely.
On the other hand, Mantis Bug Tracker allows the team to report errors and organize who can take care of them. Users are able to get started in minutes and start managing their projects while collaborating with their teammates and clients effectively.
So, let us start.
1.- Install Apache web server and PHP
Mantis Bug Tracker requires a web server to work. You can use Apache or Nginx but in this case, I will use Apache because it is very easy to use.
So, open a terminal and run:
:~$ sudo apt install apache2
After that, enable and start the Apache web server service.
:~$ sudo systemctl enable apache2 :~$ sudo systemctl start apache2
Next, you have to install PHP and wget. The program is built using PHP as the programming language. Wget is a CLI tool for download files.
:~$ sudo apt install php php-cli php-fpm php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath
Then, you have to test the PHP installation. Create a file in the /var/www/html/
folder named test.php
.
:~$ sudo nano /var/www/html/test.php
Now, put the following:
<?php phpinfo(); ?>
Now, save the changes by pressing CTRL + O and next close the file by pressing CTRL + X.
Next, restart Apache.
:~$ sudo systemctl restart apache2
After that, open the web browser and go to http://SERVER_IP/test.php
.
So, PHP and Apache are correctly installed.
2. Install MariaDB
The next step to install Mantis Bug Tracker is to install a database driver. Currently, Mantis is compatible with MariaDB, MySQL, and PostgreSQL. I will choose MariaDB because it is in the official repositories.
:~$ sudo apt install mariadb-server
After that, set a root password using the mysql_secure_installation
script.
:~$ sudo mysql_secure_installation
You can also make other settings by answering each question. I’ll do it this way: Y, N, Y, Y.
Then, it is necessary to create a new database and user for Mantis.
:~$ sudo mysql -u root -p CREATE DATABASE mantisdb; GRANT ALL PRIVILEGES ON mantisdb.* TO 'mantisuser'@'localhost' IDENTIFIED BY 'mantispss'; FLUSH PRIVILEGES; exit;
3. Install Mantis Bug Tracker
At the time of writing this post the latest stable version of Mantis is 2.19.0 so let’s download it.
:~$ wget https://liquidtelecom.dl.sourceforge.net/project/mantisbt/mantis-stable/2.19.0/mantisbt-2.19.0.zip
Next, decompress it.
:~$ unzip mantisbt-2.19.0.zip
And move it to the /srv folder.
:~$ sudo mv mantisbt-release-2.19.0/ /srv/mantis/
Set the right permissions to the folder.
:~$ sudo chown -R www-data:www-data /srv/mantisbt-2.19.0/ :~$ sudo chmod -R 755 /srv/mantisbt-2.19.0/
Create a new virtual host for Mantis.
:~$ sudo nano /etc/apache2/sites-enabled/mantis.conf
Then, add the following.
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/srv/mantisbt-2.19.0" ServerName bt.osradar.lan ServerAlias www.bt.osradar.lan ErrorLog "/var/log/apache2/mantisbt-error_log" TransferLog "/var/log/apache2/mantisbt-access_log" <Directory "/srv/mantisbt-2.19.0"> DirectoryIndex index.php index.html Options FollowSymLinks AllowOverride None Require all granted Options MultiViews FollowSymlinks </Directory> </VirtualHost>
So, restart apache.
:~$ sudo systemctl restart apache2
And complete the installation using the web interface.
4. Complete the installation
Now, go to the web browser and complete the installation.
After that, you have to add the MySQL credentials.
If everything is OK, at the end of the page, you will see this.
Next, log in. The user is administrator and the password is root.
Finally, you will see the main screen.
So, that’s it.
Conclusion
The Mantis installation process is quite simple but it will help you to manage and locate project bugs in an easy and agile way.
Please share this post with your friends.