Follow

AMP Installation Guide

Definitions

The following placeholders are used in this document to refer to setting specific to your configuration.

  • [INSTALLATION_DIRECTORY] actual installation directory for your AMP server e.g. /amp/amp_2016_6
  • [AMP_HOST] the fully qualified host name for your AMP instance e.g. amp.ssbbartgroup.com
  • [SERVER_IP] the IP address of your server (assigned to the fully qualified host name for your AMP instance)
  • [SERVER_ADMIN] the user who will maintain the AMP install
  • [SSL_CERT_FILE] the location of your servers SSL certificate file e.g. /etc/ssl/certs/amp.crt
  • [SSL_CERT_KEY_FILE] the location of your servers SSL private key file e.g. /etc/ssl/private/amp.key
  • [APACHE_LOGS] the full path to your apache log directory e.g. /var/log/apache2/
  • [MYSQL_ROOT_USERNAME] a mysql user with SUPER priveledges, e.g. root
  • [AMP_DB_NAME] the database amp will use, e.g. 'amp'
  • [AMP_DB_USER] the database user amp will use, e.g. 'amp'
  • [AMP_DB_PASS] the database password for the [AMP_DB_USER], e.g. 'password'
  • [AMP_DATABASE_FILE] is a gzipped sql file provided by SSB BART Group containing initial data for your AMP instance
  • [AMP_ZIP_FILE] is a tar and gzipped file provided by SSB BART Group containing the AMP code needed to run your instance
  • Note: the default AMP configuration assumes [AMP_DB_NAME] and [AMP_DB_USER] are the same
  • [AMP_SERVICES_URL] is the URL for the WAR file as deployed on the J2EE server
    • Note: There are separate sections detailing the installation on Windows and Linux. Other sections contains steps are applicable to both Linux and Windows installs unless otherwise specified

System Requirements

This section defines the system requirements for customer hosted versions of AMP. For AMP instances hosted by SSB, clients require nothing more than a web browser to access the service. AMP supports the most recent versions of all major web browsers.

Minimum Hardware Requirements

AMP Web Server

This server will run the AMP website using Apache and PHP. Suggested minimum profile:

  • 4G memory
  • 100G Diskspace
  • Dual-core 3.3Ghz processor

AMP Application Server

This server will run the AMP J2EE based testing engine. Suggested minimum profile:

  • 16G memory
  • 100G Diskspace
  • Quad-core 3.3Ghz processor

AMP Database Server

This server will run the AMP MySQL database. Suggested minimum profile:

  • 4G memory
  • 200G Diskspace
  • Single core 3.3Ghz processor

Platform Requirements

AMP is designed to run on both Windows and Linux across most implementations of each platform. Tested against Windows (2000, 2003, XP, Vista and 7) and Linux (kernels 2.2, 2.4, 2.8.) AMP requires the following core applications to be configured and available:

  • Apache 2.4
    • mod-rewrite
    • mod-ssl (if SSL is to be used)
    • mod-proxy
    • windows: proxy_connect_module and proxy_http_module
    • linux: proxy_http
    • mod-headers
  • PHP 5.5+ (but NOT 7), with the following extensions:
    • php5-curl
    • php5-mysql
    • php5-gd
    • php5-xml
    • mbstring
    • php5-mcrypt
    • php5-tidy
    • ZendGuardLoader
  • MySQL 5.6+
    • NOTE: If running MySQL 5.7, note that the default setting for “sql_mode” needs to be changed to “”. Full group by and strict transaction tables are NOT supported at this time, but are scheduled to be supported by the end of 2016.
  • Java 8 (1.8)
  • J2EE Server - See also J2EE Server
    • Wildly 10 (recommended)
    • JBoss EAP 6.2
    • WebLogic 12c
  • Firefox 45-47 Firefox Archive
  • Xvfb (on headless Linux/Other environment - not needed for Windows installations)
  • File extraction utilities
  • gzip
  • tar

Helpdesk access

To access Helpdesk, users must be able to reach https://amp.ssbbartgroup.com/ and https://helpdesk.ssbbartgroup.com/ in their browsers.

