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 @ 1595:98384d0defa0
History | View | Annotate | Download (1.21 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 |
codeconffile=/var/www/code/deploy/config/code.conf.gen |
| 10 |
|
| 11 |
if [ ! -f "$codeconffile" ]; then |
| 12 |
echo "ERROR: Apache config file $codeconffile not found - has the database secret been interpolated from its input file correctly?" |
| 13 |
exit 2 |
| 14 |
fi |
| 15 |
|
| 16 |
if [ ! -f /etc/apache2/sites-enabled/10-code.conf ]; then |
| 17 |
|
| 18 |
rm -f /etc/apache2/sites-enabled/000-default.conf |
| 19 |
|
| 20 |
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 |
|
| 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 |
ln -s ../mods-available/cgi.load /etc/apache2/mods-enabled/ |
| 30 |
|
| 31 |
cp "$codeconffile" /etc/apache2/sites-available/code.conf |
| 32 |
ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf |
| 33 |
|
| 34 |
apache2ctl configtest |
| 35 |
|
| 36 |
fi |
| 37 |
|