想弄個bug系統,找了好多款,發現沒幾個比較合適自身水平的
搭建的簡易版本的、僅供參考
一、搭建環境
Centos7.2
Mantisbt2.8
Nginx阿里雲版本
Mariadb阿里雲版本
PHP5.6(阿里雲yum源只有5.4版本)
阿里的yum
參考網頁:
基礎 http://rexchow.blog.51cto.com/11619161/1885533
PHP 更新:http://blog.csdn.net/zhaozuosui/article/details/48394409
Mantisbt 設置問題
1、郵箱設置:http://www.cnblogs.com/jinxiudaxin/articles/5233840.html
2、權限設置:
二、搭建LNMP
1、Web
yum group install Development Tools
#安裝開發工具,GCC...
yum install mariadb mariadb-server php php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt -y
#安裝apache mariadb php以及各種運行庫和工具
setenforce 0
#關閉selinux
systemctl stop firewalld
#關閉防火牆嘛
#安裝nginx
yum install nginx -y
提供測試頁(由於原來直接裝的apache,所以這裏就不提供測試了)大家仔細設置好nginx的root路徑,可以測試php
1 2 3 4 5 | [root@localhost ~] # vim /var/www/html/index.php [root@localhost ~] # cat /var/www/html/index.php <?php phpinfo(); ?> |
#安裝後修改配置文件
cd /etc/nginx
mv nginx.conf.default nginx.conf
#我使用的目錄是/var/mantis/mantisbt-2.8.0/
#要注意下面兩個路徑
fastcgi_param root /var/mantis/mantisbt-2.8.0;
#大家可以根據自己的目錄所決定
#nginx.conf配置內容
[root@www nginx]# cat nginx.conf #user root; worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name www.rex.com; location / { root /var/mantis/mantisbt-2.8.0; index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/mantis/mantisbt-2.8.0$fastcgi_script_name; include fastcgi_params; } } }
給mantis添加權限
chmod -R 775 /var/mantis
2、Mariadb
網上許多教程都是使用mysql
由於版本的問題,還是使用有開源協議的mariadb,使用方法與mysql一樣
上面的yum已經一次性安裝了
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf #拷貝配置文件(注意:如果/etc目錄下面默認有一個my.cnf,直接覆蓋即可)
接下來進行MariaDB的相關簡單配置
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 -ppassword
完成。
建表操作
mysqladmin -uroot password 123456 mysql>create database mantis character set utf8; mysql>grant all privileges on mantis.* to mantis@localhost identified by ‘654321‘; mysql> flush privileges;
3、php
以下是CentOS 7.0的源。
1 2 | # yum install epel-release # rpm -ivh http: //rpms.famillecollet.com/enterprise/remi-release-7.rpm |
使用yum list命令查看可安裝的包(Packege)。
1 | # yum list --enablerepo=remi --enablerepo=remi-php56 | grep php |
安裝PHP5.6.x
yum源配置好了,下一步就安裝PHP5.6。
1 | # yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof |
安裝PHP-fpm
yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm
可以使用php -v
查看php 版本
4、啓動服務
由於寫的時候,是能正常使用的,所以中間就忽略啓動服務器
service start mariadb && service start php-fpm && service start nginx #或者使用 systemctl mariadb start && systemctl php-fpm start && systemctl nginx start
5、啓動mantis
http://192.168.1.202/admin/install.php
這是我內網的ip,所以大家把ip換成自己的就可以了
根據提示輸入庫名mantis,庫管理員賬號密碼,及數據的鏈接模式即可pass
6、使用mantis
估計使用的時候會出現error 2800
可以修改
/var/mantis/mantisbt-2.8.0/config_defaults_inc.php
的文件。300行位置,在ON改成OFF即可
$g_form_security_validation = OFF;
郵件設置參考http://www.cnblogs.com/jinxiudaxin/articles/5233840.html