a2dissite nije radio ispravno na Debian lenny. lenny
authorDragan Dosen <bane@nekkar.carnet.hr>
Mon, 1 Jun 2009 15:45:06 +0000 (17:45 +0200)
committerDragan Dosen <bane@nekkar.carnet.hr>
Mon, 1 Jun 2009 15:45:06 +0000 (17:45 +0200)
Manje izmjene pri koristenju install_vhost().

debian/postinst
debian/prerm

index 5e654b7..41a96aa 100755 (executable)
@@ -131,7 +131,7 @@ generate_ssl () {
 #
 listen_ssl() {
 
-       if [ ! -f "$PORTCONF" ] || ! egrep -iq "^[[:space:]]*Listen[[:space:]]*.*443$" "$PORTCONF"; then
+       if [ ! -f "$PORTCONF" ] || ! egrep -iq "^[[:space:]]*Listen[[:space:]]+443$" "$PORTCONF"; then
        
                cp_echo "CN: Enabling SSL port (443) for Apache2 web server."
 
@@ -449,7 +449,11 @@ if [ -z "$2" ]; then
 
        chk_conf_tag "$CONFDIR/sites-available/$FQDN"
        if [ ! -f "$CONFDIR/sites-available/$FQDN" ] || [ $RET -eq 0 ]; then
-               install_vhost -nvh -d -r www.$DOMAIN default $FQDN 000-$FQDN
+               if egrep -qi "^[[:space:]]*NameVirtualHost[[:space:]]+\*:80$" "$PORTCONF"; then
+                       install_vhost -d -r www.$DOMAIN default $FQDN 000-$FQDN
+               else
+                       install_vhost -nvh -d -r www.$DOMAIN default $FQDN 000-$FQDN
+               fi
                need_restart=1
        fi
 
@@ -467,7 +471,11 @@ if [ -z "$2" ]; then
 
        chk_conf_tag "$CONFDIR/sites-available/$FQDN"
        if [ ! -f "$CONFDIR/sites-available/$FQDN" ] || [ $RET -eq 0 ]; then
-               install_vhost -nvh -d -r $FQDN default $FQDN 000-$FQDN
+               if egrep -qi "^[[:space:]]*NameVirtualHost[[:space:]]+\*:80$" "$PORTCONF"; then
+                       install_vhost -d -r $FQDN default $FQDN 000-$FQDN
+               else
+                       install_vhost -nvh -d -r $FQDN default $FQDN 000-$FQDN
+               fi
                need_restart=1
        fi
     fi
@@ -485,7 +493,13 @@ if [ $apache2_sslcert -eq 0 ]; then
        # No active SSL VirtualHosts found - add new one.
        chk_conf_tag "$CONFDIR/sites-available/ssl"
        if [ ! -f "$CONFDIR/sites-available/ssl" ] || [ $RET -eq 0 ]; then
-               install_vhost -r $FQDN -n $HOST ssl ssl 001-ssl
+
+               db_get apache2-cn/wwwhost || true
+               if [ "$RET" = "true" ]; then
+                       install_vhost -r www.$DOMAIN -n $HOST ssl ssl 001-ssl
+               else
+                       install_vhost -r $FQDN -n $HOST ssl ssl 001-ssl
+               fi
                need_restart=1
        fi
 fi
index 34e7db6..7bc72f1 100755 (executable)
@@ -33,7 +33,7 @@ case "$1" in
                        if [ -e "$sitesendir/$site" ]; then
 
                            cp_echo "CN: Disabling $site site configuration."
-                           a2dissite $site >/dev/null || true
+                           rm -f $sitesendir/$site
                        fi
                    done
                fi