DEV Community 👩‍💻👨‍💻

Arseny Zinchenko
Arseny Zinchenko

Posted on • Originally published at on

TestRail: QA Test Case Management installation on Linux

TestRail – Test Case Management Software for QA and Development Teams.

Well – that’s all needed as a description)

Below – its installation on Debian Linux with NGINX, Let’s Encrypt, PHP-FPM, MariaDB, and Exim.

As the TestRail is just a simple PHP/MySQL application - so this post might be interesting more as an example of a quick LEMP with SSL setup process description then TestRail's itself.

Project’s homepage –

Installation official documentation – here>>>.

Setup will be on an AWS EC2.


Log in to the EC2:

ssh -i bttrm-testrail-eu-west-1.pem

Update packages list and installed packages:

root@ip-172-31-25-137:/home/admin# apt update && apt upgrade

Let’s Encrypt

Install Let’s Encrypt client:

root@ip-172-31-25-137:/home/admin# apt install -y git unzip
root@ip-172-31-25-137:/home/admin# git clone /opt/letsencrypt

Obtain a certificate using the standalone authenticator:

root@ip-172-31-25-137:/home/admin# /opt/letsencrypt/letsencrypt-auto certonly -d
1: Spin up a temporary webserver (standalone)
2: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
- Congratulations! Your certificate and chain have been saved at:
Your key file has been saved at:
Your cert will expire on 2019-06-19.


Install NGINX:

root@ip-172-31-25-137:/home/admin# apt -y install nginx

Will configure it a bit later.


Add the PHP 7.2 repository:

root@ip-172-31-25-137:/home/admin# wget -q -O- | sudo apt-key add -
root@ip-172-31-25-137:/home/admin# echo "deb stretch main" | sudo tee /etc/apt/sources.list.d/php.list
deb stretch main

Update the available packages list:

root@ip-172-31-25-137:/home/admin# apt update

Install PHP and necessary for the TestRail modules:

root@ip-172-31-25-137:/home/admin# apt -y install php7.2 php7.2-fpm php7.2-mysql php7.2-curl php7.2-json php7.2-mbstring php7.2-xml php7.2-zip

Find PHP configs:

root@ip-172-31-25-137:/home/admin# find /etc/ -name php.ini

Edit both /etc/php/7.2/fpm/php.ini and /etc/php/7.2/cli/php.ini and add libraries load:

ionCube install

Download its archive:

root@ip-172-31-25-137:/home/admin# cd /tmp/
root@ip-172-31-25-137:/tmp# wget

Unpack it and move to the /opt:

root@ip-172-31-25-137:/tmp# tar xfpz ioncube_loaders_lin_x86-64.tar.gz
root@ip-172-31-25-137:/tmp# mv ioncube /opt/

Add zend_extension to both ini-files as in the example above:


NGINX virtual host configuration

Generate DF-key:

root@ip-172-31-25-137:/tmp# openssl dhparam -out /etc/nginx/dhparams.pem 2048

Add a virtual host config /etc/nginx/conf.d/

