Mantis是一個基於PHP技術的輕量級的開源缺陷跟蹤系統,以Web操作的形式提供項目管理及缺陷跟蹤服務。由於其安裝簡單、使用方面,備受廣大開發和測試人員青睞。下面主要講解下Mantis再CentOS7上的安裝配置過程。
一、安裝apache
安裝apache httpd:
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
三、下載並解壓Mantis
wget 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 = '[email protected]';
$g_from_email = '[email protected]'; # the "From: " field in emails
$g_return_path_email = '[email protected]'; # 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';