How to Install Mantis Bug Tracker on CentOS 7

By Sajid Qureshi, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud’s incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

Mantis Bug Tracker (Mantis BT) is a free and open source bug tracking tool written in PHP. Mantis BT can help you manage your projects and track application bugs deployed on your Alibaba Cloud Elastic Compute Service (ECS) instance.

Prerequisites

1. You must have an Alibaba Cloud Elastic Compute Service (ECS) instance activated and have verified your valid payment method. If you are a new user, you can get a free account in your Alibaba Cloud account. If you don’t know about how to set up your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
2. A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.

Update System

First login to your server and upgrade all the available packages using the following command.

Next, install EPEL repository using the following command.

Install LAMP Server

Once the system is updated, you can install the dependencies required. To install Mantis BT, you will need to install the Apache web server along with MySQL and PHP with a few extensions.

Run the following command to install the Apache web server.

Start Apache and enable it to start at boot time using the following commands.

You can check the status of Apache web server using the following command.

You should see the following output:

Next, install MariaDB using the following command.

Now you can start MariaDB server and enable it to start at boot time like we have done before for Apache web server, using the following commands.

You can check the status of MariaDB using this below-given command and you should see the following output.

We recommend you to make sure that this installation is secure and to do so execute the following command.

You’ll be asked to provide a root password so enter an appropriate password and answer yes to all questions by pressing Y.

Now you’ll have to create a database for Mantis BT so please follow the instructions.

You’ll be asked to enter password so simply enter a password and now execute the following queries to create a new database.

The above query will create a database named mantis_data. For the database, you can use any name you prefer in the place of mantis_data. Make sure that you use semicolon at the end of each query as a query always ends with a semicolon. Once the database is created you can create a new user and grant the required permissions to the user for the database.

The above query will create a user with username mantis_user. You can use any preferred username instead of mantis_user. Replace StrongPassword with a strong password.

Now provide the appropriate privileges to your database user over the database you have created. Run the following query to do so.

Now run the following query to immediately apply the changes to the database privileges.

Now you can exit from MariaDB prompt using the following command.

Next, let’s install PHP and Mantis supports PHP version greater than 5.5. So, here we will be installing PHP 7. Unfortunately, PHP 7 is not available in CentOS 7 repository by default, so we will install webtatic repository using the following command.

Next, execute the following command to install PHP 7 with the required modules.

Install Mantis

We have installed all the required dependencies to install mantis. Now we are ready to install Mantis bug tracker, so download the latest stable version of Mantis using the following command.

Next, unzip the downloaded package using the following command.

Next, move the extracted package files to apache web root directory using the following command.

Now you will need to change the ownership rules of the mantis directory using the following command.

Create a Virtual Host

You have installed all the required dependencies and mantis on your CentOS 7 server. Now you will need to create a virtual host file for mantis. Execute the following command to create a virtual host file.

Add the following content to the file.

Save the file and exit from text editor. Please replace YourDomain with your actual domain name registered with Alibaba Cloud.

Finally, restart your apache web server using the following command.

Next, you will need to modify the firewall rules. Simply, execute the following commands and they will do the job for you.

Mantis Web Interface

Everything is installed and configured now you can access Mantis through a web browser. Open up your favorite web browser and visit http://YourDomain.com and you will see a Mantis pre-installation check web page. You will be asked to provide all the necessary details such as Database Name, Username, Password, Admin username, and Password.

Then click on the Install/Upgrade Database button to proceed further. On the next interface, click on Continue button and then you will see the Mantis login web page.

Enter administrator as username and root as password and then click on Login button, you will see the mantis default admin dashboard and from there you can manage your all projects.

Conclusion

In this guide, you have learned to install LAMP server and Mantis Bug Tracker on your CentOS 7 server. Now you can deploy your projects and track issues of your applications easily with Mantis BT.

Reference:https://www.alibabacloud.com/blog/how-to-install-mantis-bug-tracker-on-centos-7_594638?spm=a2c41.12734774.0.0

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store