美文网首页
CentOS7下安装mantis

CentOS7下安装mantis

作者: Toplhyi | 来源:发表于2019-06-29 12:34 被阅读0次

一. LAMP环境准备

  1. Linux CentOS 7
  2. Apache

安装apache httpd:

yum install httpd -y 
// 启动httpd
systemctl start httpd

httpd默认是80端口,可以通过修改/etc/httpd/conf/httpd.conf文件改变httpd的端口。

vi /etc/httpd/conf/httpd.conf
Listene 9000 

访问http://ip:port,出现以下页面则安装成功

apache
  1. Mysql
  • 首先获取mysql源
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
  • 安装rpm包
rpm -ivh mysql-community-release-el7-5.noarch.rpm
  • 安装mysql
yum install mysql-community-server
  • 启动mysql
systemctl start mysqld //启动
systemctl restart mysqld  //重启
systemctl stop mysqld //停止
  • 修改mysql密码
set password for 'root'@'localhost' =password('root123');
  • 开放远程连接的权限
grant all privileges on *.* to root@'%' identified by 'root123' with grant option;
flush privileges;

创建数据库和用户

create database mantis_db default character set utf8 collate utf8_general_ci;
create user 'mantis'@'%' identified by 'mantis123';
grant all on mantis_db.* to mantis@'%';
grant all privileges on *.* to 'mantis'@'localhost' identified by 'mantis123' with grant option;
  1. PHP

默认情况下,PHP 7在CentOS存储库中不可用,所以先来获取PHP7的yum源。

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

ps:第一次安装没问题,第二次在另一台机器上安装,报错如下:

error: Failed dependencies:
    epel-release >= 7 is needed by webtatic-release-7-3.noarch

需要安装epel-release。

yum -y install epel-release 

然后安装PHP7.1

yum install php71w php71w-cli php71w-mysqli php71w-mbstring -y

通过php -v确认是否安装成功

php -v

二. Mantis安装与配置

// 将下载的包解压
tar xvf mantisbt-2.21.1.tar.gz
// 移动到apache的部署目录
mv mantisbt-2.21.1 /var/www/html/mantis
//重启httpd
systemctl restart httpd  

浏览器访问http://ip:port/mantis,出现以下页面,输入Hostname、Username、Password、Database name,点击【Install/Upgrade Database】初始化数据库。

install/upgrade database

按照提示继续进行即可。


image.png

访问http://ip:port/mantis即可看到登录页面。默认管理员是administrator/root。

登录页面
  • 为了安全起见,使用rm -rf admin/删除mantis下的admin目录。
  • 禁止默认 'administrator' 帐号或修改其密码。

ps:创建用户后,发现不知道初始密码是多少,重设密码还要发送邮件可以通过以下设置来修改:

// 在/var/www/html/mantis/config/config_inc.php文件中添加:
$g_enable_email_notification = OFF;
// 此时重置密码后密码为空
// 另外,在config_defaults_inc.php文件中修改:
$g_send_reset_password = OFF;
// 此时在新建用户页面会出现密码输入框,就可以自定义密码了

相关文章

网友评论

      本文标题:CentOS7下安装mantis

      本文链接:https://www.haomeiwen.com/subject/zrmycctx.html