軟件准備
需要搭建LAMP環境,下載testlink安裝包:
安裝XAMPP
1.檢查系統中是否有LAMP,分別檢查這四個包,如果有則一個個刪除
2.安裝XAMMP,下載后以root身份進入所在目錄:
#chmod 755 xampp-linux-x64-7.2.11-0-installer.run #./xampp-linux-x64-7.2.11-0-installer.run
執行安裝就可以了
配置XAMPP
- 開啟XAMPP服務設置密碼
#/opt/lampp/lampp start
默認安裝的是開發模式,此條命令可以進入設置MySQL、Apache、PHP的用戶名、密碼
XAMPP: Quick security check... XAMPP: Your XAMPP pages are NOT secured by a password. XAMPP: Do you want to set a password? [yes] yes XAMPP: Password:
XAMPP: Password (again):
XAMPP: Password protection active. Please use 'lampp' as user name! XAMPP: mysql is accessable via network. XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes] yes XAMPP: Turned off.
XAMPP: Stopping MySQL...
XAMPP: Starting MySQL...
XAMPP: The MySQL
phpMyAdmin user pma has no password set!!! XAMPP: Do you want to set a password? [yes] yes
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Setting new MySQL pma password.
XAMPP: Setting phpMyAdmin's pma password to the new one.
XAMPP: MySQL has no root passwort set!!!
XAMPP: Do you want to set a password? [yes] yes
XAMPP: Write the password somewhere down to make sure you won't forget it!!!
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Setting new MySQL root password.
XAMPP: Change phpMyAdmin's authentication method.
XAMPP: The FTP password for user 'nobody' is still set to 'lampp'.
XAMPP: Do you want to change the password? [yes] yes
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Reload ProFTPD...
XAMPP: Done.
- 配置php.ini文件
#vim /opt/lampp/etc/php.ini
延長session時間
session.gc_maxlifetime = 2880
修改參數
max_execution_time = 120
將內存由8M改為64M
memory_limit = 64M
關閉防火牆服務
#
systemctl stop firewalld.service
永久關閉
#chkconfig --level 35 iptables off
安裝Testlink
1.將下載的包解壓到/lampp/htdocs/下 (tar -zxvf testlink-1.9.17.tar.gz),重命名為testlink
2.創建數據庫並新建用戶(可以使用shell命令,也可以直接訪問phpmyadmin進行操作)
#cd /opt/lampp/bin/ #./mysql -uroot -ppassword >create database testlink; >grant all privileges on testlink.* to testlink@"localhost" identified by "<password>"
>flush privileges;
3.打開瀏覽器,訪問http://localhost/testlink進入安裝頁面(也可以在本地遠程訪問,只需把localhost改為服務器的地址)
安裝過程中:
database type:MYSQL
database host:localhost
database name :testlink
填寫MYSQL數據庫用戶名和密碼
Database login: root
Database password: password
填寫testlink數據庫的登錄帳號和密碼
testlink DB login: testlink
testlink DB password: password
完成。
1. 如果報錯:
Checking if /var/testlink/logs/ directory exists [S] </B<< td> Failed!
Checking if /var/testlink/upload_area/ directory exists [S] </B<< td> Failed!
解決方案:修改/opt/lampp/htdocs/testlink/config.inc.php文件:
$ vim /opt/lampp/htdocs/testlink-1.9.16/config.inc.php
進入vim模式
/$tlCfg->log_path = '/var/testlink/logs/'; /* unix example */
[I]
注釋:/$tlCfg->log_path = '/var/testlink/logs/'; /* unix example */
添加:$tlCfg->log_path = '[安裝目錄路徑]/testlink/logs/';
[esc]
/$g_repositoryPath = '/var/testlink/upload_area/'; /* unix example */
[I]
注釋:$g_repositoryPath = '/var/testlink/upload_area/'; /* unix example */
添加:$g_repositoryPath = '[安裝目錄路徑]/testlink/upload_area/';
[esc]
:wq
退出vim模式
注意:testlinkDir 表示安裝目錄路徑
2. 如果再報“directory is writable (by user used to run webserver process)”的錯誤,需要給TestLink目錄下的upload_area、gui/templates_c和templates_c文件設置777權限:
$ chmod 777 /opt/lampp/htdocs/testlink-1.9.17/upload_area/
$ chmod 777 /opt/lampp/htdocs/testlink-1.9.17/logs/
$ chmod 777 /opt/lampp/htdocs/testlink-1.9.17/gui/templates_c/
3. 如果在頁面上會顯示“Deprecated : …… phpmailer/PHPMailerAutoload.php on line 45”這樣的提示文本,需要修改參數:
$ vi /opt/lampp/htdocs/testlink-1.9.17/third_party/phpmailer/PHPMailerAutoload.php
進入vi模式
/function __autoload($classname)
[I]
修改為:function spl_autoload_register($classname)
[esc]
:wq
退出vi模式
3. 如果在頁面上會顯示“Deprecated : …… phpmailer/PHPMailerAutoload.php on line 45”這樣的提示文本,需要修改參數:
Please copy the following into the ../config_db.inc.php file:
<?php
// Automatically Generated by TestLink Installer
define('DB_TYPE', 'mysql');
define('DB_USER', 'testlink');
define('DB_PASS', '<your passwork>');
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文件,並拷貝上面提示的信息到php里就可以啦