httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Better error logging for mod_access
Date Sat, 05 Jun 2004 14:08:55 GMT
Hi, all.

I've been following the #apache channel on freenode, and it seemed to me that 
a lot of people trying to configure apache have trouble with mod_access 
configurations. So it occurred to me that it would be easier for them if 
mod_access produced more informative logs, identifying the filename and line 
number of the directive which caused the denial (including in .htaccess 

The patch here: <> for 
2.0.49 creates logs that look like this:

[Fri May 28 22:19:16 2004] [notice] Apache/2.0.49 (Unix) configured -- 
normal operations
[Fri May 28 22:19:24 2004] [error] [client] client denied by 
order directive at line 362 of /opt/apache2/conf/httpd.conf for:
[Fri May 28 22:19:33 2004] [error] [client] client denied by deny
directive at line 2 of /opt/apache2/htdocs/foo/.htaccess for: /opt/apache2/
[Fri May 28 22:19:45 2004] [error] [client] client denied by deny
directive at line 2 of /opt/apache2/htdocs/foo/.htaccess for: /opt/apache2/
[Fri May 28 22:19:54 2004] [error] [client] client denied by deny
directive at line 411 of /opt/apache2/conf/httpd.conf for: /opt/apache2/

There should not be much performance impact from this patch -- the only thing 
it does is copy a filepath (limited to a maximum of 80 characters) into 
mod_access's config for each mod_access directive. Of course, those 80 
characters will add up in a big complex config file; but I figured it would 
not be likely that it would be used on a production server. Probably the best 
thing would be to have both mod_access and the patched mod_access as loadable 
modules, so you could enable or disable by changing the LoadModule line.

I hope this helps someone (and thanks to DrBacchus for hosting the patch and 
providing the kick to do it.)

Rici Lake

View raw message