需求:
在ubuntu 18.04上安装mantis bug tracker
Mantisbt: 是一款基于Web的开源漏洞跟踪系统,采用PHP开发,并且支持多种数据库后端,包括MySQL,MS SQL和PostgreSQL,还支持apache / nginx web server.
1 安装apache/ php/ mysql
Mantis要求电脑上已安装apache2/ mysql。
运行以下命令安装apache2
sudo apt update
sudo apt install wget php php-cli php-fpm php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath
然后安装Apache2 Web Server:
sudo apt -y install apache2
Apache2监听的端口默认是80,需要修改为8050
/etc/apache2/ports.conf
sudo systemctl stop apache2
修改/etc/apache2/sites-available/000-default.conf为:
# cat /etc/apache2/sites-available/000-default.conf
<VirtualHost *:8050>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/mantisbt
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
ServerName bt.example.com
ServerAlias www.bt.example.com
<Directory "/var/www/html/mantisbt/">
DirectoryIndex index.php index.html
Options FollowSymLinks
AllowOverride None
Require all granted
Options MultiViews FollowSymlinks
</Directory>
</VirtualHost>
sudo systemctl restart apache2
netstat -lnp|grep 8050
查询端口号占用情况
2 安装mysql
https://www.cnblogs.com/woshimrf/p/ubuntu-install-mysql.html
登录MariaDB shell:
$ mysql -u root -p
为MantisBT创建数据库和用户:
CREATE USER 'mantisbt'@'localhost' IDENTIFIED BY 'StrongPassword';
CREATE DATABASE mantisbt;
GRANT ALL PRIVILEGES ON mantisbt.* TO 'mantisbt'@'localhost';
FLUSH PRIVILEGES;
QUIT
3 安装mantisbt
将mantisbt-2.19.0.zip 解压到/var/www/html/mantisbt目录下
打开本机上的浏览器,访问安装mantis的页面
http://127.0.0.1:8050
等一会就会提示安装成功。
安装成功后,再次访问http://127.0.0.1:8050 ,会出现登录页面。初始的用户名为administrator,初始密码:root,修改为ice1234
公司里使用的是腾讯企业邮箱。需要修改下面的2个配置文件来设置邮箱。
修改 /var/www/html/mantisbt/config/config_inc.php
$g_enable_email_notification=ON;
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'smtp.exmail.qq.com';
$g_smtp_username = '本人邮箱';
$g_smtp_password = '三方授权密码';
$g_webmaster_email = '本人邮箱';
$g_from_email = '本人邮箱';
$g_return_path_email = '本人邮箱';
$g_smtp_port = 25;
$g_administrator_email ='本人邮箱';
# $g_from_name = 'Mantis Bug Tracker';
# $g_email_receive_own = OFF;
# $g_email_send_using_cronjob = OFF;
/var/www/html/mantisbt/config_defaults_inc.php
$g_administrator_email ='本人邮箱';
$g_webmaster_email ='本人邮箱';
$g_from_email ='本人邮箱';
$g_return_path_email ='本人邮箱';
$g_enable_email_notification = ON;
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host ='本人邮箱';
$g_smtp_username='本人邮箱';
$g_smtp_password= '三方授权密码';
$g_smtp_port= 25;
配置完成后,可以点击用户管理,创建新用户。再点击重设密码按钮,可以发送邮件,用来重设密码。
如果遇到问题,可以查看log来定位问题。
查看/var/log/apache2/error.log
参考网页:
安装
https://ywnz.com/linuxyffq/4134.html
https://blog.csdn.net/gs344937933/article/details/61203977
发邮件
http://www.mantis.org.cn/383.html