[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#396782: apache2.2-common: Upgrade adds "default" virtual host; breaks existing config



severity 396782 important
thanks

* Don Geddis (don@geddis.org) [061102 13:05]:
> I had a working apache2 configuration, with many virtual hosts.
> After this recent upgrade, parts of my web sites stopped working.
> I eventually discovered that the upgrade had added a new
> 	000-default
> virtual host to
> 	/etc/apache2/sites-enabled/

> Surely the error is that a new "000-default" virtual host should not be
> inserted into an existing working apache configuration.  Just that by itself
> (introducing an unexpected and unneeded new virtual web site) would be
> annoying, but in this case it had the additional effect of disabling part of
> my existing configuration.

The problem is that apache2.2-common adds the site on a new install, and
even upgrades are considered new installs, as apache2.2-common wasn't in
sarge anyways.


I propose to change this check
        if [ ! -L /etc/apache2/sites-enabled/000-default -a \
             ! -f /etc/apache2/sites-enabled/000-default ]; then
                ln -s /etc/apache2/sites-available/default /etc/apache2/sites-enabled/000-default
        fi
to
        if [ ! -L /etc/apache2/sites-enabled/000-default -a \
             ! -f /etc/apache2/sites-enabled/000-default -a] && \
             [ $(find /etc/apache2/sites-enabled/ -mindepth 1 -type f -o -type l | wc -l) -eq 0 ]; then
                ln -s /etc/apache2/sites-available/default /etc/apache2/sites-enabled/000-default
        fi

(one could consider to add a "-maxdepth 1" and also, the first two
checks could probably be dropped as well).

Cheers,
Andi
-- 
  http://home.arcor.de/andreas-barth/



Reply to: