3 # Install and configure apache2
4 # Has to be run as admin
5 # @todo make this work across all apache versions (precise to focal)
9 SCRIPT_DIR="$(dirname -- "$(readlink -f "$0")")"
11 DEBIAN_FRONTEND=noninteractive apt-get install -y apache2
13 # set up Apache for php-fpm
14 # @see https://github.com/travis-ci/travis-ci.github.com/blob/master/docs/user/languages/php.md#apache--php
16 a2enmod rewrite proxy_fcgi setenvif ssl
18 # in case mod-php was enabled (this is the case on at least github's ubuntu with php 5.x and shivammathur/setup-php)
19 # @todo silence errors in a smarter way
20 rm /etc/apache2/mods-enabled/php* || true
22 # configure apache virtual hosts
24 cp -f "$SCRIPT_DIR/../config/apache_vhost" /etc/apache2/sites-available/000-default.conf
26 if [ -n "${TRAVIS}" -o -n "${GITHUB_ACTIONS}" ]; then
27 echo "export TESTS_ROOT_DIR=$(pwd)" >> /etc/apache2/envvars
29 echo "export TESTS_ROOT_DIR=/var/www/html" >> /etc/apache2/envvars
31 echo "export HTTPSERVER=localhost" >> /etc/apache2/envvars
33 service apache2 restart