Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 97355 invoked from network); 5 Jun 2004 14:11:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 5 Jun 2004 14:11:58 -0000 Received: (qmail 80757 invoked by uid 500); 5 Jun 2004 14:11:48 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 80708 invoked by uid 500); 5 Jun 2004 14:11:47 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 80695 invoked by uid 99); 5 Jun 2004 14:11:47 -0000 Received: from [200.48.36.148] (HELO correo.speedy.com.pe) (200.48.36.148) by apache.org (qpsmtpd/0.27.1) with ESMTP; Sat, 05 Jun 2004 07:11:47 -0700 Received: by correo.speedy.com.pe (Postfix, from userid 48) id 9ABA81C4240; Sat, 5 Jun 2004 09:08:55 -0500 (PET) Received: from 200.106.21.76 ( [200.106.21.76]) as user ricilake.speedygo@imap.terra.com.pe by correo.speedy.com.pe with HTTP; Sat, 5 Jun 2004 09:08:55 -0500 Message-ID: <1086444535.40c1d3f78e08b@correo.speedy.com.pe> Date: Sat, 5 Jun 2004 09:08:55 -0500 From: ricilake@speedy.com.pe To: dev@httpd.apache.org Subject: Better error logging for mod_access MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.1 X-Originating-IP: 200.106.21.76 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 files). 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 -- resuming normal operations [Fri May 28 22:19:24 2004] [error] [client 192.168.1.33] client denied by order directive at line 362 of /opt/apache2/conf/httpd.conf for: /opt/apache2/htdocs/bar [Fri May 28 22:19:33 2004] [error] [client 192.168.1.33] client denied by deny directive at line 2 of /opt/apache2/htdocs/foo/.htaccess for: /opt/apache2/ htdocs/foo [Fri May 28 22:19:45 2004] [error] [client 192.168.1.33] client denied by deny directive at line 2 of /opt/apache2/htdocs/foo/.htaccess for: /opt/apache2/ htdocs/foo/file [Fri May 28 22:19:54 2004] [error] [client 192.168.1.33] client denied by deny directive at line 411 of /opt/apache2/conf/httpd.conf for: /opt/apache2/ htdocs/foo/.htaccess 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