Item2550: ApacheConfigGenerator prevents apache from serving internal /error documents
Priority: Urgent
Current State: New
Released In:
Target Release: n/a
ShortURLs are a fairly commonly used feature of the generator.
But it has a major flaw: when
ShortURLs at the root of the domain, such as foswiki.org are configured, Apache is unable to access its internal /error documents, Eg.:
Error 408 Request Timeout tries to load (on one of my servers):
/error/HTTP_REQUEST_TIME_OUT.html.var
But actually, because we
Alias / "/path/to/foswiki/bin/view/"
, it ends up at
"/path/to/foswiki/bin/view/error/HTTP_REQUEST_TIME_OUT.html.var"
(or apache barfs with "unable to show error document")
It actually lives at
/usr/share/apache2/error/HTTP_REQUEST_TIME_OUT.html.var
on the filesystem.
Further, if I have Aliases configured for other things in this domain, eg.
/awstats
, strange things happen with the 401 auth message which I sadly cannot recall atm but will do more digging if required.
The fix is to place an
Alias /error "/path/to/apache2/error"
right above the
Alias / "/path/to/foswiki/bin/view/"
however for the
ApacheConfigGenerator, unless we want to ask the user where their apache error documents live, we should just use something like (untested):
RewriteRule !^\/error\/ /path/to/foswiki/bin/view/ [NE]
instead of an Alias
See also:
Item2549
--
PaulHarvey - 02 Jan 2010