How to Install MantisBT 2.5 on CentOS 7

MantisBT, or Mantis Bug Tracker, is an open source issue tracker written in PHP. MantisBT is finely balanced between ease of use and functionality, providing great user experiences to all members in a development team.


  • A fresh Vultr CentOS 7 x64 server instance. Say its IP address is
  • A sudo user.
  • The server instance has been updated to the latest stable status using the EPEL YUM repo.

Step 1: Setup a LAMP stack

In order to serve MantisBT, setup an up to date LAMP stack which consists of the following.

  • CentOS 7
  • Apache 2.4
  • MariaDB 10.2
  • PHP 7.1

Since setting up a LAMP stack has been covered in multiple Vultr tutorials, I will not detail the process herein but provide you the command line history for your reference.

# Install Apache 2.4sudo yum install httpd -ysudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.confsudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.confsudo systemctl start httpd.servicesudo systemctl enable httpd.service# Install MariaDB 10.2curl -sS | sudo bashsudo yum install MariaDB-server MariaDB-client -ysudo systemctl start mariadb.servicesudo systemctl enable mariadb.service# Secure MariaDB 10.2sudo /usr/bin/mysql_secure_installation# When prompted, answer questions as below:# - Enter current password for root (enter for none): Just press the Enter button# - Set root password? [Y/n]: Y# - New password: your-MariaDB-root-password# - Re-enter new password: your-MariaDB-root-password# - Remove anonymous users? [Y/n]: Y# - Disallow root login remotely? [Y/n]: Y# - Remove test database and access to it? [Y/n]: Y# - Reload privilege tables now? [Y/n]: Y# Create a MariaDB database for MantisBTmysql -u root -p# For security purposes, be sure to replace "mantisbt", "mantisbtuser", and "yourpassword" with your own ones. CREATE DATABASE mantisbt;CREATE USER 'mantisbtuser'@'localhost' IDENTIFIED BY 'yourpassword';GRANT ALL PRIVILEGES ON mantisbt.* TO 'mantisbtuser'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;FLUSH PRIVILEGES;EXIT;# Install PHP 7.1sudo rpm -Uvh yum install -y php71w php71w-mysqlnd php71w-common php71w-cli php71w-xml php71w-mbstring php71w-gd php71w-mcrypt php71w-opcache php71w-imap php71w-process php71w-intlsudo cp /etc/php.ini /etc/php.ini.baksudo sed -i 's#;date.timezone =#date.timezone = America/Los_Angeles#' /etc/php.ini# Configure firewall rulessudo firewall-cmd --zone=public --permanent --add-service=httpsudo firewall-cmd --reload

Step 2: Prepare MantisBT program files

Download and decompress the MantisBT archive.

cdwget yum install -y unzipunzip

Move the MantisBT files to a proper location and then grant proper permissions to them.

sudo mv ~/mantisbt-2.5.1 /optsudo ln -s /opt/mantisbt-2.5.1 /var/www/html/mantisbtsudo chown -R apache:apache /opt/mantisbt-2.5.1

Step 3: Setup an Apache virtual host for MantisBT

Before you can properly run MantisBT, you need to setup an Apache virtual host for MantisBT. Just copy the whole code segment below into your SSH terminal and then press Enter.

Note: Remember to modify the values of ServerAdmin, ServerName, and ServerAlias on your machine accordingly.

cat <<EOF | sudo tee -a /etc/httpd/conf.d/mantisbt.conf<VirtualHost *:80>ServerAdmin admin@example.comDocumentRoot /var/www/html/mantisbt/ServerName mantisbt.example.comServerAlias<Directory /var/www/html/mantisbt/>Options FollowSymLinksAllowOverride AllOrder allow,denyallow from all</Directory>ErrorLog /var/log/httpd/ /var/log/httpd/ common</VirtualHost>EOF

Restart Apache in order to enable all of your changes.

sudo systemctl restart httpd.service

Step 4: Continue the installation in the MantisBT web installation wizard

Point your favorite web browser to your server’s IP, and you will be brought into the MantisBT web installation wizard interface.

In the Checking Installation section, make sure that every item is GOOD.

In the Installation Options section, input the MariaDB database credentials as follows, leave other fields untouched, and then click the Install/Upgrade Database button to move on.

  • Username (for Database): mantisbtuser
  • Password (for Database): yourpassword
  • Database name (for Database): mantisbt

On the next stage click the Continue link at the bottom to finish the installation and switch to the log-in page.

On the log-in page, use the default admin username administrator and the default password root to log in. For security purposes, you need to modify the default password immediately.

After confirming that MantisBT is up and running properly, you need to delete the MantisBT root directory in order to prevent unauthorized access.

sudo rm -rf /var/www/html/mantisbt/admin

If necessary, you can customize MantisBT by editing the file /var/www/html/mantisbt/config/config_inc.php.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article

No comments

Powered by Blogger.