Installing Testlink (Test Management Tool) on Ubuntu 12.04 (AWS EC2) with URL Rewrite




After finding scattered offerings when it came to installing Testlink on Ubuntu i decided to document the process. Heres the rundown:


Create a new micro instance (ubuntu 12.04) using the ‘select existing’ key pair, if you don’t have an existing create a new one and name it something memorable and download it to a folder that’s easy to get too.




Create a security group and set the inbound ports to be the following:




Go to your instance page and right click on the instance just created and choose “Connect”
Select “Connect with a standalone SSH Client”

copy the example in the popup window. Eg

·        ssh -i scottyg_au.pem ubuntu@54.213.211.63

Open up terminal (Mac) or Cygwin (PC)

Cd to the folder with the .pem file
You need to modify the permissions on the .pem file, do this by running

·        chmod 400 ‘xx.pem’.
Eg chmod 400 scottyg_au.pem

Paste in the ‘ssh’ command into your terminal
ssh -i scottyg_au.pem ubuntu@54.213.211.63


Type “yes” when prompted to add the key to the known hosts


On the Ubuntu Instance:


Download the Testlink file:

Unpack
·        tar zxvf testlink-1.9.7.tar.gz

Change folder name to be ‘testlink’
·        mv testlink-1.9.7/ testlink

install required files

  •         sudo apt-get update && sudo apt-get upgrade

install java JDK


  • sudo apt-get purge openjdk
  • sudo apt-get install software-properties-common
  • sudo add-apt-repository ppa:webupd8team/java
  • sudo apt-get update
  • sudo apt-get install oracle-java8-installer


Install MySql


  • ·       sudo apt-get install mysql-server mysql-client
Login as root

  • ·        mysql -h localhost -u root -p
(password entered in setup)
Create database

  •         create database testlink;

Check that its running:

·         sudo netstat -tap | grep mysql
Restart if needed

·         sudo service mysql restart

Install Apache2

  •          sudo apt-get install apache2

Install PHP5

  • ·        sudo apt-get install php5 libapache2-mod-php5 php5-mysql

Edit and restart Apache2

edit httpd.conf: :

  • ·        sudo nano /etc/apache2/httpd.conf

add the text in between the curly braces below:

{
AddType application/x-httpd-php .php .htm .html
AddDefaultCharset UTF-8
ServerName 127.0.0.1

}


  • ·        sudo /etc/init.d/apache2 restart


Copy the ‘testlink folder to /var/www

  • ·         sudo cp -r testlink /var/www/



cd to /var/www and change the file permissions

  • ·        sudo chmod 777 gui/templates_c

Create the testlink folders under /var/testlink


  • ·         cd /var
  • ·        sudo mkdir testlink
  • ·        cd testlink
  • ·        mkdir logs upload_area
  • ·        sudo chmod 777 logs
  • ·        sudo chmod 777 upload_area

Access testlink on your AWS instance:


·        agree to the license

Make sure the read write permissions are correct, if they are not you need to go back and change the file permissions or create the required folders:




Enter the MySql details:
sql user : root
sql password: admin


-         * Note that the config write failed and I needed to edit the “config_db.inc.php” file by adding in the following:

-         <?php
-         // Automatically Generated by TestLink Installer - Tue, 03 Sep 13 02:32:50 +0000
-         define('DB_TYPE', 'mysql');
-         define('DB_USER', 'root');
-         define('DB_PASS', 'admin');
-         define('DB_HOST', 'localhost');
-         define('DB_NAME', 'testlink');
-         define('DB_TABLE_PREFIX', '');

Create a file and copy the above data


  • ·        touch sudo nano config_db.inc.php
  • ·        sudo nano config_db.inc.php

Save and close


Go to instance and login:

http://ec2-54-213-211-63.us-west-2.compute.amazonaws.com/testlink/login.php
                                                                                                           




Redirect the root URL page to the testlink folder

Enable Rewrite:
  • sudo a2enmod rewrite
  • sudo /etc/init.d/apache2 restart


Access default:
  • cd /etc/apache2/sites-available
  • sudo nano default


add the following to the default file:

        <Directory />
                Options +FollowSymLinks
                RewriteEngine On
                RewriteRule ^$ /testlink [L]
                AllowOverride None
        </Directory>

Restart service:
  •      sudo service apache2 restart


Get the user manual and setup Testlink (also available from the menu after logging into testlink):

Comments

  1. I followed your instructions only I installed on a VMware virtual machine. When I try to go to http://127.0.0.1/testlink/ I get a 404 page not found error. Any idea why the testlink installation page is not opening?

    ReplyDelete
  2. Sorry only just noticed this. Did you even manage to resolve your issue ?

    ReplyDelete
  3. # vi /etc/apache2/sites-enable/000-default.conf

    See the second line:
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    Change the second line for:
    DocumentRoot /var/www/

    It's worked for me.

    ReplyDelete
  4. Fredson, This solved my problem! Thanks :)

    ReplyDelete
  5. Very nice blog! Thanks for providing your information. AWS Online Training

    ReplyDelete
    Replies
    1. Thanks Sneha, This was done quite sometime ago. Glad its still relevant

      Delete

Post a Comment

Popular posts from this blog

Running Postman tests on Jenkins using Newman and AWS (Ubuntu 14.04)

Installing ReadyAPI on a Jenkins EC2 instance using X11