Bug 55989 - write to error log upon RewriteRule [F]orbidden
Summary: write to error log upon RewriteRule [F]orbidden
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_rewrite (show other bugs)
Version: 2.2.22
Hardware: All Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2014-01-11 19:21 UTC by Viktor Szépe
Modified: 2014-10-31 22:33 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Viktor Szépe 2014-01-11 19:21:53 UTC
Is it possible to write to error log - like mod_authz_host - upon HTTP/403 with RewriteRule?

Thank you!
Comment 1 Eric Covener 2014-01-11 19:27:07 UTC
Bugzilla is for reporting bugs, not support or Q&A.  If you're suggesting an enhancement for 2.2, please reopen and reclassify.
Comment 2 Viktor Szépe 2014-01-11 19:31:19 UTC
Sorry! I know it.
I've just notived recently that fail2ban does not ban RewriteRule [F] requests.

And yes, this is a feature request.
I'd like to have "client denied by server configuration:" - like in mod_authz_host - written to the error log.
Comment 3 Viktor Szépe 2014-10-18 10:11:38 UTC
I think that this is a one-liner in the source code.
Could you please add this error message.
Thank you!
Comment 4 Rainer Jung 2014-10-19 18:03:18 UTC
Using Apache 2.4 you can add custom logging using mod_log_debug.
E.g. set your own env var in the RewriteRule as a side effect and then use mod_log_debug to log your chosen message when the env var is set.

This feature doesn't exist for 2.2 though.

I'm not judging on whether a builtin log statement makes sense w.r.t. consistency with AAA modules.


Comment 5 Viktor Szépe 2014-10-19 22:19:47 UTC
Thank you for the mod_log_debug suggestion!

I think enabling another module is the last resort.
Comment 6 Viktor Szépe 2014-10-31 22:33:28 UTC
Is it function call needed to write in the error log?
I think is should be in "case 'F':" in mod_rewrite.c.

              "client denied by server configuration: %s%s",
              r->filename ? "" : "uri ",
              r->filename ? r->filename : r->uri);