2016-07-25 02:54:40 +00:00
|
|
|
#!/usr/bin/bash
|
2016-08-06 00:29:06 +00:00
|
|
|
# @app pluie/alpine-apache
|
|
|
|
# @author a-Sansara https://git.pluie.org/pluie/docker-images
|
2016-07-25 02:54:40 +00:00
|
|
|
|
2017-03-15 03:35:10 +00:00
|
|
|
if [ ! -d /app/$WWW_DIR ]; then
|
|
|
|
CREATE_WWW_DIR=1
|
|
|
|
mkdir -p /app/$WWW_DIR
|
|
|
|
fi
|
|
|
|
if [ ! -f /app/$WWW_DIR/$WWW_INDEX ]; then
|
|
|
|
echo "<?php phpinfo();" > /app/$WWW_DIR/$WWW_INDEX
|
|
|
|
fi
|
2017-07-05 19:20:53 +00:00
|
|
|
tmpsed=/etc/apache2/httpd.conf
|
|
|
|
sed -i 's#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g' "$tmpsed"
|
|
|
|
sed -i 's#AllowOverride none#AllowOverride All#' "$tmpsed"
|
2017-03-15 03:35:10 +00:00
|
|
|
|
2016-08-09 01:08:26 +00:00
|
|
|
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
|
|
|
|
chown -R 1000:apache /app/$WWW_DIR
|
2016-07-25 02:54:40 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
touch /var/log/apache2/error.log
|
|
|
|
|
|
|
|
tail -F /var/log/apache2/error.log &
|