How to deploy TestRail in Linux step by step

背景:

TestRail為一個(gè)測(cè)試用例管理平臺(tái),其功能簡(jiǎn)單大方,但足夠滿(mǎn)足項(xiàng)目的測(cè)試用例庫(kù)使用。

TestRail需要LAMP環(huán)境,官網(wǎng)提供了完整的LAMP環(huán)境配置文檔,可參考:https://www.howtoforge.com/quick-n-easy-lamp-server-centos-rhel

LAMP部署精簡(jiǎn)就是下面幾個(gè)步驟:

Install Apache

yum install httpd httpd-devel

/etc/init.d/httpd start

Install MySQL Database Server

yum install mysql mysql-server mysql-devel

/etc/init.d/mysqld start

mysql> USE mysql;

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

mysql> FLUSH PRIVILEGES;

Install PHP5 Scripting Language

yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml

/etc/init.d/httpd restart

后面的phpMyAdmin,Webmin不是必須的,可以不安裝。

TestRail安裝步驟,參考官網(wǎng)提供的文檔:http://docs.gurock.com/testrail-admin/installation-unix

創(chuàng)建數(shù)據(jù)庫(kù):

mysql>CREATE DATABASE testrail DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

mysql>CREATE USER 'testrail'@'127.0.0.1' IDENTIFIED BY 'zyLC021';

mysql>GRANT ALL ON testrail.* TO 'testrail'@'127.0.0.1';

mysql>FLUSH PRIVIGELES;

備注:

127.0.0.1 不能用 localhost 代替,否則在TestRail Setup Wizard 第二步會(huì)報(bào)錯(cuò),數(shù)據(jù)庫(kù)無(wú)法連接,如下圖:


Installing TestRail

To install the actual application, just upload and extract the TestRail installation archive to your web server and copy the files to your web server'swwwdirectory (Centos: ?it's/var/www/html/testrail).

#cd /opt/

#mkdir testrail

#cd testrail

#mkdir attachments

#mkdir reports

#chmod apache:apache /opt/testrail/attachments

#chmod apache:apache /opt/testrail/reports

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

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

開(kāi)始安裝:


Activating the TestRail background task

The last step of the TestRail installation consists of installing the background task. The background task is responsible, among other things, for sending out email notifications for test changes if this feature is enabled. The background task needs to be triggered in regular intervals to do its work and the easiest way to do this under Unix-based systems is to add acronjob. If you are using an?OS?X based server system, you might want to consider using alaunchd scriptinstead.

Before scheduling the task, you can verify that the background task can be successfully started by running it manually from the command line:

$php /var/www/html/testail/task.php

Background task on Unix/Linux

We usecronto trigger the background task on Unix/Linux systems periodically. Before scheduling the task, you can verify that it can be successfully started by running it manually from the command line:

$ php /var/www/testrail/task.php

The TestRail background task automatically detects if it's already running, so it's best to trigger the task in very short intervals (such as every minute) for best results. To do this, make sure cron is installed on your system and create a file/etc/cron.d/testrailwith the following content:

* * * * * www-data /usr/bin/php /var/www/testrail/task.php

The cron job needs the PHP command line interface, which might already be installed on your system. You can test this by executing thephp -vcommand. If it's not already installed, install thephp5-clipackage or equivalent with your platform's package manager.

Please note:Also make sure to add the above mentioned PHP extensions to thephp-cli's PHP.ini if it doesn't use the web server's PHP.ini file. E.g., on Ubuntu systems, also add theioncubeextension to/etc/php5/cli/php.ini.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容