annotate deploy/provision.d/100-apache-config.sh @ 1587:d8949733849d dockerise

Another rearrangement, to share provisioning scripts
author Chris Cannam
date Thu, 17 Aug 2017 11:55:29 +0100
parents extra/soundsoftware/scripted-deploy/vagrant/provision.d/100-apache-config.sh@ae8043b014c7
children 94669513c53c
rev   line source
Chris@1577 1 #!/bin/bash
Chris@1577 2
Chris@1577 3 set -e
Chris@1577 4
Chris@1577 5 cd /var/www/code
Chris@1577 6
Chris@1587 7 codeconffile=/var/www/code/deploy/config/code.conf
Chris@1587 8
Chris@1587 9 if [ ! -f "$codeconffile" ]; then
Chris@1587 10 echo "ERROR: Apache config file $codeconffile not found - has the database secret been interpolated from $codeconffile.in correctly?"
Chris@1587 11 exit 2
Chris@1587 12 fi
Chris@1587 13
Chris@1577 14 if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then
Chris@1577 15
Chris@1577 16 rm -f /etc/apache2/sites-enabled/000-default.conf
Chris@1577 17
Chris@1587 18 cp deploy/config/passenger.conf /etc/apache2/mods-available/
Chris@1587 19 cp deploy/config/passenger.load /etc/apache2/mods-available/
Chris@1587 20 cp deploy/config/perl.conf /etc/apache2/mods-available/
Chris@1577 21
Chris@1577 22 ln -s ../mods-available/passenger.conf /etc/apache2/mods-enabled/
Chris@1577 23 ln -s ../mods-available/passenger.load /etc/apache2/mods-enabled/
Chris@1577 24 ln -s ../mods-available/perl.conf /etc/apache2/mods-enabled/
Chris@1577 25 ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/
Chris@1577 26 ln -s ../mods-available/rewrite.load /etc/apache2/mods-enabled/
Chris@1578 27 ln -s ../mods-available/cgi.load /etc/apache2/mods-enabled/
Chris@1577 28
Chris@1587 29 cp "$codeconffile" /etc/apache2/sites-available/code.conf
Chris@1577 30 ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf
Chris@1577 31
Chris@1577 32 apache2ctl configtest
Chris@1577 33
Chris@1577 34 fi
Chris@1577 35