From http://issues.apache.org/bugzilla/show_bug.cgi?id=21035: If LimitRequestBody directive is set for a apache web server with user defined ErrorDocument configured (for 413 error) and a client sends request exceeding the value set in LimitRequestBody then apache does not display the user defined ErrorDocument. It instead displays the standard 413 error document with an additional note "Additionally, a 413 Request Entity Too Large error was encountered while trying to use an ErrorDocument to handle the request." This is an upstream problem, but as you can see in the apache bugzilla it's known to the apache developers for years without anyone caring about - although a patch is available here http://www.mail-archive.com/dev%40httpd.apache.org/msg16835.html I always add the patch to the apache ebuild i copied from the portage to my local overlay, but it's annoying to do it every time the apache herd releases a new ebuild. I'd really like to see this patch included in the gentoo-apache patchset.
Created attachment 82098 [details, diff] Patch for apache-1.3.* to fix the ErrorDocument problem
We don't support third-party patches for apache - they become too difficult to manage (i.e. in the case of a security issue). If/when upstream fixes this is when we'll fix it.
Okay. I just discovered the ebuild hooks. I use this feature now to apply my patch automatically after src_unpack...