2014年8月13日 星期三

[研究] Mantis Bug Tracker 1.2.17 螳螂除錯管理追蹤工具安裝 (CentOS 7.0 x86_64)(失敗)

[研究] Mantis Bug Tracker 1.2.17 螳螂除錯管理追蹤工具安裝 (CentOS 7.0 x86_64)(失敗)

2014-08-13

Mantis 是螳螂的意思,Bug 是程式的臭蟲,Tracker 是追蹤,所以這是一套除錯管理追蹤工具。

官方網站
http://www.mantisbt.org/

下載
http://sourceforge.net/projects/mantisbt/files/mantis-stable/1.2.17/mantisbt-1.2.17.tar.gz/download

注意,CentOS 7.0 開始預設資料庫不是 MySQL,而是 MariaDB
service  [服務名稱]  [命令]  會重導到   systemctl   [命令]   [服務名稱]

安裝

# 基本安裝
#yum -y install httpd php php-pdo php-mysql php-gd mysql mysql-server php-mbstring
yum -y install httpd php php-pdo php-mysql php-gd mysql  mariadb-server php-mbstring
chkconfig httpd on
#chkconfig mysqld on 
systemctl  enable mariadb 
service mysqld restart
systemctl status mariadb 
service httpd restart
systemctl status httpd 

# 設定時區(一定要設定),重新啟動 httpd

/etc/php.ini
找到 ;date.timezone =
下面增加一行
date.timezone = "Asia/Taipei"
重新啟動 httpd 讓設定生效
service httpd restart


sed -i 's/;date\.timezone =/date.timezone = Asia\/Taipei/' /etc/php.ini
cat /etc/php.ini | grep date.timezone
service httpd restart


# 下載解壓 mantis

wget  http://sourceforge.net/projects/mantisbt/files/mantis-stable/1.2.17/mantisbt-1.2.17.tar.gz/download  -O  mantisbt-1.2.17.tar.gz

tar xzvf mantisbt-1.2.17.tar.gz  -C  /var/www/html
mv  /var/www/html/mantisbt-1.2.17  /var/www/html/mantis
chown -R apache:apache /var/www/html/mantis

# 設定 MariaDB 的 root 密碼 (除 root 帳號的密碼要輸入,其他都按下 Enter,使用預設值)

[root@localhost ~]# /usr/bin/mysql_secure_installation

/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): (按下 Enter)
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]
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]
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost ~]#


# 建立 Mantis 系統使用的資料庫,稱為 mantis,連線帳號 mantisuser,密碼 123456

[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 5.5.37-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database mantis;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on mantis.* to mantisuser@localhost identified by '123456';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye
[root@localhost ~]#


或 (假設 MySQL 資料庫 root 帳號密碼為 DEFG )
mysql -e "create database mantis; "  -pDEFG
mysql -e "rant all privileges on mantis.* to mantisuser@localhost identified by '123456'; "  -pDEFG
mysql -e "flush privileges; "   -pDEFG


# 設定 Mantis

在瀏覽器裡輸入http://ip/mantis,此時瀏覽器會跳轉到http://ip/mantis/admin/install.php

(下圖)






安裝程式無法支援 MariaDB,安裝失敗。

(待研究)

[研究] Mantis Bug Tracker 1.2.17 螳螂除錯管理追蹤工具安裝 (CentOS 7.0 x86_64)
[研究] Mantis Bug Tracker 1.2.15 安裝 (CentOS 6.4 x64)

沒有留言:

張貼留言