E-mail

  • An SMTP account to send e-mails as.
    • SMTP Host
    • SMTP Port
    • SMTP Authorized user (optional - though most SMTP accounts require one)
    • SMTP Authorized user Password (optional - though most SMTP accounts require one)

php.ini Settings

In general AMP is designed so that you will not need to make changes to your php.ini file. In some instances, though, you may need to override the default values in php.ini to achieve certain behavior. Specifically you may need to explicitly set the value for the following variables in php.ini should your configuration exhibit issues outside of expected behavior.

  • session.cookie_lifetime
  • session.gc_maxlifetime
  • max_input_vars - Set this to a number higher than 1000 (10000 should be ok). Alternatively, this can be set in the vhost.
  • date.timezone - In order for the Project Test Creation to work correctly, the date.timezone setting must be set. See http://www.php.net/manual/en/timezones.php
  • short-open-tag must be 'On'
  • zend_extension=<full_path_to_ZendGuardLoader dll/so>
  • zend_extension=<full_path_to_opcache  dll/so>

 

MySQL Setup

  • Make sure you can connect to MySQL using the client and root user.
  • Create the AMP Database user with the proper permissions, you will need to do this as the [MYSQL_ROOT_USERNAME] user, from the command line this is:
    • mysql -u [MYSQL_ROOT_USERNAME] -p
      • Enter the password for [MYSQL_ROOT_USERNAME] when prompted
  • This should start and log you in to the mysql client, then:
    • CREATE DATABASE [AMP_DB_NAME];
    • CREATE USER '[AMP_DB_USER]'@'localhost' IDENTIFIED BY '[AMP_DB_PASS]';
    • GRANT ALL PRIVILEGES ON [AMP_DB_NAME].* TO '[AMP_DB_USER]'@'localhost';
    • exit;

Windows

  • WAMP Server Home - Windows pre-built Apache / PHP / MySQL application stack.
    • [WAMP_INSTALLATION] is used hereafter as the base location where WAMP was installed to
    • [APACHE_VERSION] is used hereafter as the version of apache that was installed. At the time this document was written, this was 'Apache2.2.21'
  • Test that PHP and Apache are setup properly
    • Create a text file [WAMP_INSTALLATION]/www/test.php via Notepad under your WAMP server home
    • Add in <? phpinfo(); ?> to test.php
    • Save and close
    • Open your browser to http://[AMP_HOST]/test.php and confirm the installation is running

Apache Setup

  • Edit [WAMP_INSTALLATION]\bin\apache\[APACHE_VERSION]\conf\extra\httpd-vhosts.conf
    • For strong SSL configuration parameters, see http://httpd.apache.org/docs/current/ssl/ssl_howto.html#ciphersuites
    • Sample default site configuration file
# Send everything on 80 to 443
NameVirtualHost *:80
<VirtualHost *:80>
        RewriteEngine   on
        RewriteCond     %{SERVER_PORT} ^80$
        RewriteRule     ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
</VirtualHost>

# Configure 443 as amp host
NameVirtualHost *:443
<VirtualHost *:443>
        ServerSignature On
        ServerAdmin [SERVER_ADMIN]
        ServerName  [AMP_HOST]
        SSLEngine       On
SSLProxyEngine On SSLCertificateFile [SSL_CERT_FILE] SSLCertificateKeyFile [SSL_CERT_KEY_FILE] DocumentRoot [Installation Directory]/amp DirectoryIndex index.php <Directory />
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /api/(.*)$ /api/flight.php [QSA,L] Options FollowSymLinks AllowOverride AuthConfig FileInfo php_admin_value include_path [Installation Directory]/includes php_admin_value display_errors Off php_admin_value log_errors On php_admin_value short_open_tag On php_admin_value mysql.default_user [AMP_DB_USER] php_admin_value mysql.default_password [AMP_DB_PASS] php_admin_value max_input_vars 10000 php_flag magic_quotes_gpc Off

SetEnv FILE_WRITER_IMPLEMENTATION File_Writer_LocalWriter </Directory> LogLevel error ErrorLog [APACHE_LOGS]/amp-error.log CustomLog [APACHE_LOGS]/amp.log combined

