1.安裝apache
安裝前查詢一下是否安裝了apache:
rpm -qa|grep httpd
若無,安裝httpd:
yum install -y httpd
加入開機自啓:
chkconfig on httpd
在apache配置文件httpd.conf中加入
ServerName IP地址
啓動apache
service httpd start
2.追加CentOS 6.5的epel及remi源
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
3.使用yum list命令查看可安裝的包(Packege)
yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
4.yum源安裝好後,下一步配置PHP5.6
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-gd php-ldap php-zip php-fileinfo php-cli php-curl php-mysql
5.用php命令查看版本
php --version
版本爲php5.6
6. 安裝mysql
rpm -qa|grep mysql
如果沒有安裝,則使用yum源進行安裝
yum -y install mysql
啓動mysql服務:service mysqld start
mysql -u root -p 初始密碼爲mysql
進入設置mysql密碼:set password for root@localhost=password('新密碼');
7.將testlink1.9.14安裝包放在/var/www/html目錄下,解壓並重命名
tar -zxvf testlink1.9.14
mv testlink1.9.14 /var/www/html/testlink
chmod -R 777 /var/www/html/testlink
進入testlink目錄:
vim config.inc.php修改如下幾項:
$g_repositoryPath = '/var/testlink/upload_area/';
$tlCfg->log_path = '/var/testlink/logs/';
$tlCfg->default_language = 'zh_CN';
$tlCfg->config_check_warning_mode = 'SILENT';
若上面兩個路徑沒有改動,新建這兩個路徑:
mkdir /var/testlink
mkdir /var/testlink/logs
mkdir /var/testlink/upload_area
修改這兩個目錄的權限
chmod 777 /var/testlink
chmod 777 /var/testlink/logs
chmod 777 /var/testlink/upload_area
重新啓動apache服務:service httpd restart
8.安裝testlink
http://localhost/testlink 進入testlink安裝頁面,點擊new installation,
設置數據庫賬號密碼(賬號root,密碼默認情況爲mysql)
設置操作testlink數據庫的賬號和密碼(賬號爲admin,密碼爲admin)
注意:
安裝過程中如果出現如下錯誤:
TestLink setup will now attempt to setup the database:
Creating connection to Database Server:OK!
Connecting to database `testlink`:OK!
Creating Testlink DB user `testlink`:OK! (ok - user_exists ok - grant assignment)
Processing:sql/mysql/testlink_create_tables.sql
OK!
Writing configuration file:Failed!
TestLink couldn't write the config file. Please copy the following into the ../config_db.inc.php file:
<?php
// Automatically Generated by TestLink Installer
define('DB_TYPE', 'mysql');
define('DB_USER', 'root');
define('DB_PASS', 'password');
define('DB_HOST', 'localhost');
define('DB_NAME', 'testlink');
define('DB_TABLE_PREFIX', '');
?>
Once that's been done, you can log into TestLink by pointing your browser at your TestLink site.
解決方式:
在testlink目錄中創建config_db.inc.php文件,並拷貝config.inc.php的代碼即可
9.安裝完成後解決testlink圖表亂碼問題
下載 tahoma.ttf 字體;
下載好後,我們將其放置到testlink的安裝目錄的以下文件夾中:
/var/www/html/testlink/third_party/pchart/Fonts/
接下來,修改配置文件config.inc.php:
修改
$tlCfg->charts_font_path = TL_ABS_PATH . "third_party/pchart/Fonts/tahoma.ttf";
爲
$tlCfg->charts_font_path = TL_ABS_PATH . "third_party/pchart/Fonts/SIMYOU.ttf";
10.與BUG管理工具jira集成
首先需要在BUG管理工具jira中創建項目,並填寫KEY
admin賬號登錄testlink,配置 Issue Tracker Management
點擊創建,配置關聯並保存
<!-- Template jirasoapInterface -->
<issuetracker>
<username>username</username>
<password>password</password>
<uribase>http://IP:port/</uribase>
<uriwsdl>http://IP:port/rpc/soap/jirasoapservice-v2?wsdl</uriwsdl>
<uriview>http://IP:port/browse/</uriview>
<uricreate>http://IP:port/secure/CreateIssue!default.jspa</uricreate>
<projectkey>XXX</projectkey>
<issuetype>1</issuetype>
</issuetracker>
最後在testlink創建測試項目管理時選擇上一步保存的跟蹤器即可配置testlink與jira的集成
11.testlink發送郵件配置(公司郵箱)
進入/var/www/html/testlink目錄,修改config.inc.php文件,添加以下內容:
/** [SMTP] */
// Developer Note:
// these config variable names has been choosed to maintain compatibility
// with code taken from Mantis.
// SMTP server Configuration ("localhost" is enough in the most cases)
$g_smtp_host = 'smtp.xxx.com'; #SMTP 服務必須配置,可配置你公司發送郵件服務器地址
# Configure using custom_config.inc.php
$g_tl_admin_email = '[email protected]'; #問題錯誤通知,配置你公司的郵箱
$g_from_email = '[email protected]'; #收到郵件看到的發送地址
$g_return_path_email = '[email protected]'; #如果收到郵件的人進行回覆的郵件地址
# Urgent = 1, Not Urgent = 5, Disable = 0
$g_mail_priority = 5;
# Taken from mantis for phpmailer config
define ("SMTP_SEND",2);
$g_phpMailer_method = SMTP_SEND; #使用SMTP協議進行發送
// Configure only if SMTP server requires authentication
$g_smtp_username = '[email protected]'; #smtp發送的用戶名
$g_smtp_password = 'password'; # 發送用戶的密碼
上述配置完成後,重啓apache服務,即可實現功能:
service httpd restart
指派testlink測試用例執行時勾選
可實現郵件發送功能