annotate deploy/provision.d/100-apache-config.sh @ 1600:ed9c467ef922 dockerise

Add hggit extension
author Chris Cannam
date Wed, 23 Aug 2017 11:32:50 +0100
parents 83412a0a2389
children b22e234c3c7b
rev   line source
Chris@1577 1 #!/bin/bash
Chris@1577 2
Chris@1577 3 set -e
Chris@1577 4
Chris@1589 5 # Install Apache config files and module loaders
Chris@1589 6
Chris@1577 7 cd /var/www/code
Chris@1577 8
Chris@1593 9 codeconffile=/var/www/code/deploy/config/code.conf.gen
Chris@1587 10
Chris@1587 11 if [ ! -f "$codeconffile" ]; then
Chris@1593 12 echo "ERROR: Apache config file $codeconffile not found - has the database secret been interpolated from its input file correctly?"
Chris@1587 13 exit 2
Chris@1587 14 fi
Chris@1587 15
Chris@1577 16 if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then
Chris@1577 17
Chris@1577 18 rm -f /etc/apache2/sites-enabled/000-default.conf
Chris@1577 19
Chris@1587 20 cp deploy/config/passenger.conf /etc/apache2/mods-available/
Chris@1587 21 cp deploy/config/passenger.load /etc/apache2/mods-available/
Chris@1587 22 cp deploy/config/perl.conf /etc/apache2/mods-available/
Chris@1577 23
Chris@1577 24 ln -s ../mods-available/passenger.conf /etc/apache2/mods-enabled/
Chris@1577 25 ln -s ../mods-available/passenger.load /etc/apache2/mods-enabled/
Chris@1577 26 ln -s ../mods-available/perl.conf /etc/apache2/mods-enabled/
Chris@1577 27 ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/
Chris@1577 28 ln -s ../mods-available/rewrite.load /etc/apache2/mods-enabled/
Chris@1578 29 ln -s ../mods-available/cgi.load /etc/apache2/mods-enabled/
Chris@1577 30
Chris@1587 31 cp "$codeconffile" /etc/apache2/sites-available/code.conf
Chris@1577 32 ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf
Chris@1577 33
Chris@1577 34 apache2ctl configtest
Chris@1577 35
Chris@1577 36 fi
Chris@1577 37