花了半天的时间终于搭建好了完整的Testlink环境,主要包括Mysql以及PHP的版本、未关闭防火墙、以及安装配置过程中遇到的一些问题。以下是详细的搭建过程。

一、工具准备

        以下是我在搭建过程中用到的工具版本:

  1.Testlink ----testlink-1.9.17

         2.MariaDB---MariaDB 10.3(testlink要求5.6以上的版本才能支持)

    3.PHP----PHP 5.6(testlink对PHP的最低版本要求是>=5.5)

    4.Linux---Centos 7.3

二、Apache的安装

        1.安装



yum install httpd



   2.配置



sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf
sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" \
/etc/httpd/conf/httpd.conf



  3.启动Apache服务



systemctl start httpd.service
systemctl enable httpd.service



 三、MariaDB的安装

      centos7默认自带的是mariadb5.5,testlink要求MariaDB 5.6以上的版本才能支持,所以需要事先配置yum源。

1.配置yum源

   进入/etc/yum.repo.d下,添加CentOS-MariaDB.repo文件,其中添加内容如下



[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1



免费的centos链接工具 centos links_数据库

  2. 清除Yum的缓存并重新建立



yum clean all
yum makecache



3.打印MariaDB源中的软件包



yum list --disablerepo=\* --enablerepo=mariadb


 

免费的centos链接工具 centos links_php_02

      4.安装MariaDB数据库



yum install MariaDB-client MariaDB-server MariaDB-devel -y



     5.启动数据库并设置为开机自启



systemctl start mariadb
systemctl enable mariadb



     6.初始化数据库,并删除测试数据库及更改权限和设置密码



mysql_secure_installtion



免费的centos链接工具 centos links_数据库_03

      7.设置数据库密码



mysql -uroot -p



      8.创建testlink数据库



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



 四、PHP 5.6的安装

 centOS目前默认的php版本是5.4,但testlink要求的版本必须大于5.4。

      1.配置yum源



yum install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm



      2.PHP 5.6的安装



yum install php56 php56-php php56-php-mysqlnd \
php56-php-gd php56-php-mcrypt \
php56-php-mbstring php56-php-xml php56-php-cli php56-php-ldap



     3.修改参数



sed -i "s/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 2880/" /opt/remi/php56/root/etc/php.ini
sed -i "s/max_execution_time = 30/max_execution_time = 120/" /opt/remi/php56/root/etc/php.ini



    4.验证php是否生效

/var/www/html/info.php写一个php文件在浏览器中运行一下,看是否能访问到一个php信息页面

    PHP文件内容如下:



<?php
phpinfo();
?>



     b)通过 ip/phpinfo.php访问,然而,试了N多遍!!!始终无法访问PHP页面!!!

免费的centos链接工具 centos links_数据库_04

 

     c) 最后找到了原因,防火墙没有关!!!

       关闭防火墙



systemctl stop firewalld.service



    d)现在可以正常访问到PHP页面了,说明php配置成功

 

免费的centos链接工具 centos links_运维_05

五、TestLink的安装

1.下载testlink安装包,并解压



tar -zxvf testlink-1.9.17.tar.gz -C /var/www/html



      2.将安装包重命名为testlink

 



mv testlink-1.9.17 testlink



 

     3.配置



cp /var/www/html/testlink/custom_config.inc.php.example\
/var/www/html/testlink/custom_config.inc.php



     4.创建log文件,并赋予权限



chown -R apache:apache /var/www/html/testlink
mkdir /var/www/html/testlink
mkdir /var/www/html/upload_area
chmod 777 /var/www/html/testlink/logs



     5.编辑  /var/www/html/testlink/custom_config.inc.php,将原有的log路径和存储路径重新替换



// $tlCfg->log_path = '/var/testlink-ga-testlink-code/logs/'; /* unix example */
// $g_repositoryPath = '/var/testlink-ga-testlink-code/upload_area/';  /* unix example */

$tlCfg->log_path = '/var/www/html/testlink/logs/';
$g_repositoryPath = '/var/www/html/testlink/upload_area/';
$tlCfg->config_check_warning_mode = 'SILENT';



免费的centos链接工具 centos links_运维_06

      6.重启Apache



systemctl restart httpd.service



      7.浏览器安装配置

   a)输入IP进行访问testlink默认页面:http://ip/testlink/

   b)第一步。点击“安装”

免费的centos链接工具 centos links_运维_07

  c)点击继续

免费的centos链接工具 centos links_运维_08

 d)如果没有红色提示,点击'continue',数据库这里选择mysql,其他不做要求(橙色部分无影响)。红色部分可以提示进行继续定位和解决。

 

免费的centos链接工具 centos links_数据库_09

e)通过数据库基本配置后,整个安装过程结束。testlink默认的用户名密码为:admin/admin