How to deploy TestRail5.6 on Centos7

之前部署的TestRail5.x版本是在Centos6.x(php5版本),由于TestRail5.6已经不再支持php5了,只支持php7版本,可参看官方的文档:http://docs.gurock.com/testrail-admin/start/how_to_upgrade_testrail_instances_from_php_5.6_to_php_7.x

As of TestRail 5.6, PHP 5.6 is no longer supported. PHP 5.6 active support has officially ended on Jan, 19 2017 with security support ending on Dec, 31 2018. So please note, even if TestRail 5.6 works in your PHP 5.6 environment, we don’t support the configuration any longer and some features might not work well.

以下是Centos7+PHP7.2+TestRail5.6上部署的过程,按照如下步骤就完整部署成功。

整体上任然可以参看官方的部署文档http://docs.gurock.com/testrail-admin/installation-unix,但官方的文档目前是正对php5版本的,而不是php7版本的。

以下是总结的过程,基本按如下步骤就OK,安装详细说明仍然参考官方安装说明:http://docs.gurock.com/testrail-admin/installation-unix

Step1: 安装Centos7,安装完后关闭防火墙,使用如下命令:

    systemctl stop firewalld.service

    关掉selinux(否则安装是那个创建attachments目录是会报错)

Step2:安装apache服务

使用如下命令:

#yum install httpd httpd-devel

#systemctl start httpd.service

Step3: 安装php7环境

由于Centos默认应该没有php7的yum源,所以先安装yum源,方法如下:

#rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

#rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

先看CentOS7上是否有php,如果先卸载:

#yum remove php

#rpm -qa|grep php

#列出所有的php相关的rpm包

rpm -e xxx 

#xxx指的是上一个命令列出的rpm包的包名,复制即可。这一步卸载安装的php的rpm包,注意因为可能存在依赖关系会发生报错,所以可能需要调整下rpm包的顺序。

如果调整了rpm包的顺序,还是无法删除剩余的包,可以强制删除来解决:

rpm -e xxx --nodeps

然后使用如下命令安装php7环境

#yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml

Step4:安装MYSQL

Centos7默认也没有Mysql源,默认支持的是一个类mysql的数据库MariaDB,所以先安装Mysql,使用如下命令:

#wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

#rpm -ivh mysql-community-release-el7-5.noarch.rpm

#yum install mysql  mysql-server mysql-devel  (安装mysql)

#chown -R root:root /var/lib/mysql

#service mysql restart

#mysql -u root -p    (修改root密码)

>use mysql;

>UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';

>FLUSH PRIVILEGES;

#mysql -u root -p     (下面创建TestRail需要的数据库和用户)

> CREATE DATABASE testrail DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

> CREATE USER 'testrail'@'localhost' IDENTIFIED BY 'newpassword';

> GRANT ALL ON testrail.* TO 'testrail'@'localhost';

Step5:配置php

在php.ini(在目录/etc下)的最后增加两行:

    extension=mysql.so

    extension=curl.so

Step6:安装 ionCube到/opt

    按官网的说明,去下载ioncube_loaders_lin_x86-64.zip(https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.zip 或者https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz),放到/opt下并解压

    将zend_extension=/opt/ioncube/ioncube_loader_lin_7.2.so  追加到php的配置文件/etc/php.ini 结尾

 将下载的ioncube_loaders_lin_x86-64.zip解压到 /usr/lib64/php目录下

  下载配置文件 00-ioncube.ini 放到目录 /etc 下。(或者自己创建一个应该也可以,内容就只有一行:zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_5.3.so)

Step7:重启httpd服务

step8:上传TestRail安装包到服务器

    将官网的TestRail安装包testrail-latest-ion70.zip上传到服务器/var/www/html/下解压

    https://secure.gurock.com/downloads/testrail/testrail-latest-ion70.zip

Step9:创建安装TestRail需要的目录

    #mkdir /opt/testrail

   #mkdir /opt/testrail/attachments

    #chown apache:apache /opt/testrail/attachments

    #mkdir /opt/testrail/reports

    #chown apache:apache /opt/testrail/reports

    #mkdir /var/www/html/testrail/logs

    #chown apache:apache /var/www/html/testrail/logs

    #cd /var/www/html/testail

    #php task.php

    #cd /etc/cron.d

    #vim testrail   

(在这个文件中写一行:* * * * * apache /usr/bin/php /var/www/html/testrail/task.php)

step9:安装TestRail

浏览器输入http:///testrail 安装服务,就会出现安装向导页面,按照步骤安装即可完成

你可能感兴趣的:(How to deploy TestRail5.6 on Centos7)