1.Mantis Bug tracker简介
Mantis是一个基于PHP技术的轻量级的开源缺陷跟踪系统,以Web操作的形式提供项目管理及缺陷跟踪服务。在功能上、实用性上足以满足中小型项目的管理及跟踪。更重要的是其开源,不需要负担任何费用。
安装mantisBT2.13系统要求
2. 安装/检查centos7
检查系统版本
# cat /etc/*release*; cat /proc/version
CentOS在最小化安装时,没有安装自动补全的包,需要手动安装。
# yum -y install bash-completion
3. 安装apache
Apache是世界使用排名第一的Web服务器软件。它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一。
3.1. 安装apache,并检查安装状态
# yum install -y httpd; rpm -qa |grep httpd
3.2. 启动apache,并检查启动状态
# systemctl start httpd;systemctl status httpd
3.3. 关闭防火墙
浏览器要访问apache测试页面,还需防火墙对apache打开80端口。
# firewall-cmd –state;firewall-cmd –list-all# firewall-cmd –zone=public –add-port=80/tcp –permanent;systemctl restart firewalld.service;firewall-cmd –list-all
3.4. 检查apache测试页面
在浏览器中输入;http://服务器主机IP/
Apache安装完成。
4. 安装MariaDB 数据库
# yum install -y mariadb mariadb-server; rpm -qa |grep mariadb
启动数据库,检查数据库状态
# systemctl start mariadb; systemctl status mariadb
5. 安装PHP
MantisBT需要安装Php5.5以上版本,我这里安装PHP7,默认centos7中没有PHP7的安装源,需要安装一下源
# yum install -y epel-release# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm# yum install -y php71w php71w-mysqli php71w-cli php71w-mbstring# rpm -qa |grep php
重启httpd服务
# systemctl restart httpd
6. 配置mantis
6.1. 设置数据库root密码
# mysql_secure_installation
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Remove anonymous users? Y
Success.
Disallow root login remotely? Y
Success.
Remove test database and access to it? Y
– Dropping test database…
Success.
– Removing privileges on test database…
Success.
Reload privilege tables now? Y
Success.
All done!
All done! If you’ve completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
6.2. 创建mantis数据库
# mysql -u root -p
MariaDB [(none)]>CREATEDATABASE mantisbt;
MariaDB [(none)]>GRANTALLPRIVILEGESON mantisbt.*TO ‘root’@’localhost’ IDENTIFIED BY'password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]>EXIT;
7. 下载并安装配置mantis
# wget https://jaist.dl.sourceforge.net/project/mantisbt/mantis-stable/2.18.0/mantisbt-2.18.0.zip# unzip mantisbt-2.18.0.zip# mv mantisbt-2.18.1 /var/www/html/mantis# chown -R apache:apache /var/www/html/mantis/
关闭访问控制模块
# setenforce 0; getenforce
7.1. 打开web浏览器登陆
7.2. mantis安装配置
# cd /var/www/html/mantis/config/# cp config_inc.php.sample config_inc.php# vi config_inc.php$g_hostname = 'localhost';$g_db_type = 'mysqli';$g_database_name = 'mantis_db';$g_db_username = 'mantisusr';$g_db_password = 'Usr_strong_password1!';$g_default_timezone = 'UTC';$g_crypto_master_salt = 'AD00pe4/rKaC9AKk7lPEddjqJ0RmAsWU2YjTYUK8JXA=';
7.3. 登录管理员账户
用户名密码分别是:administrator和root。
登陆后建议修改密码和邮箱
7.4. 登录页去除注册功能(如有需要)
mantis根目录下找到文件login_page.php,打开后拉到最后,删除下图所示的一段代码:
<?phpif($t_show_anonymous_login||$t_show_signup){echo'<div class="toolbar center">';if($t_show_anonymous_login){echo'<a class="back-to-login-link pull-right" href="login_anon.php?return='.string_url($f_return).'">'.lang_get('login_anonymously').'</a>';}if($t_show_signup){echo'<a class="back-to-login-link pull-left" href="signup_page.php">',lang_get('signup_link'),'</a>';}echo'<div class="clearfix"></div>';echo'</div>';}?>
保存上传后登录页的注册链接就没有了,如下图所示:
7.5. 邮箱配置
修改 MantisBT/config/config_inc.php 文件
$g_enable_email_notification=ON;$g_administrator_email='[email protected]';# 邮箱地址$g_webmaster_email='[email protected]';# 邮箱地址$g_from_email='[email protected]';# 邮箱地址$g_from_name='MantisBT Bug Tracker';$g_phpMailer_method=PHPMAILER_METHOD_SMTP;$g_smtp_host='smtp.mxhichina.com';# SMTP 服务器(端口号465)$g_smtp_username='[email protected]';# 邮箱地址$g_smtp_password='Pass@word1';# 邮箱密码$g_use_phpMailer=ON;$g_return_path_email='[email protected]';# 邮箱地址$g_default_language='chinese_simplified';$g_fallback_language='chinese_simplified';
7.6. 其他设置
# vim config_defaults_inc.php$g_show_realname = OFF;#显示姓名$g_reauthentication = OFF;#有时候点击标签时候会出现如下提示:“您正在访问一个安全页面,并且您的安全会话已过期。要继续操作请输入您的认证信息。”
安装完成!
版权归原作者 雏夏 所有, 如有侵权,请联系我们删除。