forked from drnoa/sqlledger_docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsupervisord-apache2.sh
More file actions
37 lines (34 loc) · 1.42 KB
/
supervisord-apache2.sh
File metadata and controls
37 lines (34 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Configuring Apache AllowOverride
ALLOW_OVERRIDE=${OVERRIDE:-false}
if [ "$ALLOW_OVERRIDE" = true ] ; then
a2enmod rewrite
sed -i -r 's/AllowOverride None$/AllowOverride All/' /etc/apache2/apache2.conf
fi
if [ "$ALLOW_OVERRIDE" = false ] ; then
a2dismod rewrite
sed -i -r 's/AllowOverride All$/AllowOverride None/' /etc/apache2/apache2.conf
fi
# Configuring PHP open_short_tag
OPEN_SHORT_TAG=${SHORT_TAG:-false}
if [ "$OPEN_SHORT_TAG" = true ] ; then
sed -i -r 's/short_open_tag = Off$/short_open_tag = On/' /etc/php5/apache2/php.ini
sed -i -r 's/short_open_tag = Off$/short_open_tag = On/' /etc/cli/apache2/php.ini
fi
if [ "$OPEN_SHORT_TAG" = false ] ; then
sed -i -r 's/short_open_tag = On$/short_open_tag = Off/' /etc/php5/apache2/php.ini
sed -i -r 's/short_open_tag = On$/short_open_tag = Off/' /etc/cli/apache2/php.ini
fi
# Configuring PHP display_errors
DISPLAY_ERRORS=${ERRORS:-false}
if [ "$DISPLAY_ERRORS" = true ] ; then
sed -i -r 's/display_errors = Off$/display_errors = On/' /etc/php5/apache2/php.ini
sed -i -r 's/display_errors = Off$/display_errors = On/' /etc/cli/apache2/php.ini
fi
if [ "$DISPLAY_ERRORS" = false ] ; then
sed -i -r 's/display_errors = On$/display_errors = Off/' /etc/php5/apache2/php.ini
sed -i -r 's/display_errors = On$/display_errors = Off/' /etc/cli/apache2/php.ini
fi
# Starting the apache2 server
source /etc/apache2/envvars
exec apache2 -D FOREGROUND