#!/usr/bin/env sh

set -ev

sudo apt-get update \
&& sudo apt-get install apache2 libapache2-mod-fastcgi \
&& sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf \
&& sudo a2enmod rewrite actions fastcgi alias \
&& echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini \
&& ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm \
&& sudo cp -f build/travis/vhost-apache /etc/apache2/sites-available/default \
&& sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default \
&& sudo service apache2 restart

#!/usr/bin/env sh

set -ev

sudo apt-get update \
&& sudo apt-get install apache2 libapache2-mod-fastcgi \
&& sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf \
&& sudo a2enmod rewrite actions fastcgi alias \
&& echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini \
&& ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm \
&& sudo cp -f $TRAVIS_BUILD_DIR/ci/travis/vhost-apache /etc/apache2/sites-available/default \
&& sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default \
&& sudo service apache2 restart

Fix path to travis vhost
Fix path to travis vhost
