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

Bug#711925: apache2-doc's config file breaks apache itself



On 2013-07-24 22:07:02 +0200, Stefan Fritsch wrote:
> Am Mittwoch, 24. Juli 2013, 21:37:18 schrieb Vincent Lefevre:
> > dpkg: apache2.2-common: dependency problems, but removing anyway as
> > you requested:
> > 
> >  apache2-mpm-worker depends on apache2.2-common (= 2.2.22-13).
> > 
> >  apache2 depends on apache2.2-common (= 2.2.22-13).
> > 
> 
> ...
> 
> > 
> > Removing apache2.2-common ...
> > 
> > Purging configuration files for apache2.2-common ...
> 
> This is the problem. You have used --purge-unused (with aptitude) or 
> --purge (with apt-get) while upgrading. Or the respective config 
> options have been set in the apt/aptitude configuration files. This 
> won't work and we will document that in the release notes. It will 
> delete your old configuration (which is in apache2.2-common) before 
> the new apache2 with the new configuration and the upgrade logic is 
> installed. The aptitude man page clearly states the dangers of this 
> option, but unfortunately the apt-get man page doesn't.

OK, I had thought that the --purge problem was affecting apache2 only.
Looking at the command history, I had done a "a2ensite 000-default.conf",
thinking that this would solve the problem, and tried to restart apache2.
Then I saw the error due to apache2-doc and thought this was a new
problem, since its own config files were not purged (as apache2-doc
was never removed, just upgraded).

It's rather strange that apache2-doc depends on config files from a
different package and doesn't make sure that the config is OK when
upgrading (apache2-doc was upgraded *after* apache2.2-common was
purged).

There may be a bug in "/etc/apache2/conf-available/apache2-doc.conf".
It contains:

Alias /manual /usr/share/doc/apache2-doc/manual/

<Directory "/usr/share/doc/apache2-doc/manual/">
    Options Indexes FollowSymlinks
    AllowOverride None
    Require all granted
    AddDefaultCharset off
</Directory>

thus depends on the alias module being there, but the dependency
is not enforced anywhere. What if for some reason the alias module
gets disabled in the future? Shouldn't a IfModule directive be used
in order to avoid the full Apache server being down just because of
apache2-doc?

Something like that:

<IfModule alias_module>

    Alias /manual /usr/share/doc/apache2-doc/manual/

    <Directory "/usr/share/doc/apache2-doc/manual/">
        Options Indexes FollowSymlinks
        AllowOverride None
        Require all granted
        AddDefaultCharset off
    </Directory>

</IfModule>

(like what is done in /etc/apache2/mods-available/alias.conf).

And some way to warn the admin when the alias module is disabled
(but when the problem occurs, looking at the apache2-doc config
gives the answer).

Shouldn't there be some dependency system for Apache modules?
e.g. "a2dismod alias" would fail if some config file declares
a dependency on the module.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: