Chris@1577: #!/bin/bash Chris@1577: Chris@1577: set -e Chris@1577: Chris@1589: # Install Apache config files and module loaders Chris@1589: Chris@1577: cd /var/www/code Chris@1577: Chris@1593: codeconffile=/var/www/code/deploy/config/code.conf.gen Chris@1587: Chris@1587: if [ ! -f "$codeconffile" ]; then Chris@1593: echo "ERROR: Apache config file $codeconffile not found - has the database secret been interpolated from its input file correctly?" Chris@1587: exit 2 Chris@1587: fi Chris@1587: Chris@1577: if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then Chris@1577: Chris@1577: rm -f /etc/apache2/sites-enabled/000-default.conf Chris@1577: Chris@1587: cp deploy/config/passenger.conf /etc/apache2/mods-available/ Chris@1587: cp deploy/config/passenger.load /etc/apache2/mods-available/ Chris@1587: cp deploy/config/perl.conf /etc/apache2/mods-available/ Chris@1577: Chris@1577: ln -s ../mods-available/passenger.conf /etc/apache2/mods-enabled/ Chris@1577: ln -s ../mods-available/passenger.load /etc/apache2/mods-enabled/ Chris@1577: ln -s ../mods-available/perl.conf /etc/apache2/mods-enabled/ Chris@1577: ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/ Chris@1577: ln -s ../mods-available/rewrite.load /etc/apache2/mods-enabled/ Chris@1578: ln -s ../mods-available/cgi.load /etc/apache2/mods-enabled/ Chris@1577: Chris@1587: cp "$codeconffile" /etc/apache2/sites-available/code.conf Chris@1577: ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf Chris@1577: Chris@1577: apache2ctl configtest Chris@1577: Chris@1577: fi Chris@1577: