yum install httpd -y //安装httpd
systemctl start httpd //启动httpd
systemctl enable httpd //配置自启动

httpd默认是80端口,如果做事器80端口被占用,可以通过修正/etc/httpd/conf/httpd.conf文件改变httpd的端口。
vim /etc/httpd/conf/httpd.conf --> Listen 9900
二、安装php首先检讨做事器环境是否安装php,Mantis哀求php版今年夜于5.5,演示环境php选择7.1版本。
1、准备事情
安装EPEL repo,否则会在实行第二步时报出非常error: Failed dependencies:epel-release >= 7 is needed by webtatic-release-7-3.noarch。
yum -y install epel-release
2、默认情形下,PHP 7在CentOS存储库中不可用,须要首先安装Webtatic存储库。
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
3、安装php7.1
yum install php71w php71w-cli php71w-mysqli php71w-mbstring -y
三、下载并解压Mantiswget https://excellmedia.dl.sourceforge.net/project/mantisbt/mantis-stable/2.4.0/mantisbt-2.4.0.zip
unzip mantisbt-2.4.0.zip
mv mantisbt-2.4.0 /var/www/html/mantis
systemctl restart httpd //重启httpd
实行完上述命令,重启httpd,然后在浏览器中访问http://xx.xx.xx.xx:9900/mantis,会涌现如下界面,填写数据库干系信息(Hostname、Username、Password、Database name),点击【Install/Upgrade Database】初始化数据库。
四、配置Mantis
数据库初始化完毕后,须要根据之前数据库干系信息配置mantis的数据库。
cd /var/www/html/mantis/config
rm -rf config_inc.php
cp config_inc.php.sample config_inc.php
vim config_inc.php
详细配置信息如下:
# --- Database Configuration ---$g_hostname = 'xx.xx.xx.xx:3306';$g_db_username = 'root';$g_db_password = '123456';$g_database_name = 'mantis';$g_db_type = 'mysqli'; # --- Security ---$g_crypto_master_salt = '1qaz2wsx3edc4rfv';# Random string of at least 16 chars, unique to the installation # --- Anonymous Access / Signup ---$g_allow_signup= ON;$g_allow_anonymous_login= OFF;#$g_anonymous_account= ''; # --- Email Configuration ---$g_phpMailer_method= PHPMAILER_METHOD_MAIL; # or PHPMAILER_METHOD_SMTP, PHPMAILER_METHOD_SENDMAIL$g_smtp_host= 'localhost';# used with PHPMAILER_METHOD_SMTP$g_smtp_username= '';# used with PHPMAILER_METHOD_SMTP$g_smtp_password= '';# used with PHPMAILER_METHOD_SMTP$g_webmaster_email = 'webmaster@example.com';$g_from_email = 'noreply@example.com';# the \"大众From: \"大众 field in emails$g_return_path_email = 'admin@example.com';# the return address for bounced mail # --- Attachments / File Uploads ---$g_allow_file_upload= ON;$g_file_upload_method= DISK;$g_absolute_path_default_upload_folder = '/var/www/html/mantis/upload/'; # used with DISK, must contain trailing \ or /.$g_max_file_size= 5000000;# in bytes # --- Others ---$g_default_language = 'chinese_simplified';