To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / deploy / provision.d / 100-apache-config.sh @ 1590:c18460da6620
History | View | Annotate | Download (1.21 KB)
| 1 | 1577:e38eee2e1d47 | Chris | #!/bin/bash |
|---|---|---|---|
| 2 | |||
| 3 | set -e |
||
| 4 | |||
| 5 | 1589:94669513c53c | Chris | # Install Apache config files and module loaders |
| 6 | |||
| 7 | 1577:e38eee2e1d47 | Chris | cd /var/www/code |
| 8 | |||
| 9 | 1587:d8949733849d | Chris | codeconffile=/var/www/code/deploy/config/code.conf |
| 10 | |||
| 11 | if [ ! -f "$codeconffile" ]; then |
||
| 12 | echo "ERROR: Apache config file $codeconffile not found - has the database secret been interpolated from $codeconffile.in correctly?" |
||
| 13 | exit 2 |
||
| 14 | fi |
||
| 15 | |||
| 16 | 1577:e38eee2e1d47 | Chris | if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then |
| 17 | |||
| 18 | rm -f /etc/apache2/sites-enabled/000-default.conf |
||
| 19 | |||
| 20 | 1587:d8949733849d | Chris | cp deploy/config/passenger.conf /etc/apache2/mods-available/ |
| 21 | cp deploy/config/passenger.load /etc/apache2/mods-available/ |
||
| 22 | cp deploy/config/perl.conf /etc/apache2/mods-available/ |
||
| 23 | 1577:e38eee2e1d47 | Chris | |
| 24 | ln -s ../mods-available/passenger.conf /etc/apache2/mods-enabled/ |
||
| 25 | ln -s ../mods-available/passenger.load /etc/apache2/mods-enabled/ |
||
| 26 | ln -s ../mods-available/perl.conf /etc/apache2/mods-enabled/ |
||
| 27 | ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/ |
||
| 28 | ln -s ../mods-available/rewrite.load /etc/apache2/mods-enabled/ |
||
| 29 | 1578:06ca2df3d7ca | Chris | ln -s ../mods-available/cgi.load /etc/apache2/mods-enabled/ |
| 30 | 1577:e38eee2e1d47 | Chris | |
| 31 | 1587:d8949733849d | Chris | cp "$codeconffile" /etc/apache2/sites-available/code.conf |
| 32 | 1577:e38eee2e1d47 | Chris | ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf |
| 33 | |||
| 34 | apache2ctl configtest |
||
| 35 | |||
| 36 | fi |