try to reload apache2 too, install symlinks for apache2 if available

This commit is contained in:
Antoine Beaupré 2007-09-09 20:31:35 +00:00
parent e421523021
commit 233397e37a
2 changed files with 27 additions and 13 deletions

34
debian/postinst vendored
View File

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

View File

@ -180,7 +180,7 @@ touch /var/run/alternc/refresh_slave
# Apache will not start without this file # Apache will not start without this file
touch /var/alternc/apacheconf/override_php.conf touch /var/alternc/apacheconf/override_php.conf
php=`dpkg -l libapache-mod-php* | grep ^ii | sed -e 's/^.*libapache.\?-mod-php\(.\).*$/php\1/' | tail -1` php=`dpkg -l libapache*-mod-php* | grep ^ii | sed -e 's/^.*libapache.\?-mod-php\(.\).*$/php\1/' | tail -1`
if [ -x /usr/sbin/apache ] if [ -x /usr/sbin/apache ]
then then
# Enable vhost_alias apache module at the right place (ie: BEFORE mod_alias) # Enable vhost_alias apache module at the right place (ie: BEFORE mod_alias)
@ -190,11 +190,13 @@ 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
SERVICES="$SERVICES apache apache-ssl"
fi fi
if [ -x /usr/sbin/apache2 ] if [ -x /usr/sbin/apache2 ]
then then
a2enmod vhost_alias a2enmod vhost_alias
a2enmod $php a2enmod $php
SERVICES="$SERVICES apache2"
fi fi
# Copy postfix *_checks if they do not exist # Copy postfix *_checks if they do not exist
@ -247,7 +249,7 @@ fi
####################################################################### #######################################################################
# Reload services # Reload services
# #
for service in apache apache-ssl postfix bind9 courier-authdaemon \ for service in $SERVICES postfix bind9 courier-authdaemon \
courier-imap courier-imap-ssl courier-pop courier-pop-ssl \ courier-imap courier-imap-ssl courier-pop courier-pop-ssl \
cron proftpd; do cron proftpd; do
test -x /etc/init.d/$service && invoke-rc.d $service reload || true test -x /etc/init.d/$service && invoke-rc.d $service reload || true