歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu下TestLink與RedMine連接部署說明

Ubuntu下TestLink與RedMine連接部署說明

日期:2017/2/28 16:06:55   编辑:Linux教程
網上也不少有關TestLink與RedMine連接部署的文章,但是都寫的不夠詳盡,包括群英會也是略帶而過,在此,結合大家的文章,詳細的寫一篇,供大家交流學習。

前期准備

在進行本文檔操作前,需要完成如下前期步驟:

1. RedMine部署完畢;

備注:RedMine部署在Ubuntu+Mysql環境下

Ubuntu Release: 10.04

Mysql版本:5.1.41-3ubuntu12

2. TestLink安裝完畢。

備注:部署系統中TestLink的Release需為1.8.0後版本。

測試系統部署在Apache+Mysql集成環境,www.linuxidc.com 實際過程中可以根據具體需求變更。

部署概要

1. 關閉Ubuntu防火牆;

2. 登錄RedMine服務器,設置Mysql遠程連接賬戶;

3. 登錄TestLink服務器,測試第1步中的Mysql數據庫遠程連接;

4. 登錄TestLink服務器,設置配置文件;

配置文件包括:

? custom_config.inc.php(TestLink根目錄下)

? redmine.cfg.php (在cfg目錄下)

5. 重起Apache服務器,登錄TestLink測試與RedMine的連通性。

部署步驟

Ubuntu防火牆

1. 由於TestLink需連接RedMine的數據庫,因此登錄Ubuntu系統,打開Mysql的3306端口。局域網中可以將Ubuntu防火牆關閉。關閉防火牆命令如下:

sudo ufw disable

設置Mysql遠程連接賬戶

1. 登錄Ubuntu系統(RedMine與MySql均部署在Ubuntu下)。

2. 登入MySql數據庫。

root@redmine:~# mysql -u root –p

Enter password:

3. 數據庫切換(進入mysql數據庫)。

mysql>use mysql;

4. 創建遠程賬戶。

mysql> GRANT ALL PRIVILEGES ON new_user.* TO remote@"%" IDENTIFIED BY "new_user_password"

說明:其中new_user為遠程登錄用戶名,new_user_password為遠程登錄用戶密碼。其中”%”說明對允許那台主機能夠遠程連接RedMine服務器的數據庫。

以上信息在部署過程中,根據實際情況進行設置,本文檔部署過程中,www.linuxidc.com 遠程登錄用戶名為設為remote,所有主機均可連接至RedMine服務器的數據庫。

5. mysql 的配置文件/etc/mysql/my.cnf。

root@redmine sudo vi /etc/mysql/my.cnf

在舊版本中找到 skip-networking,把它注釋掉就可以了
#skip-networking

在新版本中:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1

bind-address = 127.0.0.1 這一行要注釋掉
#bind-address = 127.0.0.1

或者把允許訪問的 ip 填上
#bind-address = 10.7.1.88

然後重啟 MySQL
root@redmine sudo /etc/init.d/mysql restart
* Starting MySQL database server mysqld
...done.
* Checking for corrupt, not cleanly closed and upgrade needing tables.
andy@ubuntu:~$ sudo /etc/init.d/mysql start
* Starting MySQL database server mysqld
...done.

遠程登錄賬戶驗證

遠程登錄賬戶驗證,有兩種方式。

方式1

1. 登錄TestLink服務器,進入MySql安裝目錄bin目錄下。

C:\xampp\mysql\bin>mysql -h 10.7.1.88 -u root -p

Enter password: *******

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 377

Server version: 5.1.41-3ubuntu12 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

出現mysql>標示測試通過。

方式2

通過編寫test.php頁面,測試連通性。

<?

$link=mysql_connect('10.7.1.88','remote','******');

if(!$link){

echo "fail";

}

else{

echo "success";

}

mysql_close();

?>

說明:其中'10.7.1.88'為RedMine服務器MySql數據庫的IP地址,'remote','******'為遠程登錄賬號及密碼。

將test.php放在xampp根目錄下,通過http://localhost/test.php進行測試,如通過,則會出現success。

備注:如出現10061錯誤,是無法連接至數據庫的提示信息。

Copyright © Linux教程網 All Rights Reserved