Installing Testlink on Amazon Web Services

Posted on: November 17, 2015

Categories: software, implementation support

We have been using Testlink on and off for a number of years as a tool to help define and execute tests against all sorts of software. It’s far better than trying to track everything on spreadsheets (see our recent post on Making Content Better for a bit more rationale).

We needed to move our Testlink installation from our shared web-server to something a bit more robust and scalable, and have chosen Amazon Web Services (AWS) given its reputation and our previous experiences with some rather large clients of their’s.

Setting up Testlink on the server was mostly quite straightforward, but there were a few places where we ended up scratching our heads. Hopefully this brief set of instructions will help others in the same position!

  1. Create an account on Amazon Web Services (AWS). You will need to put in payment details, but that doesn’t mean you’ll be charged anything just yet. We’d suggest just signing up for the free, basic level at this stage.
  2. Go to the AWS console
  3. Change your required server location (next to your name at the top right) to meet your needs. We chose “Ireland”.
  4. Begin the process of launching an EC2 instance… That sounds complicated but it’ simply a matter of hitting the “Launch Instance” button from the AWS console. The process is almost identical to that of launching a Wordpress site on AWS
  5. In the tabs on the left-hand-side, choose AWS Marketplace
  6. Within the Marketplace, search for “Testlink”. It will bring up a list of 2 or 3 different Bitnami packages to use.
  7. We chose the package that uses Bitnami (HVM) as it gave us the right selection of server sizes for our needs. You might need to experiment to see which version gives the server you need.
  8. You will be asked to choose an Instance Type. This is where you’ll need to do some thinking, and may need to go back to the previous step to choose a different Bitnami package. Amazon do give you the option of choosing a free instance (free for one year), but this is very small and probably not suited to any more than a “getting started” setup. Testlink recommend going for the m3.medium instance - but that may be overkill for some. If you’re not sure, that’s where we’d probably recommend bringing in someone who knows AWS to provide some support.
  9. AWS gives you options to configure the instance, but you can just use the defaults provided by Bitnami and hit “Review and Launch”
  10. Don’t forget to create and download the .pem private key file (and save it somewhere you can get to). The launch process will guide you through how to do this. You will need this when connecting to the server to configure Testlink.

If you then go to the IP address supplied by AWS, you should see the Testlink login page. However, the normal Bitnami password doesn’t seem to work, so you’ll need to change it, but you’ll only be able to do that when you’ve got a way for Testlink to send emails…

Setting up an AWS SMTP server

There are three stages to getting Testlink setup so it can send emails:

Verify email addresses

Setup verified email addresses (ie. those which you’ll be using within Testlink) within Amazon’s Simple Email Service (note this route is only suitable for small teams, for larger teams you’ll need to ask Amazon for production access)

Obtain your Simple Email Service SMTP credentials

Obtain SES credentials so that Testlink can use SES

This is where you’ll need to connect to the AWS server via SSH, using the .pem file created earlier. Note that AWS helpfully provides a connect button on the EC2 > Instances page, with commands for your particular instance.

AWS Connect button

Once you’ve connected using SSH, you can edit the /apps/testlink/htdocs/custom_config.inc.php file (I tend to use the nano editor, but you can also use vi if you like esoteric editing commands).

Find the section headed SMTP server configuration, and then add in the following details (NB. These are taken from the Mantis Bug Tracker configuration - which is copied by Testlink - see this forum post)

define ("SMTP_SEND", 2);
$g_phpMailer_method = SMTP_SEND;  #For SMTP Method
$g_smtp_host = ‘email-smtp.us-east-1.amazonaws.com'; #Your SES SMTP Host
$g_smtp_connection_mode = ‘tls'; #It is mandatory for SES and Gmail SMTP
$g_smtp_port = 587; #For some Reason only this port was working in SES
$g_smtp_username = ‘SMTP Username'; # Your SES SMTP Username (a 20 character string)
$g_smtp_password = ‘SMTP Password'; # Your SES SMTP Password
$g_tl_admin_email = ‘email@sample.com'; #Email displayed at footer (Must be an approved sender list in SES)
$g_from_email = ‘email@sample.com'; # From Address (Verified SES Sender Email)
$g_return_path_email = ‘email@sample.com'; # the return address for bounced mail
$g_from_name = ‘From Name';
$g_enable_email_notification = ON;

Once all that is done, you should have a working Testlink installation. It may need further tweaks, but check out the documentation stored inside the docs directory.

Note: If you want to access PHPmyadmin to administer the database, create an SSH tunnel to the port 80 instead. This can be done as follows in Unix systems:

ssh -i <path_to_private_key> -N -L 8888:127.0.0.1:80 <public_dns>

or with Putty on Windows using source port 8888 and destination 127.0.0.1:80.

Once done it will be accessible at http://localhost:8888/phpmyadmin while the tunnel is opened. Credit to Carlos on the Bitnami forums for this advice.