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 @ 1610:c6bee0e62957
History | View | Annotate | Download (1.6 KB)
| 1 |
#!/bin/bash |
|---|---|
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
# Install Apache config files and module loaders |
| 6 |
|
| 7 |
cd /var/www/code |
| 8 |
|
| 9 |
codeconf=/var/www/code/deploy/config/code.conf.gen |
| 10 |
codeconfssl=/var/www/code/deploy/config/code-ssl.conf.gen |
| 11 |
staticconf=/var/www/code/deploy/config/soundsoftware-static.conf |
| 12 |
|
| 13 |
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 |
exit 2 |
| 16 |
fi |
| 17 |
|
| 18 |
if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then |
| 19 |
|
| 20 |
rm -f /etc/apache2/sites-enabled/000-default.conf |
| 21 |
|
| 22 |
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 |
|
| 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 |
ln -s ../mods-available/cgi.load /etc/apache2/mods-enabled/ |
| 32 |
ln -s ../mods-available/ssl.load /etc/apache2/mods-enabled/ |
| 33 |
ln -s ../mods-available/auth_digest.load /etc/apache2/mods-enabled/ |
| 34 |
|
| 35 |
cp "$codeconf" /etc/apache2/sites-available/code.conf |
| 36 |
cp "$codeconfssl" /etc/apache2/sites-available/code-ssl.conf |
| 37 |
cp "$staticconf" /etc/apache2/sites-available/soundsoftware-static.conf |
| 38 |
ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf |
| 39 |
|
| 40 |
apache2ctl configtest |
| 41 |
|
| 42 |
fi |
| 43 |
|