Hi,
I find my present default logging in Apache ("common" format) isnt upto my needs - I need to deduce / check / think out things rather than the info being easy for me to glean from it.
So I went through google+docs and made up a few rules.
I'm not sure where to put the directives, though.
I want detailed access logs but not for the entries that are generated from the server itself.
The default access_log file is overflowing with entries which begin with 127.0.0.1, eg.
I dont want these entries in my customised log file which I will use for analysis.
So I have to produce the following effect:
and
But I'm unsure where to write the SetEnvIf line - and whether or not I need to enclose it in
I guess all this goes in the Include Editor from WHM:
Any help is greatly appreciated.
Thanks in advance,
Regards,
Dave
I find my present default logging in Apache ("common" format) isnt upto my needs - I need to deduce / check / think out things rather than the info being easy for me to glean from it.
So I went through google+docs and made up a few rules.
I'm not sure where to put the directives, though.
I want detailed access logs but not for the entries that are generated from the server itself.
The default access_log file is overflowing with entries which begin with 127.0.0.1, eg.
Code:
127.0.0.1 - - [05/Nov/2012:03:06:21 +0800] "OPTIONS * HTTP/1.0" 200 -
127.0.0.1 - - [05/Nov/2012:03:06:22 +0800] "OPTIONS * HTTP/1.0" 200 -
127.0.0.1 - - [05/Nov/2012:03:06:22 +0800] "OPTIONS * HTTP/1.0" 200 -
So I have to produce the following effect:
Code:
SetEnvIf Remote_Addr ^127\.0\.0\.1$ localrequest
Code:
<IfModule mod_log_config.c>
LogFormat "%a|%t|%{Referer}i -> %U" referer
LogFormat "%a|%t|%{User-agent}i" agent
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%a|%l|%t|%T|%H|%m|%U|%q|\"%r\"|%>s|%b|\"%{Referer}i\"|\"%{User-Agent}i\"|\"%{Cookie}i\"" customised
CustomLog logs/access_log common
CustomLog logs/agent_log agent
CustomLog logs/referer_log referer
CustomLog logs/customised.log customised env=!localrequest
</IfModule>
Code:
<IfModule set_env_if.c>
</IfModule>
in the "Pre Main Include" section for my Apache version which is 2.2.22Main >> Service Configuration >> Apache Configuration >> Include Editor
Any help is greatly appreciated.
Thanks in advance,
Regards,
Dave