fix apache $WWW-DIR creation

This commit is contained in:
a-sansara 2017-03-15 04:35:10 +01:00
parent 9852484282
commit 3951d9deb1
16 changed files with 40 additions and 28 deletions

Binary file not shown.

View File

@ -20,19 +20,12 @@ function a2setModule(){
if [ ! -f /usr/lib/libxml2.so ]; then
ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml2.so
fi
if [ ! -d /app/$WWW_DIR ]; then
mkdir -p /app/$WWW_DIR
fi
if [ ! -d /run/apache2 ]; then
mkdir /run/apache2
fi
chown -R 1000:apache /app/$WWW_DIR
chmod -R 755 /scripts/pre-init.d
mkdir -p /run/apache2
chown apache:apache /run/apache2
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
initTitle "Apache" "Loading Modules"
a2setModule 1 "rewrite"
a2setModule 1 "mpm_event"

View File

@ -2,6 +2,17 @@
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
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
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR
fi

View File

@ -6,7 +6,7 @@ if [ ! -z "/app/vhost" ]; then
cat <<EOF > "/app/vhost"
<VirtualHost *:80>
ServerName $HTTP_SERVER_NAME
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=\$1
<FilesMatch \.php$>
SetHandler proxy:fcgi://127.0.0.1:9000
</FilesMatch>

Binary file not shown.

View File

@ -22,21 +22,14 @@ fi
if [ ! -f /usr/lib/libxml2.so ]; then
ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml2.so
fi
if [ ! -d /app/$WWW_DIR ]; then
mkdir -p /app/$WWW_DIR
fi
if [ ! -d /run/apache2 ]; then
mkdir /run/apache2
fi
chown -R 1000:apache /app/$WWW_DIR
chmod -R 755 /scripts/pre-init.d
mkdir -p /run/apache2
chown apache:apache /run/apache2
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
initTitle "Apache" "Loading Modules"
a2setModule 1 "rewrite"
a2setModule 1 "mpm_prefork"

View File

@ -2,6 +2,17 @@
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
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
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR
fi

View File

@ -6,7 +6,7 @@ if [ ! -z "/app/vhost" ]; then
cat <<EOF > "/app/vhost"
<VirtualHost *:80>
ServerName $HTTP_SERVER_NAME
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=\$1
<Directory /app/$WWW_DIR>
AllowOverride None
Require all granted

Binary file not shown.

View File

@ -19,21 +19,14 @@ function a2setModule(){
if [ ! -f /usr/lib/libxml2.so ]; then
ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml2.so
fi
if [ ! -d /app/$WWW_DIR ]; then
mkdir -p /app/$WWW_DIR
fi
if [ ! -d /run/apache2 ]; then
mkdir /run/apache2
fi
chown -R 1000:apache /app/$WWW_DIR
chmod -R 755 /scripts/pre-init.d
mkdir -p /run/apache2
chown apache:apache /run/apache2
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
initTitle "Apache" "Loading Modules"
a2setModule 1 "rewrite"
a2setModule 1 "mpm_prefork"

View File

@ -2,6 +2,17 @@
# @app pluie/alpine-apache
# @author a-Sansara https://git.pluie.org/pluie/docker-images
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
tmpsed='s#^DocumentRoot ".*#DocumentRoot "/app/'$WWW_DIR'"#g'
sed -i "$tmpsed" /etc/apache2/httpd.conf
sed -i 's#AllowOverride none#AllowOverride All#' /etc/apache2/httpd.conf
if [ ! -z "$FIX_OWNERSHIP" ] && [ "$FIX_OWNERSHIP" -eq 1 ] && [ -d /app/$WWW_DIR ]; then
chown -R 1000:apache /app/$WWW_DIR
fi

View File

@ -6,7 +6,7 @@ if [ ! -z "/app/vhost" ]; then
cat <<EOF > "/app/vhost"
<VirtualHost *:80>
ServerName $HTTP_SERVER_NAME
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=\$1
<Directory /app/$WWW_DIR>
AllowOverride None
Require all granted

Binary file not shown.

View File

@ -2,7 +2,7 @@
# @app pluie/alpine-symfony
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -d /app/$WWW_DIR ]; then
if [ -z "$CREATE_WWW_DIR" ]; then
cd /tmp
mkdir $WWW_DIR
symfony new app $SYMFONY_VERSION

Binary file not shown.

View File

@ -2,7 +2,7 @@
# @app pluie/alpine-symfony
# @author a-Sansara https://git.pluie.org/pluie/docker-images
if [ ! -d /app/$WWW_DIR ]; then
if [ -z "$CREATE_WWW_DIR" ]; then
cd /tmp
ls -la /tmp
mkdir $WWW_DIR