server {
    listen 80;
    # Lets Encrypt Webroot
    location ~ /.well-known {
        root /var/www/html;
        allow all;
    location / {
        # office1
        allow 194.***.***.24/29;
        # office2
        allow 91.***.***.78/32;
        # arseny home
        allow 188.***.***.48/32;
        deny  all;
        return 301;
server {
    listen       443 ssl;
    root /var/www/;
    access_log  /var/log/nginx/;
    error_log /var/log/nginx/ warn;
    # office1
    allow 194.***.***.24/29;
    # office2
    allow 91.***.***.78/32;
    # arseny home
    allow 188.***.***.48/32;
    deny  all;
    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/nginx/dhparams.pem;
    ssl_session_timeout 1d;
    ssl_stapling on;
    ssl_stapling_verify on;
    location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar|otf|ttf)\$ {
        try_files \$uri =404;
    location / {
        try_files $uri $uri/ /index.php?$args;
    location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|woff)$ {
        access_log off;
        log_not_found off;
        expires max;
    location ~ \.php(?:/|$) {
        try_files $uri =404;
        fastcgi_pass unix:/run/php/;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors on;
        fastcgi_index index.php;

Check syntax and reload config files:

root@ip-172-31-25-137:/tmp# nginx -t && service nginx reload

PHP-FPM configuration

Create a pool’s config file /etc/php/7.2/fpm/pool.d/

user = www-data
group = www-data
listen = /run/php/
listen.owner = www-data = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

Restart FPM and check if the new pool started:

root@ip-172-31-25-137:/tmp# service php7.2-fpm restart
root@ip-172-31-25-137:/tmp# ps aux | grep fpm
root     15008  0.5  2.7 400684 28368 ?        Ss   11:00   0:00 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf)
www-data 15010  0.0  0.6 400676  6904 ?        S    11:00   0:00 php-fpm: pool
www-data 15011  0.0  0.6 400676  6904 ?        S    11:00   0:00 php-fpm: pool
www-data 15012  0.0  0.6 400676  6904 ?        S    11:00   0:00 php-fpm: pool www
www-data 15013  0.0  0.6 400676  6904 ?        S    11:00   0:00 php-fpm: pool www
PHP test

Create a working directory:

root@ip-172-31-25-137:/tmp# mkdir -p /var/www/

Create the /var/www/ file:


Check in a browser:


Install it:

root@ip-172-31-25-137:/tmp# apt -y install mariadb-server

Run initial config:

root@ip-172-31-25-137:/tmp# mysql_secure_installation

Create a database and user:

MariaDB [(none)]> CREATE DATABASE testrail DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> GRANT ALL ON testrail.* TO 'testrail'@'localhost' identified by 'uo***8a';
Query OK, 0 rows affected (0.00 sec)

TestRail installation

Get your trial here>>>.

You’ll get an email with the download link and trial-key.

Download archive:

root@ip-172-31-25-137:/tmp# wget

Unpack it and move to the project’s directory:

root@ip-172-31-25-137:/tmp# unzip
root@ip-172-31-25-137:/tmp# cp -r testrail/* /var/www/
root@ip-172-31-25-137:/tmp# chown -R www-data:www-data /var/www/

Open your URL in a browser and proceed with the installation there:

Configure the database connection details:

Create logs directory:

root@ip-172-31-25-137:/tmp# mkdir /var/www/
root@ip-172-31-25-137:/tmp# chown -R www-data:www-data /var/www/

Set your project’s details:

An email will be set later, skip it for now:

Add an admin user, the trial key was sent in an email:


Log in:

Cron jobs

Now – add a cronjob to run TestRail’s tasks.

Check if task.php works:

root@ip-172-31-25-137:/home/admin# php /var/www/
root@ip-172-31-25-137:/home/admin# echo $?

If no errors here – it can be added to a crontab:

* * * * * www-data /usr/bin/php /var/www/

Exim and email settings

To send emails – a local Exim will be used.

Install it:

root@ip-172-31-25-137:/home/admin# apt -y install exim4-base

Configure it:

root@ip-172-31-25-137:/home/admin# dpkg-reconfigure exim4-config

Check if email sending works:

root@ip-172-31-25-137:/home/admin# echo "Exim test" | mailx -s "Exim test"

Go to the TestRail admin page – Administration > Site Settings > Email:


Similar posts

Top comments (2)

taylorblake88 profile image

This tutorial was really helpful! There are many applications out there that are able to solve issues, but it's so complicated to learn the process of each one, especially if you're new to this kind of stuff. Some friends of mine have started working towards test case management tools, like because each program that they've tried was too complicated. After all, this is the source of many great inventions. If you're lacking something, you'll start to look for solutions and eventually create something on your own. After that, the progress is going to be beautiful

alexalex0 profile image

Is there a similar thing for Ubuntu users?

Take a look at this:


Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. 🛠