-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapache2-foreground
24 lines (19 loc) · 945 Bytes
/
apache2-foreground
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
set -e
# Change default dir on apache default site
sed -i 's./var/www/html./var/www/glpi.g' /etc/apache2/sites-available/000-default.conf
# Unpack glpi to /var/www/
#tar -C /var/www/ -xf /tmp/glpi.tgz
# Change permissions on default glpi dir
chown -R www-data /var/www/glpi/
# Note: we don't just use "apache2ctl" here because it itself is just a shell-script wrapper around apache2 which provides extra functionality like "apache2ctl start" for launching apache2 in the background.
# (also, when run as "apache2ctl <apache args>", it does not use "exec", which leaves an undesirable resident shell process)
: "${APACHE_CONFDIR:=/etc/apache2}"
: "${APACHE_ENVVARS:=$APACHE_CONFDIR/envvars}"
if test -f "$APACHE_ENVVARS"; then
. "$APACHE_ENVVARS"
fi
# Apache gets grumpy about PID files pre-existing
: "${APACHE_PID_FILE:=${APACHE_RUN_DIR:=/var/run/apache2}/apache2.pid}"
rm -f "$APACHE_PID_FILE"
exec apache2 -DFOREGROUND "$@"