#only necessary for mobile testing
<LocationMatch "/BluemixEndpoint">
ProxyPass [AMP_SERVICES_URL]/BluemixEndpoint
Header add Referer "[AMP_HOST]"
RequestHeader set Referer "[AMP_HOST]"
RequestHeader set transport "https"
</LocationMatch>
</VirtualHost>
  • Save the default file
  • If using SSL, ensure mod_rewrite and mod_ssl are active
    • For strong SSL configuration parameters, see http://httpd.apache.org/docs/current/ssl/ssl_howto.html#ciphersuitesor modify the SSL configuration file:
      • SSLCipherSuite AES128-SHA:HIGH:!aNULL:!MD5
      • SSLHonorCipherOrder on
      • SSLProtocol all -SSLv3 -TLSv1
  • To use HSTS, add the following to the vhost
    • Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
  • To disable TRACE, add the following to the main Apache config file:
    • TraceEnable off
  • To prevent XFRAME, add the following to the apache vhost
    • <FilesMatch ".(php)">
      Header always set X-Frame-Options SAMEORIGIN
      </FilesMatch>
  • To prevent secure content from being cached:
    • <FilesMatch "(?<!\.css|\.js|\.jpg|\.gif|\.png)$">
      Header set Cache-Control private, no-cache, no-store, max-age=0, no-transform
      </FilesMatch>

PHP Setup

  • Unzip the [AMP_ZIP_FILE] to your [INSTALLATION_DIRECTORY]. Note that this file is compressed with tar and gzip
  • Verify/create a directory [INSTALLATION_DIRECTORY]/amp/uploads/
    • If you would like to test HTML source code files by uploading them through the AMP Add Module screen or AMP Toolbar:
      • Create a folder iftb_source in your [INSTALLATION_DIRECTORY]
      • Create a folder documents in your [INSTALLATION_DIRECTORY]

Linux

  • All locations are given using standard Debian / Ubuntu layouts and assuming you are working under a standard user with sudo priviledges. timsp is used in command examples bellow.
  • Login to the machine
  • Create the installation location for amp
    • mkdir /amp

Apache Setup

  • Edit /etc/apache2/sites-available/default
    •  For strong SSL configuration parameters, see http://httpd.apache.org/docs/current/ssl/ssl_howto.html#ciphersuites
    • Sample default site configuration file
# Send everything on 80 to 443
NameVirtualHost *:80
<VirtualHost *:80>
        RewriteEngine   on
        RewriteCond     %{SERVER_PORT} ^80$
        RewriteRule     ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
</VirtualHost>

# Configure 443 as amp host
NameVirtualHost *:443
<VirtualHost *:443>
        ServerSignature On
        ServerAdmin [SERVER_ADMIN]
        ServerName  [AMP_HOST]
        SSLEngine       On
SSLProxyEngine On SSLCertificateFile [SSL_CERT_FILE] SSLCertificateKeyFile [SSL_CERT_KEY_FILE] DocumentRoot [Installation Directory]/amp DirectoryIndex index.php <Directory />
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /api/(.*)$ /api/flight.php [QSA,L] Options FollowSymLinks AllowOverride AuthConfig FileInfo php_admin_value include_path [Installation Directory]/includes php_admin_value display_errors Off php_admin_value log_errors On php_admin_value short_open_tag On php_admin_value mysql.default_user [AMP_DB_USER] php_admin_value mysql.default_password [AMP_DB_PASS] php_admin_value max_input_vars 10000 php_flag magic_quotes_gpc Off

SetEnv FILE_WRITER_IMPLEMENTATION File_Writer_LocalWriter </Directory> LogLevel error ErrorLog [APACHE_LOGS]/amp-error.log CustomLog [APACHE_LOGS]/amp.log combined

