Re: Apache2 Conditional Logging help [Followup]
From: Colin J. Raven (colin_at_kenmore.kozy-kabin.nl)
Date: 01/15/05
- Previous message: Frank Staals: "Re: Software mirgration from Windows for my friend"
- In reply to: Colin J. Raven: "Apache2 Conditional Logging help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 15 Jan 2005 12:43:26 +0100 To: FreeBSD Questions <freebsd-questions@freebsd.org>
On Jan 15 at 12:26, I said:
> I'm trying to supress logging of such things as favicon.ico, gifs and
> jpegs. In a home server environment (right now anyway) I just don't
> think it's necessary to log serving of those items.
>
> Accordingly, some googling seemed to point me towards doing something
> like this:
> ########################################
> SetEnvIf Request_URI "\.gif$" dontlog
> SetEnvIf Request_URI "\.jpg$" dontlog
> SetEnvIf Request_URI "\.jpeg$" dontlog
>
> But this doesn't work - at all. Images are still being logged
> My images are in /path/to/web_data/images, so perhaps that has something
> to do with it. I can't figure out the syntax to accomplish calling the
> path proerly though. Various kinds of fiddling with the syntax and
> restarting httpd hasn't worked.
>
> Part of the problem is that apachectl configtest doesn't complain about
> syntax no matter how I fiddle with any of these. It just reports "Syntax
> OK" and when I restart there are no logfile errors.
>
FOLLOWUP
I found this gem at:
http://httpd.apache.org/docs-2.0/env.html#examples
SetEnvIf Request_URI \.gif image-request
SetEnvIf Request_URI \.jpg image-request
SetEnvIf Request_URI \.png image-request
CustomLog /var/log/httpd-access.log combined env=!image-request
Restarted httpd and no more images (of the kind described above anyway)
were logged.
Still outstanding is the other task of conditionally logging attempted
exploits, (but not the output) and confirming URL-rewriting is working
as per my other post this morning.
Regards to all,
-Colin
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
- Previous message: Frank Staals: "Re: Software mirgration from Windows for my friend"
- In reply to: Colin J. Raven: "Apache2 Conditional Logging help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]