Tutorials  /  Linux Basics

Install MantisBT on CentOS 7 with LAMP Stack Step-by-Step

Ccentron Redaktion · April 2025 ·4 min read ·Linux Basics, Tutorial

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
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

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

Console
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

Console
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

Console
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.

Code
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

Console
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

Console
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.

Console
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.

Console
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.

Code
cat <

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

Console
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.

Console
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.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren