Installing MantisBT on CentOS 7 with LAMP Stack

MantisBT (Mantis Bug Tracker) is a PHP-based, open-source issue tracking system. It delivers a perfect balance between ease of use and advanced features, offering a seamless experience to every member of a development team.

Requirements

  • A clean CentOS 7 x64 server, assumed IP: 203.0.113.1
  • An account with sudo privileges
  • The system is fully updated using the EPEL YUM repository

Step 1: Install the LAMP Environment

To deploy MantisBT, you’ll need to configure a LAMP stack, which comprises:

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

The commands below outline how to set up the environment. The instructions themselves are not detailed since this process is widely documented.

Install Apache 2.4

sudo yum install httpd -y
sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf
sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf
sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Install MariaDB 10.2

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
sudo yum install MariaDB-server MariaDB-client -y
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Secure MariaDB 10.2

sudo /usr/bin/mysql_secure_installation
# Provide responses as follows:
# - Press Enter when prompted for root password
# - Confirm setting a root password: Y
# - Enter new password: your-MariaDB-root-password
# - Re-enter it: your-MariaDB-root-password
# - Remove anonymous users: Y
# - Disallow remote root login: Y
# - Delete the test database: Y
# - Reload privileges: Y

Create the Database for MantisBT

For security, change mantisbt, mantisbtuser, and yourpassword to your preferred values.

mysql -u root -p
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.1

sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
sudo 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-intl
sudo cp /etc/php.ini /etc/php.ini.bak
sudo sed -i 's#;date.timezone =#date.timezone = Europe/Berlin#' /etc/php.ini

Update Firewall Rules

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload

Step 2: Prepare the MantisBT Source Files

Start by downloading and extracting the MantisBT installation package.

cd
wget https://downloads.sourceforge.net/project/mantisbt/mantis-stable/2.5.1/mantisbt-2.5.1.zip
sudo yum install -y unzip
unzip mantisbt-2.5.1.zip

Next, relocate the extracted files to the appropriate web directory and set the correct ownership permissions.

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

Step 3: Configure Apache Virtual Host for MantisBT

To properly launch MantisBT, a dedicated Apache virtual host must be created. Paste the configuration block below into your terminal.

Important: Update ServerAdmin, ServerName, and ServerAlias with the correct values for your server setup.

After saving the configuration, restart Apache to apply the changes.

sudo systemctl restart httpd.service

Step 4: Complete the MantisBT Setup Using the Web Installer

Launch your browser and access your server’s IP address. You will be directed to the MantisBT web installer interface.

In the Checking Installation step, ensure that all checks return GOOD statuses.

Under Installation Options, enter the following MariaDB database details while leaving all other settings at their defaults. Click the Install/Upgrade Database button to proceed.

  • Username: mantisbtuser
  • Password: yourpassword
  • Database name: mantisbt

After installation completes, click on the Continue link at the bottom to finalize and proceed to the login page.

Use the default credentials to sign in:

  • Username: administrator
  • Password: root

Security Warning: Immediately change the default password after the first login to secure your installation.

Once you’ve confirmed that MantisBT is functioning correctly, remove the installation directory to protect against unauthorized access.

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

Optional configurations can be made by modifying the following file:

/var/www/html/mantisbt/config/config_inc.php

Conclusion

By following this step-by-step process, you’ve successfully deployed MantisBT on a CentOS 7 server using a LAMP stack. The guide covered setting up the core environment, configuring database credentials, securing the installation, and launching the application through a web interface. After completing the installation, it’s crucial to delete the administrative setup directory and change default credentials to enhance security. You can now manage software development issues efficiently using a robust and user-friendly tracking system powered by MantisBT.

Source: vultr.com

Create a Free Account

Register now and get access to our Cloud Services.

Posts you might be interested in:

Moderne Hosting Services mit Cloud Server, Managed Server und skalierbarem Cloud Hosting für professionelle IT-Infrastrukturen

Secure HTTPS Setup on Arch Linux with Apache or Nginx

Security, Tutorial

Linux file permissions with this comprehensive guide. Understand how to utilize chmod and chown commands to assign appropriate access rights, and gain insights into special permission bits like SUID, SGID, and the sticky bit to enhance your system’s security framework.