Fixed a2enmod

This commit is contained in:
Brad Warren 2015-10-11 17:29:19 -07:00
parent 4c73db9aa1
commit 90f3b26bcf

View file

@ -1,6 +1,6 @@
#!/bin/bash
# An extremely simplified version of `a2enmod` for enabling modules in the
# httpd docker image. First argument is the server_root and the second is the
# httpd docker image. First argument is the ServerRoot and the second is the
# module to be enabled.
confdir=$1
@ -8,10 +8,11 @@ module=$2
echo "LoadModule ${module}_module " \
"/usr/local/apache2/modules/mod_${module}.so" >> "${confdir}/test.conf"
available_conf=$APACHE_CONFDIR"/mods-available/${module}.conf"
enabled_dir=$APACHE_CONFDIR"/mods-enabled"
enabled_conf=$enabled_dir"/"$1".conf"
if [ -e "$available_conf" -a -d "$enabled_dir" -a ! -e "$enabled_conf" ]
availbase="/mods-available/${module}.conf"
availconf=$confdir$availbase
enabldir="$confdir/mods-enabled"
enablconf="$enabldir/${module}.conf"
if [ -e $availconf -a -d $enabldir -a ! -e $enablconf ]
then
ln -s "..$available_base" $enabled_conf
ln -s "..$availbase" $enablconf
fi