TestLink is an open-source web based test management execution system. It enables quality assurance teams to create and manage their test cases as well as to organize them into test plans. These test plans allow team members to execute test cases and track test results dynamically.
In this tutorial, we will be installing TestLink version 1.9.16
(the latest version at the time this article was written) on CentOS 7.
A CentOS 7 x64 server instance.
A sudo user.
I'll reference the main IP of my CentOS 7 server as 203.0.113.1
.
Log in to your server via SSH using the sudo user to install epel
, update the system, and restart to apply the updates.
sudo yum install epel-release -y
sudo yum update -y && sudo shutdown -r now
sudo yum install httpd -y
It is recommended to remove/disable the Apache default welcome page in production environments.
sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf
Prevent Apache from listing web directory files to visitors:
sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf
Start the Apache service and enable it to auto-start on boot
sudo systemctl start httpd.service
sudo systemctl enable httpd.service
As required by TestLink 1.9.16, you need to install MariaDB 10.1 or later on your system.
cat <<EOF | sudo tee -a /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.1 CentOS repository list - created 2017-01-14 03:11 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
sudo yum install MariaDB-server MariaDB-client -y
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
sudo /usr/bin/mysql_secure_installation
Answer questions on the screen as instructed below, and remember to use your own MariaDB root password:
Enter current password for root (enter for none): Just press the Enter
button
Set root password? [Y/n]: Y
New password: your-root-password
Re-enter new password: your-root-password
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]: Y
Reload privilege tables now? [Y/n]: Y
Log into the MySQL shell as root
:
mysql -u root -p
Type the MariaDB root password you set earlier and then press Enter
.
In the MySQL shell, create a database testlink
, a database user testlinkuser
, and the database user's password yourpassword
as follows.
Note: For security purposes, remember to replace the sample password yourpassword
with your own password.
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;
TestLink requires PHP 5.5 or later. In order to get better performance, we will install PHP 7.1 and all the necessary extension for TestLink as follows:
sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
sudo yum install mod_php71w php71w-mysqlnd php71w-common php71w-gd php71w-ldap php71w-cli php71w-mcrypt php71w-xml -y
We will need to modify PHP settings to meet TestLinkâs requirements as follows:
sudo cp /etc/php.ini /etc/php.ini.bak
sudo sed -i "s/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 2880/" /etc/php.ini
sudo sed -i "s/max_execution_time = 30/max_execution_time = 120/" /etc/php.ini
/var/www/html
directory:cd
wget https://github.com/TestLinkOpenSourceTRMS/testlink-code/archive/1.9.16.tar.gz
sudo tar -zxvf 1.9.16.tar.gz -C /var/www/html
sudo chown -R apache:apache /var/www/html/testlink-code-1.9.16
sudo cp /var/www/html/testlink-code-1.9.16/custom_config.inc.php.example /var/www/html/testlink-code-1.9.16/custom_config.inc.php
Use the vi
text editor to open this configuration file:
sudo vi /var/www/html/testlink-code-1.9.16/custom_config.inc.php
Find the following lines:
// $tlCfg->log_path = '/var/testlink-ga-testlink-code/logs/'; /* unix example */
// $g_repositoryPath = '/var/testlink-ga-testlink-code/upload_area/'; /* unix example */
Replace them with:
$tlCfg->log_path = '/var/www/html/testlink-code-1.9.16/logs/';
$g_repositoryPath = '/var/www/html/testlink-code-1.9.16/upload_area/';
Save and quit:
:wq!
cat <<EOF | sudo tee -a /etc/httpd/conf.d/testlink.conf
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/testlink-code-1.9.16/
ServerName testlink.example.com
ServerAlias www.testlink.example.com
<Directory /var/www/html/testlink-code-1.9.16/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/httpd/testlink.example.com-error_log
CustomLog /var/log/httpd/testlink.example.com-access_log common
</VirtualHost>
EOF
sudo systemctl restart httpd.service
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload
When you visit http://203.0.113.1
for the first time, you will be presented with the TestLink installation wizard.
On the first page, Click the New installation
link.
On the Acceptance of License
page, check I agree to the terms set out in this license.
, and then click the Continue
button.
On the Verification of System and configuration requirements
page, make sure that all requirements (excluding requirements on Postgres
and MSSQL
) are satisfied, and then click the Continue
button.
On the Database Configuration
page, provide database configuration info as follows, and then click the Process TestLink Setup
button to finish the installation:
Database Type: MySQL/MariaDB (5.6+ / 10.+)
Database host: localhost
Database name: testlink
Table prefix: <LEAVE IT EMPTY>
Database admin login: root
Database admin password: <your-MariaDB-root-password>
TestLink DB login: testlinkuser
TestLink DB password: yourpassword
You can point your web browser to http://203.0.113.1
to start using TestLink, and you need to use the default credentials below to log in:
Login Name: admin
Password: admin
Note: Remember to change your password after logging in.
For security purposes, you should restrict the apache
user's permissions after the installation:
sudo chown -R root:root /var/www/html/testlink-code-1.9.16
sudo chown -R apache:apache /var/www/html/testlink-code-1.9.16/{gui,logs,upload_area}
sudo systemctl restart httpd.service
Additionally, you should remove the /var/www/html/testlink-code-1.9.16/install
directory:
sudo rm -rf /var/www/html/testlink-code-1.9.16/install
That's it. Thanks for reading.