Other than greping each night how would one set up a log file for a
user/directory on apache 1.3.0. The sub site does not have its own domain
name so a vitrual host setup would not work would it?
Here is a solution to a problem I had a little while ago. I wanted to
have Apache keep 3 separate log files: 1 for requests from me, a 2nd
for nimda virus attacks, and a 3rd for everything else.
The key to the solution was to use "!" to unset environment variables
in certain cases. Joshua Slive pointed this out for me.
I'm posting this here because I can't find a way to use Google to
reply to those old posts of mine.
Here's an example that will log requests from a specific IP address
(presumably the webmaster's) to one file, and log nimda virus attacks
to another file. A third log file will hold all the remaining
SetEnvIf Remote_Addr "w\.x\.y\.z" localaccess=1
SetEnvIf localaccess 1 dontlog
# Here, !localaccess will keep nimda requests out of the localaccess
SetEnvIf Request_URI "^/scripts" nimda=1 !localaccess
SetEnvIf Request_URI "^/c/winnt" nimda=1 !localaccess
SetEnvIf Request_URI "^/_mem_bin" nimda=1 !localaccess
SetEnvIf Request_URI "^/_vti_bin" nimda=1 !localaccess
SetEnvIf Request_URI "^/MSADC" nimda=1 !localaccess
SetEnvIf Request_URI "^/msadc" nimda=1 !localaccess
SetEnvIf Request_URI "^/d/winnt" nimda=1 !localaccess
SetEnvIf nimda 1 dontlog
CustomLog logs/localaccess.log combined env=localaccess
CustomLog logs/nimda.log combined env=nimda
CustomLog logs/everythingelse.log combined env=!dontlog
I've received a couple emails about this problem, so I figure this
will help someone out.