Ubuntu下TestLink与RedMine连接部署说明


网上也不少有关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.bkjia.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.bkjia.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错误,是无法连接至数据库的提示信息。

  • 1
  • 2
  • 下一页

相关内容