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 @ 1607:1c904260787b
History | View | Annotate | Download (1.53 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 | 1602:b22e234c3c7b | Chris | codeconf=/var/www/code/deploy/config/code.conf.gen |
| 10 | codeconfssl=/var/www/code/deploy/config/code-ssl.conf.gen |
||
| 11 | 1606:16325d2ab2dd | Chris | staticconf=/var/www/code/deploy/config/soundsoftware-static.conf |
| 12 | 1587:d8949733849d | Chris | |
| 13 | 1602:b22e234c3c7b | Chris | if [ ! -f "$codeconf" ]; then |
| 14 | echo "ERROR: Apache config file $codeconf not found - has the database secret been interpolated from its input file correctly?" |
||
| 15 | 1587:d8949733849d | Chris | exit 2 |
| 16 | fi |
||
| 17 | |||
| 18 | 1577:e38eee2e1d47 | Chris | if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then |
| 19 | |||
| 20 | rm -f /etc/apache2/sites-enabled/000-default.conf |
||
| 21 | |||
| 22 | 1587:d8949733849d | Chris | cp deploy/config/passenger.conf /etc/apache2/mods-available/ |
| 23 | cp deploy/config/passenger.load /etc/apache2/mods-available/ |
||
| 24 | cp deploy/config/perl.conf /etc/apache2/mods-available/ |
||
| 25 | 1577:e38eee2e1d47 | Chris | |
| 26 | ln -s ../mods-available/passenger.conf /etc/apache2/mods-enabled/ |
||
| 27 | ln -s ../mods-available/passenger.load /etc/apache2/mods-enabled/ |
||
| 28 | ln -s ../mods-available/perl.conf /etc/apache2/mods-enabled/ |
||
| 29 | ln -s ../mods-available/expires.load /etc/apache2/mods-enabled/ |
||
| 30 | ln -s ../mods-available/rewrite.load /etc/apache2/mods-enabled/ |
||
| 31 | 1578:06ca2df3d7ca | Chris | ln -s ../mods-available/cgi.load /etc/apache2/mods-enabled/ |
| 32 | 1605:18643ab36008 | Chris | ln -s ../mods-available/ssl.load /etc/apache2/mods-enabled/ |
| 33 | 1577:e38eee2e1d47 | Chris | |
| 34 | 1602:b22e234c3c7b | Chris | cp "$codeconf" /etc/apache2/sites-available/code.conf |
| 35 | cp "$codeconfssl" /etc/apache2/sites-available/code-ssl.conf |
||
| 36 | 1606:16325d2ab2dd | Chris | cp "$staticconf" /etc/apache2/sites-available/soundsoftware-static.conf |
| 37 | 1577:e38eee2e1d47 | Chris | ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf |
| 38 | |||
| 39 | apache2ctl configtest |
||
| 40 | |||
| 41 | fi |