Skip to content

HTTPServer

DebRez edited this page Jul 29, 2019 · 11 revisions

HTTP Server Setup

This page describes how to setup the MTT HTTP Server used for submitting and viewing MTT results. Most of the code is written in PHP.

Apache Setup

To install Apache2 with PHP support the following packages need to be installed (package names may differ based on your specific operating system):
apache2
php7
apache2-mod_php7

Make sure you have Apache setup with PHP. In the following sections we assume you have a directory called $WWW_ROOT/www/mtt that resolves to the address http://my-server/mtt. Make sure the file upload size settings are high enough to accept MTTDatabase submissions:

/etc/php.ini:
; Maximum allowed size for uploaded files.
upload_max_filesize = 20M

/etc/httpd/conf/httpd.conf:
# Limit Upload to 20Mb
LimitRequestBody 20971520

MTT Setup

  1. Copy the files in MTT_TRUNK/server/php to $WWW_ROOT/www/mtt. Make sure the files are readable by the Apache user.
cp -R $MTT_TRUNK/server/php $WWW_ROOT/www/mtt
  1. Create a tmp directory in $WWW_ROOT/www/mtt/. This directory should be readable and writable by the Apache user since this is where graphs are temporarily stored.
mkdir $WWW_ROOT/www/mtt/tmp
chmod a +rw $WWW_ROOT/www/mtt/tmp
  1. Edit the $WWW_ROOT/www/mtt/config.inc file.
  • If you have a Google Analytics account you can specify the account number in the $mtt_google_analytics_account field.
  • Set the database name in $mtt_database_name as follows:
# Database name
$mtt_database_name = "mtt";
  • Set the database username in $mtt_database_username to the PostgreSQL user that will be accessing the database.
  • Set the database user's password. There is an example of how to specify this in a text file if you do not want to put it in plain text here for security reasons.
  1. Go to http://my-server/mtt and you should see the reporter running.
  2. MTT Clients can submit data to http://my-server/mtt/submit.
Clone this wiki locally