2016-07-25 02:54:40 +00:00
|
|
|
#!/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
|
|
|
|
2016-08-12 18:14:18 +00:00
|
|
|
function a2setModule(){
|
|
|
|
local enable=${1:-''}
|
|
|
|
local path=${3:-'/etc/apache2/httpd.conf'}
|
|
|
|
local scom=''
|
|
|
|
local rcom='\#'
|
|
|
|
if [ ! -z $1 ] && [ ! -z "$2" ]; then
|
|
|
|
if [ "$enable" = 1 ]; then
|
|
|
|
scom='\#'
|
|
|
|
rcom=''
|
|
|
|
fi
|
|
|
|
echo "$2"
|
|
|
|
sed -i "s#${scom}LoadModule $2_module modules/mod_$2.so#${rcom}LoadModule $2_module modules/mod_$2.so#" "$path"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
if [ ! -f /usr/lib/libxml2.so ]; then
|
|
|
|
ln -s /usr/lib/libxml2.so.2 /usr/lib/libxml2.so
|
|
|
|
fi
|
|
|
|
if [ ! -d /run/apache2 ]; then
|
|
|
|
mkdir /run/apache2
|
|
|
|
fi
|
2017-03-15 03:35:10 +00:00
|
|
|
|
2016-07-25 02:54:40 +00:00
|
|
|
chmod -R 755 /scripts/pre-init.d
|
2016-07-29 15:09:39 +00:00
|
|
|
mkdir -p /run/apache2
|
|
|
|
chown apache:apache /run/apache2
|
2016-08-12 18:14:18 +00:00
|
|
|
|
|
|
|
initTitle "Apache" "Loading Modules"
|
|
|
|
a2setModule 1 "rewrite"
|
|
|
|
a2setModule 1 "mpm_prefork"
|
|
|
|
a2setModule 1 "slotmem_shm"
|
|
|
|
a2setModule 1 "heartmonitor"
|
|
|
|
a2setModule 1 "watchdog"
|
|
|
|
initTitle "Apache" "Removing Modules"
|
|
|
|
a2setModule 0 "mpm_event"
|
|
|
|
a2setModule 0 "proxy_fdpass" /etc/apache2/conf.d/proxy.conf
|
|
|
|
|
|
|
|
sed -i "s|;*date.timezone =.*|date.timezone = ${TZ}|i" /etc/php5/php.ini
|
2016-07-29 11:51:56 +00:00
|
|
|
sed -ir 's/expose_php = On/expose_php = Off/' /etc/php5/php.ini
|
2016-07-25 02:54:40 +00:00
|
|
|
echo -e "\nIncludeOptional /app/vhost" >> /etc/apache2/httpd.conf
|
2016-08-09 01:08:26 +00:00
|
|
|
unset tmpsed
|