#only necessary for mobile testing
<LocationMatch "/BluemixEndpoint">
ProxyPass [AMP_SERVICES_URL]/BluemixEndpoint
Header add Referer "[AMP_HOST]"
RequestHeader set Referer "[AMP_HOST]"
RequestHeader set transport "https"
</LocationMatch> </VirtualHost>
  • For strong SSL configuration parameters, see http://httpd.apache.org/docs/current/ssl/ssl_howto.html#ciphersuites
  • Modify the SSL configuration file (RedHat: /etc/httpd/conf.d/ssl.conf, Debian: /etc/apache2/mods-enabled/ssl.conf)
    • SSLCipherSuite AES128-SHA:HIGH:!aNULL:!MD5
    • SSLHonorCipherOrder on
    • SSLProtocol all -SSLv3 -TLSv1
  • To use HSTS, add the following to the vhost
    • Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
  • To disable TRACE, add the following to the main Apache config file:
    • TraceEnable off
  • To prevent XFRAME, add the following to the apache vhost
    • <FilesMatch ".(php)">
      Header always set X-Frame-Options SAMEORIGIN
      </FilesMatch>
  • To prevent secure content from being cached:
    • <FilesMatch "(?<!\.css|\.js|\.jpg|\.gif|\.png)$">
      Header set Cache-Control private, no-cache, no-store, max-age=0, no-transform
      </FilesMatch>
  • Save the default file

Mobile testing 

Add the <LocationMatch "/BluemixEndpoint"> configuration block is added in the apache configuration file

Enable the following apache modules

  • headers
  • proxy
  • proxy_http

If using SSL Connections

  • If they are not active ensure mod_rewrite and mod_ssl are active
    • rewrite
    • ssl
  • Move to the /etc/ssl directory
    • If this directory isn't present you may need to install openssl
      • sudo [apt-get/yum] install openssl
      • sudo [apt-get/yum] install ca-certificates
  • Create a directory /etc/apache2/ssl/amp and switch to that directory
  • Generate a server key
    • sudo openssl genrsa -out amp.key 1024
  • Create a self-signed certificate for now
    • sudo openssl req -x509 -new -key amp.key -out amp.crt
  • Also go and generate a certificate request for a CA to sign
    • sudo openssl req -new -key amp.key -out amp.csr
  • Put the final certificate in amp/amp.crt when the certificate is signed
  • Set the final permissions for the files
    • sudo chown root amp.crt amp.key
    • sudo chmod 444 amp.crt
    • sudo chmod 400 amp.key
  • Check /etc/apache2/ports.conf to ensure Apache is listening on 443
    • Add the line "Listen 443" if it is not present
  • Do a force-reload on Apache (sudo /etc/init.d/apache2 force-reload)
  • References

PHP Setup

  • Move the [AMP_ZIP_FILE] to /amp and then unpack it tar -xzvf amp_2016_6.tar.gz this will create a folder called amp_2016_6 containing the AMP codebase ([INSTALLATION_DIRECTORY])
  • Verify/create a directory [INSTALLATION_DIRECTORY]/amp/uploads/
    • run the update_permissions.sh script ./update_permissions.sh which will allow your web server to generate AMP reports using InFocus
      • Before running, edit the file by replacing 'EXEC_GROUP' with the group that the apache process will run as  

Install the AMP database provided to you by SSB BART Group

  • LINUX (command line)
    • gunzip < [AMP_DATABASE_FILE] | mysql -u [AMP_DB_USER] -p[AMP_DB_PASS] -D [AMP_DB_NAME]
  • Windows
    • Unzip the [AMP_DATABASE_FILE] (thus creating [UNZIPPED_DATABASE_FILE])
    • From the command line issue the following command
      • mysql -u [AMP_DB_USER] -p[AMP_DB_PASS] -D [AMP_DB_NAME] < [UNZIPPED_DATABASE_FILE]
  • Login to the database using the amp user credentials.
    • mysql -u [AMP_DB_USER] -p[AMP_DB_PASS] -D [AMP_DB_NAME]
  • Confirm that the database is listed
    • SHOW databases;
  • Log out of the MySQL client and import the MySQL stored functions as the MySQL root user by running the following from the command line:
    • cd [INSTALLATION_DIRECTORY]/amp/admin/util/data/schema/
    • mysql -u [MYSQL_ROOT_USERNAME] -p -D [AMP_DB_NAME] < function_import.sql
      • Enter the password for [MYSQL_ROOT_USERNAME] when prompted
    • mysql -u [MYSQL_ROOT_USERNAME] -p -D [AMP_DB_NAME] < triggers_import.sql
      • Enter the password for [MYSQL_ROOT_USERNAME] when prompted

