CentOS7 安装 Mantis

一、安装apache、mariadb:
1、准备工作:
安装EPEL repo并用最新的稳定版本更新系统。
yum install epel-release -y
yum update -y
2、安装apache httpd:
yum install httpd -y //安装httpd
systemctl start httpd //启动httpd
systemctl enable httpd //配置自启动

3、安装mariadb server:
    yum install mariadb mariadb-server mariadb-devel -y
    systemctl start mariadb
 systemctl enable mariadb

二、安装php7.1
1、Mantis支持PHP大于5.5,这里我们将安装PHP版本7。默认情况下,PHP 7在CentOS存储库中不可用,需要首先安装Webtatic存储库:
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
2、安装php7.1:
yum install php71w php71w-cli php71w-mysqli php71w-mbstring -y
3、安装后验证php:
php -v

三、配置mariadb
1、初始化:mysql_secure_installation

    首先是设置密码,会提示先输入密码

        Enter current password for root (enter for none):<–初次运行直接回车

    设置密码

        Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
        New password: <– 设置root用户的密码
        Re-enter new password: <– 再输入一次你设置的密码

    其他配置

        Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车

        Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车,

        Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车

        Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车

    初始化MariaDB完成,接下来测试登录:mysql -uroot -p

2、创建mantis数据库和用户:

	CREATE DATABASE mantisdb;
	CREATE USER 'mantis'@'localhost' IDENTIFIED BY 'yourpassword';
	GRANT ALL PRIVILEGES ON testlink.* TO 'mantis'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
	FLUSH PRIVILEGES;
	EXIT;

四、配置mantis

  1、下载Mantis:*
    wget https://excellmedia.dl.sourceforge.net/project/mantisbt/mantis-stable/2.4.0/mantisbt-2.4.0.zip  
 2、解压并移动:**
    unzip mantisbt-2.4.0.zip
  mv mantisbt-2.4.0 /var/www/html/mantis
3、重启httpd**
4、浏览:http://your ip:port/mantis**

按照实际情况输入hostname,databasename(即第3步里面的mantis),username(即第3步里面的user),password(即第3步里面的password)。其中数据库类型可以选择Mysqli。

在这里插入图片描述
填写好这些内容,点击install/update database即可。
5、配置mantis:
#cd /var/www/html/mantis/config
#rm -rf config_inc.php
#cp config_inc.php.sample config_inc.php
#vim config_inc.php
主要的配置如下:

$g_hostname = ‘localhost’;
$g_db_username = ‘mantis’;
g d b p a s s w o r d = ′ 3 e d c g_db_password = &#x27;3edc gdbpassword=3edcRFV’;
$g_database_name = ‘mantisdb’;
$g_db_type = ‘mysqli’;

— Security —

$g_crypto_master_salt = ‘n3ZjoEXpRhws7Ba/PeX+g+0dDjFJTRvXTWJpIo9EtHo=’; # 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_SMTP; # or PHPMAILER_METHOD_SMTP, PHPMAILER_METHOD_SENDMAIL
$g_smtp_host = ‘smtp.office365.com:587’; # used with PHPMAILER_METHOD_SMTP
$g_smtp_username = ‘user name’; # @前的用户名
$g_smtp_password = 'password; # 邮箱密码
$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 = DATABASE; # or DISK
$g_absolute_path_default_upload_folder = ‘/var/www/html/mantis/upload’; # used with DISK, must contain trailing \ or /.
$g_max_file_size = 5010241024; # in bytes
$g_preview_attachments_inline_max_size = 2000000;
$g_preview_max_width = 900;
$g_preview_max_height = 800;

如果安装完毕登陆的时候出现如下类似如下错误:
$g_crypto_master_salt is not specified correctly in config_inc.php or is shorter than 16 characters long.
需要在点击完 ‘install/updrage’ 按钮之后的界面找到类似“n3ZjoEXpRhws7Ba/PeX+g+0dDjFJTRvXTWJpIo9EtHo=”的字码,在config_inc.php文件中将其赋值给g_crypto_master_salt

安装完毕之后删除admin目录并重启httpd.
至此,配置Mantis完毕。

补充说明:
为了不与其他访问冲突,可以创建Apache 虚拟host来进行访问:
cat <<EOF | sudo tee -a /etc/httpd/conf.d/mantis.conf
<VirtualHost *:80>
ServerAdmin root@localhost
DocumentRoot /var/www/html/mantis/
ServerName mantis.com
ServerAlias www.mantis.com
<Directory /var/www/html/mantis/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all

ErrorLog /var/log/httpd/mantis.example.com-error_log
CustomLog /var/log/httpd/mantis.example.com-access_log common

EOF

在终端添加地址解析:
IP_address mantis.com
输入 http://mantis.com 访问。
Mantis默认账号密码为 administrator/root

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值