ManagedCloud Servers

High performance handled and monitored by us 24/7/365. A complete solution to provide you with our in house expertise 24/7 tailored to your specific needs. We'll setup a bespoke server for your site using the latest tehnologies so you can get the most out of your hardware and get your website loading quickly and reliably. Find out more..

cPanelCloud Servers

Recommended - High performance cloud servers with no technical knowledge required. If you're hosting multiple websites already and you're looking to consolidate, or if you're looking to isolate yourself from the shared hosting environment but you don't have the time or knoweldge to manage a server, then the Managed cPanel Servers are for you. Find out more..

UnmanagedCloud Servers

Our unmanaged range gives you complete control at rock bottom prices and our cloud platform boasts super fast multipath 40Gb/s network, the latest Intel Xeon V3 CPUs and enterprise grade redundant SSDs. If you're a sysadmin look no further, we offer some of the best specification to price ratio servers available. Find out more..

Want your very own server? Get our 1GB memory, Xeon V4, 20GB SSD VPS for £10.00 / month.

View Plans

How to Install and Setup Mantis Bug Tracker on Ubuntu 16.04

Mantis BT is a free and feature-rich bug tracking web based application tool that provides a delicate balance between simplicity and power.

It is written in PHP and uses MySQL, MS SQL, and PostgreSQL databases to store its data. Mantis BT can be installed on Ubuntu, Centos, Windows, OS X and many more.

Some of the important features of Mantis BT are shown below:

  1. Report issues via email.
  2. Projects, sub-projects, and category support.
  3. Multiple projects per instances.
  4. User based access levels.
  5. Sponsorship support.
  6. Issue relationship graph.
  7. Mantis plugins make possible the integeration of other version control Systems.

In this guide, I will going to explain how to install Mantis BT on Ubuntu 16.04 server.

Prerequisites

  • An Ubuntu 16.04 operating system with minimal installation.
  • A normal user with sudo privileges.

Update the System

First, login to your server with your sudo user and update the system with the latest stable version using the following command:

sudo apt-get update -y sudo apt-get upgrade -y

After updating the system, restart your system.

Install Apache Web Server

Before starting, Apache web server is required to install Mantis BT. You can install it by running the following command:

sudo apt-get install apache2 lib-apache2-php7.0 -y

After installing the Apache web server, start the apache service and enable it to start at boot time by running the following command:

sudo systemctl start apache2 sudo systemctl enable apache2

Install PHP

You will also need to install PHP and other required modules in your system. You can install it with the following command:

sudo apt-get install php7.0 php7.0-mysql php7.0-cli -Y

After installing PHP, you will need to tune the PHP settings. To do so, edit the php.ini file:

sudo nano /etc/php/7.0/apache2/php.ini

Change the following line:

date.timezone=Asia/Kolkata
upload_max_filesize = 50M
memory_limit = 128M

Save and close the file.

Install and Configure the Database Server

MariaDB is a fork of the MySQL relational database management system. You can install it by running the following command:

sudo apt-get install mariadb mariadb-server -y

Next, start the MariaDB service and enable it to start at boot time with the following command:

sudo systemctl start mysql sudo systemctl enable mysql

Next, secure MariaDB installation with the following command:

sudo mysql_secure_installation

Answer all the questions:


NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here.

Enter current password for root (enter for none): ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) Enter current password for root (enter for none): OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation.

Set root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.

Remove anonymous users? [Y/n] Y ... Success!

Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.

Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success!

Reloading the privilege tables will ensure that all changes made so far will take effect immediately.

Reload privilege tables now? [Y/n] Y ... Success! Cleaning up...

All done! If you've completed all of the above steps, your MariaDB installation should now be secure.

Thanks for using MariaDB!

Your MariaDb installation is now secure.

Next, login to MariaDB console with the following command:

mysql -u root -p

Enter your root password when prompted, then create a database user and password for Mantis BT.

MariaDB [(none)]>CREATE DATABASE mantis;

Next, create a user and password with the following command:

MariaDB [(none)]>CREATE USER 'mantisuser'@'localhost' IDENTIFIED BY 'yourpassword';

Next, grant privileges to the Mantis BT database with the following command:

MariaDB [(none)]>GRANT ALL PRIVILEGES ON mantis.* TO 'mantisuser'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;

Next, run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MySQL and we can use new credential:

MariaDB [(none)]>FLUSH PRIVILEGES;

Finally, exit from the MariaDB console with the following command:

MariaDB [(none)]>exit;

Install Mantis BT

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

wget https://excellmedia.dl.sourceforge.net/project/mantisbt/mantis-stable/2.4.0/mantisbt-2.4.0.zip

After downloading Mantis BT, unzip the downloaded file with the following command:

unzip mantisbt-2.4.0.zip

Next, move the extracted directory to the apache web root directory:

sudo mv mantisbt-2.4.0 /var/www/html/mantis

Next, change the ownership of the mantis directory with the following command:

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

Next, you will need to create a Apache virtual host file for Mantis BT. To do so, create a mantis.conf file:

sudo nano /etc/apache2/sites-available/mantis.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/mantis"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
ErrorLog "/var/log/apache2/mantis-error_log"
CustomLog "/var/log/apache2/mantis-access_log" combined

<Directory "/var/www/html/mantis/"> DirectoryIndex index.php index.html Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>

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

sudo a2ensite mantis.conf

Finally, restart the apache service for the changes to take effects:

sudo systemctl restart apache2

Configure Firewall

Mantis BT runs on port 80, so you will need to allow port 80 through UFW firewall. By default, UFW is disabled in Ubuntu, so you will need to enable it first. You can enable it by running the following command:

sudo ufw enable

After enabling UFW, allow port 80 through UFW with the following command:

sudo ufw allow 80

Access Mantis BT

Once everything is configured. Open your web browser and navigate the URL http://yourdomain.com, you should see the Pre-installation Check page in the following image:

Provide all the required information such as database name, database username, password, admin username and password. Then click on the "Install/Upgrade" Database button. Once the installation is completed, you should see the following page:

Next, click on the "Continue" button, you should see the Mantis BT login page in below image:

Provide a default Mantis BT username "administrator" and password "root". Then click on the "Login" button, you should see the Mantis BT Dashboard in following image:

Finally, you have successfully installed Mantis BT on Ubuntu 16.04 server. You have also setup Mantis BT through web browser.

You can now easily deploy it on your development environment.

Want your very own server? Get our 1GB memory, Xeon V4, 20GB SSD VPS for £10.00 / month.

View Plans