如何在 CentOS 7 上安装 Mantis Bug Tracker

在本教程中,我们将向您展示如何在您的 CentOS 7 服务器上安装 Mantis Bug Tracker。 对于那些不知道的人,Mantis 是一个免费且流行的开源错误跟踪系统。 它是用 PHP 编写的,支持所有类型的数据库服务器。 它提供了一个专业的仪表板来管理分配给用户的错误。 它支持强大的访问控制,提供每个项目基础用户访问。 它非常灵活,您可以自定义问题字段、通知和工作流程。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将网站托管在自己的 VPS 上。 安装非常简单,假设您在 root 帐户下运行,如果不是,您可能需要添加 ‘sudo‘ 到命令以获取 root 权限。 我将向您展示在 CentOS 7 服务器上逐步安装 Mantis Bug Tracker。

在 CentOS 7 上安装 Mantis Bug Tracker

第 1 步。首先,让我们首先确保您的系统是最新的。

yum clean all yum -y update

步骤 2. 安装 LAMP 服务器。

需要 CentOS 7 LAMP 堆栈服务器。 如果您没有安装 LAMP,您可以在此处按照我们的指南进行操作。 此外,安装所需的 PHP 模块:

yum -y install php-gd php-imap php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp curl curl-devel

步骤 3. 安装 Mantis Bug Tracker。

首先要做的就是去 Mantis Bug Tracker 的下载页面 并下载最新的稳定版 Mantis,在撰写本文时它是 2.5.0 版:

wget https://ncu.dl.sourceforge.net/project/mantisbt/mantis-stable/2.5.0/mantisbt-2.5.0.zip

将 Nextcloud 存档解压缩到服务器上的文档根目录:

tar -xpf mantisbt-2.5.0.tar.gz mv mantisbt-2.4.1 /var/www/html/mantis

我们将需要更改一些文件夹权限:

chown apache:apache -R /var/www/html/mantis/

步骤 4. 为 Mantis Bug Tracker 配置 MariaDB。

默认情况下,MariaDB 未加固。 您可以使用 mysql_secure_installation 脚本。 您应该仔细阅读下面的每个步骤,这些步骤将设置 root 密码、删除匿名用户、禁止远程 root 登录以及删除测试数据库和访问安全 MariaDB。

mysql_secure_installation

像这样配置它:

- Set root password? [Y/n] y - 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

接下来,我们需要登录 MariaDB 控制台并为 Mantis Bug Tracker 创建一个数据库。 运行以下命令:

mysql -u root -p

这将提示您输入密码,因此输入您的 MariaDB 根密码并点击 Enter. 登录到数据库服务器后,您需要为 Mantis Bug Tracker 安装创建一个数据库:

MariaDB [(none)]> CREATE DATABASE mantisdb; MariaDB [(none)]> GRANT ALL PRIVILEGES ON mantisdb.* TO 'mantis'@'localhost' IDENTIFIED BY 'mantispassword'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> q

步骤 5. 配置 Apache Mantis Bug Tracker 的网络服务器。

我们将创建一个 Apache Nextcloud 网站的虚拟主机。 首先,创建’/etc/httpd/conf.d/vhosts.conf‘ 使用您选择的文本编辑器创建文件:

nano /etc/httpd/conf.d/vhosts.conf IncludeOptional vhosts.d/*.conf

接下来,创建虚拟主机:

mkdir /etc/httpd/vhosts.d/ nano /etc/httpd/vhosts.d/yourdomain.com.conf

添加以下行:

<VirtualHost YOUR_SERVER_IP:80> ServerAdmin [email protected] DocumentRoot "/var/www/html/mantis/" ServerName yourdomain.com ServerAlias www.yourdomain.com ErrorLog "/var/log/httpd/yourdomain.com-error_log" CustomLog "/var/log/httpd/yourdomain.com-access_log" combined  <Directory "/var/www/html/mantis/"> DirectoryIndex index.html index.php Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>

Save 和 close 文件。 重新启动 apache 服务以使更改生效:

systemctl restart httpd.service systemctl enable httpd.service

步骤 6. 访问 Mantis Bug Tracker。

Mantis Bug Tracker 默认在 HTTP 端口 80 上可用。 打开您喜欢的浏览器并导航到 https://your-domain.com/mantis/admin/install.php 或者 https://server-ip/mantis/admin/install.php 并完成所需的步骤以完成安装。 如果您使用防火墙,请打开端口 80 以启用对控制面板的访问。

恭喜! 您已成功安装 Mantis。 感谢您使用本教程在您的 CentOS 7 系统上安装 Mantis 的免费开源错误跟踪系统。 如需更多帮助或有用信息,我们建议您查看 Mantis Bug Tracker 官方网站.

Save