move the apache config code into alternc.install

this makes sure that apache is properly restarted after install and factors code out of the two postinst files
This commit is contained in:
Antoine Beaupré 2008-10-07 17:21:18 +00:00
parent 57b5a642cb
commit 0184e3c641
3 changed files with 29 additions and 60 deletions

View File

@ -166,34 +166,6 @@ EOF
echo "running alternc.install" echo "running alternc.install"
alternc.install alternc.install
if [ -x /usr/sbin/apache ]; then
if [ ! -h /etc/apache-ssl/conf.d/alternc.conf ] && [ -e /etc/apache-ssl/conf.d/ ]; then
ln -sf /etc/alternc/apache-ssl.conf \
/etc/apache-ssl/conf.d/alternc.conf
fi
if [ ! -h /etc/apache/conf.d/alternc.conf ] && [ -e /etc/apache/conf.d/ ]; then
ln -sf /etc/alternc/apache.conf \
/etc/apache/conf.d/alternc.conf
fi
if [ ! -h /etc/apache/conf.d/override_php.conf ] && [ -e /etc/apache/conf.d/ ]; then
ln -sf /var/alternc/apacheconf/override_php.conf \
/etc/apache/conf.d/override_php.conf
fi
fi
if [ -x /usr/sbin/apache2 ]; then
if [ ! -h /etc/apache2/conf.d/alternc.conf ] && [ -e /etc/apache2/conf.d/ ]; then
ln -sf /etc/alternc/apache2.conf \
/etc/apache2/conf.d/alternc.conf
fi
if [ ! -h /etc/apache2/conf.d/override_php.conf ] && [ -e /etc/apache2/conf.d/ ]; then
ln -sf /var/alternc/apacheconf/override_php.conf \
/etc/apache2/conf.d/override_php.conf
fi
fi
;; ;;
abort-upgrade|abort-remove|abort-deconfigure) abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -199,33 +199,6 @@ EOF
# Add basedir protection # Add basedir protection
/usr/lib/alternc/basedir_prot.sh /usr/lib/alternc/basedir_prot.sh
if [ -x /usr/sbin/apache ]; then
if [ ! -h /etc/apache-ssl/conf.d/alternc.conf ] && [ -e /etc/apache-ssl/conf.d/ ]; then
ln -sf /etc/alternc/apache-ssl.conf \
/etc/apache-ssl/conf.d/alternc.conf
fi
if [ ! -h /etc/apache/conf.d/alternc.conf ] && [ -e /etc/apache/conf.d/ ]; then
ln -sf /etc/alternc/apache.conf \
/etc/apache/conf.d/alternc.conf
fi
if [ ! -h /etc/apache/conf.d/override_php.conf ] && [ -e /etc/apache/conf.d/ ]; then
ln -sf /var/alternc/apacheconf/override_php.conf \
/etc/apache/conf.d/override_php.conf
fi
fi
if [ -x /usr/sbin/apache2 ]; then
if [ ! -h /etc/apache2/conf.d/alternc.conf ] && [ -e /etc/apache2/conf.d/ ]; then
ln -sf /etc/alternc/apache2.conf \
/etc/apache2/conf.d/alternc.conf
fi
if [ ! -h /etc/apache2/conf.d/override_php.conf ] && [ -e /etc/apache2/conf.d/ ]; then
ln -sf /var/alternc/apacheconf/override_php.conf \
/etc/apache2/conf.d/override_php.conf
fi
fi
;; ;;
abort-upgrade|abort-remove|abort-deconfigure) abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -188,13 +188,37 @@ then
fi fi
echo "LoadModule ${php}_module /usr/lib/apache/1.3/lib${php}.so" | append_no_dupe /etc/apache/modules.conf echo "LoadModule ${php}_module /usr/lib/apache/1.3/lib${php}.so" | append_no_dupe /etc/apache/modules.conf
echo "LoadModule ${php}_module /usr/lib/apache/1.3/lib${php}.so" | append_no_dupe /etc/apache-ssl/modules.conf echo "LoadModule ${php}_module /usr/lib/apache/1.3/lib${php}.so" | append_no_dupe /etc/apache-ssl/modules.conf
if [ ! -h /etc/apache-ssl/conf.d/alternc.conf ] && [ -e /etc/apache-ssl/conf.d/ ]; then
ln -sf /etc/alternc/apache-ssl.conf /etc/apache-ssl/conf.d/alternc.conf
fi
if [ ! -h /etc/apache/conf.d/alternc.conf ] && [ -e /etc/apache/conf.d/ ]; then
ln -sf /etc/alternc/apache.conf /etc/apache/conf.d/alternc.conf
fi
if [ ! -h /etc/apache/conf.d/override_php.conf ] && [ -e /etc/apache/conf.d/ ]; then
ln -sf /var/alternc/apacheconf/override_php.conf /etc/apache/conf.d/override_php.conf
fi
SERVICES="$SERVICES apache apache-ssl" SERVICES="$SERVICES apache apache-ssl"
fi fi
if [ -x /usr/sbin/apache2 ] && ! ( [ -L /etc/apache2/mods-enabled/vhost_alias.load ] && [ -L /etc/apache2/mods-enabled/$php.load ] ) if [ -x /usr/sbin/apache2 ]; then
then s=""
if ! ( [ -L /etc/apache2/mods-enabled/vhost_alias.load ] && [ -L /etc/apache2/mods-enabled/$php.load ] )
then
a2enmod vhost_alias a2enmod vhost_alias
a2enmod $php a2enmod $php
SERVICES="$SERVICES apache2" s="apache2"
fi
if [ ! -h /etc/apache2/conf.d/alternc.conf ] && [ -e /etc/apache2/conf.d/ ]; then
ln -sf /etc/alternc/apache2.conf /etc/apache2/conf.d/alternc.conf
s="apache2"
fi
if [ ! -h /etc/apache2/conf.d/override_php.conf ] && [ -e /etc/apache2/conf.d/ ]; then
ln -sf /var/alternc/apacheconf/override_php.conf /etc/apache2/conf.d/override_php.conf
s="apache2"
fi
SERVICES="$SERVICES $s"
fi fi
# Copy postfix *_checks if they do not exist # Copy postfix *_checks if they do not exist