Bug#467004: apache2: Apply IfModule to the internationalized error messages stanza of config
Package: apache2
Version: 2.2.8-1
Severity: wishlist
Tags: patch
The shipped apache2.conf ends (before the last two include directives)
with a section dealing with internationalized error responses. This
is commented out but preceded by a comment saying
# The internationalized error documents require mod_alias, mod_include
# and mod_negotiation. To activate them, uncomment the following 30 lines.
It would make more sense to simply wrap these 30 lines in suitable
IfModule directives and leave the uncommented by default. <patch>
@@ -1,3 +1,4 @@
+# -*- Mode: Apache -*-
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
@@ -240,42 +252,43 @@
# even on a per-VirtualHost basis. The default include files will display
# your Apache version number and your ServerAdmin email address regardless
# of the setting of ServerSignature.
-#
-# The internationalized error documents require mod_alias, mod_include
-# and mod_negotiation. To activate them, uncomment the following 30 lines.
-
-# Alias /error/ "/usr/share/apache2/error/"
-#
-# <Directory "/usr/share/apache2/error">
-# AllowOverride None
-# Options IncludesNoExec
-# AddOutputFilter Includes html
-# AddHandler type-map var
-# Order allow,deny
-# Allow from all
-# LanguagePriority en cs de es fr it nl sv pt-br ro
-# ForceLanguagePriority Prefer Fallback
-# </Directory>
-#
-# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
-# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
-# ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
-# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
-# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
-# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
-# ErrorDocument 410 /error/HTTP_GONE.html.var
-# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
-# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
-# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
-# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
-# ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
-# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
-# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
-# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
-# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
-# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
-
+<IfModule mod_negotiation.c>
+ <IfModule mod_include.c>
+ <IfModule mod_alias.c>
+ Alias /error/ "/usr/share/apache2/error/"
+
+ <Directory "/usr/share/apache2/error">
+ AllowOverride None
+ Options IncludesNoExec
+ AddOutputFilter Includes html
+ AddHandler type-map var
+ Order allow,deny
+ Allow from all
+ LanguagePriority en cs de es fr it nl sv pt-br ro
+ ForceLanguagePriority Prefer Fallback
+ </Directory>
+
+ ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
+ ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
+ ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
+ ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
+ ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
+ ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
+ ErrorDocument 410 /error/HTTP_GONE.html.var
+ ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
+ ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
+ ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
+ ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
+ ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
+ ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
+ ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
+ ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
+ ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
+ ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
+ </IfModule>
+ </IfModule>
+</IfModule>
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
</patch> and it would clearly be even better to move the result (and
the comments preceding it) to a separate conf.d/localized-error (left
as a trivial exercise for whoever merges the patch).
-- Package-specific info:
Config file syntax check failed.
List of /etc/apache2/mods-enabled/*.load:
alias auth_basic authn_file authnz_ldap authz_default authz_host
authz_user autoindex cgid dir* env ldap mime negotiation perl
setenvif ssl status userdir
(A * means that the .conf file for that module is not enabled in
/etc/apache2/mods-enabled/)
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.22-3-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.ISO-8859-15, LC_CTYPE=en_GB.ISO-8859-15 (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash
Versions of packages apache2 depends on:
ii apache2-mpm-worker 2.2.8-1 High speed threaded model for Apac
apache2 recommends no packages.
-- no debconf information
Reply to: