mirror of
https://github.com/danog/php.git
synced 2024-12-03 18:07:57 +01:00
f2bd9a3edd
Fixes #250 Signed-off-by: Tao Wang <twang2218@gmail.com>
27 lines
860 B
Bash
Executable File
27 lines
860 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# 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_PID_FILE:=${APACHE_RUN_DIR:=/var/run/apache2}/apache2.pid}"
|
|
|
|
# setup directories and permissions
|
|
mkdir -p /run/lock
|
|
for dir in ${APACHE_RUN_DIR} ${APACHE_LOCK_DIR}
|
|
do
|
|
mkdir -p ${dir}
|
|
chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"
|
|
done
|
|
|
|
# Apache gets grumpy about PID files pre-existing
|
|
rm -f "$APACHE_PID_FILE"
|
|
|
|
exec apache2 -DFOREGROUND "$@"
|