From: Dragan Dosen Date: Mon, 1 Jun 2009 15:45:06 +0000 (+0200) Subject: a2dissite nije radio ispravno na Debian lenny. X-Git-Tag: v2.2+2~2 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=3856ea6e5dfd3b51301b2e52bffb1c0557dbdeb7;p=apache2-cn.git a2dissite nije radio ispravno na Debian lenny. Manje izmjene pri koristenju install_vhost(). --- diff --git a/debian/postinst b/debian/postinst index 5e654b7..41a96aa 100755 --- a/debian/postinst +++ b/debian/postinst @@ -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 diff --git a/debian/prerm b/debian/prerm index 34e7db6..7bc72f1 100755 --- a/debian/prerm +++ b/debian/prerm @@ -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