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

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/php7/apache2/php.ini:
; Maximum allowed size for uploaded files.
upload_max_filesize = 20M
; Maximum size of POST data that PHP will accept.
post_max_size = 20M

Create a virtual host configuration in Apache2 for the MTT Reporter server.

  1. cd to /etc/apache2/vhosts.d. May be /etc/httpd/vhosts.d
  2. cp vhost.template mtt_reporter.conf
  3. Edit the mtt_reporter.conf to reflect your setup.

<VirtualHost *:80>
    ServerName your_server_name.here
    DocumentRoot $WWW_ROOT/www/
    ErrorLog /var/www/mtt/tmp/log/MTT_Reporter_error.log
    CustomLog /var/www/mtt/tmp/log/access.log combined
    <Directory "$WWW_ROOT/www/mtt">
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
        # Limit Upload to 20Mb
        LimitRequestBody 20971520
    </Directory>
</VirtualHost>

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