Verify

  • Log out of the MySQL client and import the MySQL storedAfter the steps above have been completed, your AMP installation should be ready for use! Please confirm by navigating to [AMP_HOST] and logging in.
  • Once logged in, navigate to the system requirements check page to verify everything is installed: http://[AMP_HOST]/verify.php

Backup

LINUX

You may optionally wish to setup an automated backup of your MySQL databases for your instance of AMP. To do so we recommend the following process:

  • Create a backup directory for AMP - /amp/backup/
  • Create a backup script that executes nightly, generally of the form below
 #!/bin/bash
 cd /amp/backup
 backup_file_name=amp.`date "+%d"`
 #Backup database
 /usr/bin/mysqldump -u [AMP_DB_USER] -p[AMP_DB_PASS] [AMP_DB_NAME] > $core_file_name
 #Zip the resulting file
 /bin/tar -czvf system_backup.`date "+%m%d"`.tar.gz $core_file_name
 #Remove the interim file
 rm $core_file_name

Mail Agent Setup

You are responsible for setting up a mail agent or SMTP server to enable you AMP server to send information to. For Linux installations SSB BART Group generally utilizes Postfix running on the local machine. For Window installations you can utilize a local SMTP server or configure PHP to utilize a remote SMTP server.

Postfix Setup

Detailed information on how to setup Postifx can be found in the Postfix Basic Setup How To. In general the process is as follows:

  • sudo [apt-get/yum] install postfix
    • Accept packages for install
    • Choose Internet Mail Site
    • For System Mail name, enter fqdn (i.e. client.ssbbartgroup.com)
  • sudo [apt-get/yum] install mailx

Java

J2EE Server

Starting in the Fall 2012 version of AMP, Automated Testing and Spidering are done on the rendered browser source via a Browser (Firefox). This is done via a Services webapp running in a Java Application Server such as Resin or JBoss or WebLogic

The AMP Services webapp uses Selenium to control a Browser (Firefox) to render the Web page (including executing javascript) and the HTML is then run through the Testing Engine and results are sent to the AMP report. Since the Browser requires a display, on servers that do not have a GUI/Windowing System Xvfb can be used to run the Browser.

See also Recoding Tests in AMP toolbar for Firefox

Requirements

Resin Configuration

In a resin installation, on a 16GB Ram machine, the following configuration ensures optimal results:

  • conf/resin.properties
 jvm_args  : -Xmx5120m -XX:MaxPermSize=1024m -XX:-UseConcMarkSweepGC

In a headless Linux/Other environment, in order to run Firefox on a virtual display (Xvfb) the webapp expects an environment variable with a display property. This should be a child of the root <resin> element

  • conf/resin.xml
  <system-property display=":1"/>

Installing/Running Resin

Note: Resin runs on port 8080 by default. Once Java, Resin, Firefox (and Xvfb) have been installed, and Resin is running

  bin/resin.sh start

And on headless enviroments Xvfb is running (in the background)

  Xvfb :1 -ac &

Can be confirmed by tailing the log

  tail -f log/jvm-app-0.log

The webapp provided by SSB BART GROUP can then be dropped into the /webapps directory of the resin installation. Resin should then auto-deploy the webapp. This can be confirmed by visiting [AMP_SERVICES_URL]/CrawlerManagerServlet (e.g. http://example.ssbbartgroup.com:8080/AMPJSONServices/CrawlerManagerServlet ) This is also used to view running spiders and the queue for them.

For Scheduled Spiders/Project Tests the webapps/AMPJSONServices/WEB-INF/web.xml can be edited to run more/less frequently. Additionally if [AMP_HOST] changes or is not configured, the values for amp host and credentials need to be updated.

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Level Access Support
www.levelaccess.com | 800.889.9659
© 2005 - 2018 - Level Access All rights reserved.
Privacy | Security | Credits | License