From 233397e37a77672f43bc88667b7c43179695462b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Sun, 9 Sep 2007 20:31:35 +0000 Subject: [PATCH] try to reload apache2 too, install symlinks for apache2 if available --- debian/postinst | 34 +++++++++++++++++++++++----------- install/alternc.install | 6 ++++-- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/debian/postinst b/debian/postinst index 78e47fb4..6c3183b4 100644 --- a/debian/postinst +++ b/debian/postinst @@ -157,21 +157,33 @@ EOF echo "running alternc.install" alternc.install - if [ ! -h /etc/apache-ssl/conf.d/alternc.conf ]; then - ln -sf /etc/alternc/apache-ssl.conf \ - /etc/apache-ssl/conf.d/alternc.conf - fi + if [ -x /usr/sbin/apache ]; then + if [ ! -h /etc/apache-ssl/conf.d/alternc.conf ]; then + ln -sf /etc/alternc/apache-ssl.conf \ + /etc/apache-ssl/conf.d/alternc.conf + fi - if [ ! -h /etc/apache/conf.d/alternc.conf ]; then - ln -sf /etc/alternc/apache.conf \ - /etc/apache/conf.d/alternc.conf - fi + if [ ! -h /etc/apache/conf.d/alternc.conf ]; then + ln -sf /etc/alternc/apache.conf \ + /etc/apache/conf.d/alternc.conf + fi - if [ ! -h /etc/apache/conf.d/override_php.conf ]; then - ln -sf /var/alternc/apacheconf/override_php.conf \ - /etc/apache/conf.d/override_php.conf + if [ ! -h /etc/apache/conf.d/override_php.conf ]; 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 ]; 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) diff --git a/install/alternc.install b/install/alternc.install index ac9fa5aa..7aa9fdbb 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -180,7 +180,7 @@ touch /var/run/alternc/refresh_slave # Apache will not start without this file 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 ] then # Enable vhost_alias apache module at the right place (ie: BEFORE mod_alias) @@ -190,11 +190,13 @@ then 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-ssl/modules.conf + SERVICES="$SERVICES apache apache-ssl" fi if [ -x /usr/sbin/apache2 ] then a2enmod vhost_alias a2enmod $php + SERVICES="$SERVICES apache2" fi # Copy postfix *_checks if they do not exist @@ -247,7 +249,7 @@ fi ####################################################################### # 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 \ cron proftpd; do test -x /etc/init.d/$service && invoke-rc.d $service reload || true