annotate deploy/provision.d/100-apache-config.sh @ 1621:3a510bf6a9bc

Merge from live branch
author Chris Cannam
date Fri, 13 Jul 2018 10:44:33 +0100
parents b8e5e9734526
children
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@1602 9 codeconf=/var/www/code/deploy/config/code.conf.gen
Chris@1602 10 codeconfssl=/var/www/code/deploy/config/code-ssl.conf.gen
Chris@1606 11 staticconf=/var/www/code/deploy/config/soundsoftware-static.conf
Chris@1587 12
Chris@1602 13 if [ ! -f "$codeconf" ]; then
Chris@1602 14 echo "ERROR: Apache config file $codeconf not found - has the database secret been interpolated from its input file correctly?"
Chris@1587 15 exit 2
Chris@1587 16 fi
Chris@1587 17
Chris@1577 18 if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then
Chris@1577 19
Chris@1577 20 rm -f /etc/apache2/sites-enabled/000-default.conf
Chris@1577 21
Chris@1587 22 cp deploy/config/passenger.conf /etc/apache2/mods-available/
Chris@1587 23 cp deploy/config/passenger.load /etc/apache2/mods-available/
Chris@1587 24 cp deploy/config/perl.conf /etc/apache2/mods-available/
Chris@1577 25
Chris@1608 26 ln -s ../mods-available/passenger.conf /etc/apache2/mods-enabled/
Chris@1608 27 ln -s ../mods-available/passenger.load /etc/apache2/mods-enabled/
Chris@1608 28 ln -s ../mods-available/perl.conf /etc/apache2/mods-enabled/
Chris@1608 29 ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/
Chris@1608 30 ln -s ../mods-available/rewrite.load /etc/apache2/mods-enabled/
Chris@1608 31 ln -s ../mods-available/cgi.load /etc/apache2/mods-enabled/
Chris@1608 32 ln -s ../mods-available/ssl.load /etc/apache2/mods-enabled/
Chris@1608 33 ln -s ../mods-available/auth_digest.load /etc/apache2/mods-enabled/
Chris@1577 34
Chris@1602 35 cp "$codeconf" /etc/apache2/sites-available/code.conf
Chris@1602 36 cp "$codeconfssl" /etc/apache2/sites-available/code-ssl.conf
Chris@1606 37 cp "$staticconf" /etc/apache2/sites-available/soundsoftware-static.conf
Chris@1577 38 ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf
Chris@1577 39
Chris@1577 40 apache2ctl configtest
Chris@1577 41
Chris@1577 42 fi
Chris@1577 43