
Originally Posted by
jols
Dear cPanelDon,
I wish it were this easy. We had something like this established on all servers to clear these meaningless logs, e.g:
Code:
127.0.0.1 - - [04/Mar/2010:20:29:44 -0600] "OPTIONS * HTTP/1.0" 200 -
But it no longer works, I don't know if it is because of a new cPanel version or what. Currently here's the mod I have in the httpd.conf file, thus used to work but no longer:
Code:
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%!414r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%!414r\" %>s %b" common
SetEnvIf Remote_Addr 127\.0\.0\.1|66\.132\.174\.73|66\.132\.174\.84|67\.43\.164\.34|67\.43\.164\.34|66\.216\.126\.30 exclude_from_log
CustomLog logs/access_log common
CustomLog logs/access_log common env=!exclude_from_log
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
</IfModule>
I also tried your version, but no go.
The version of cPanel does not directly affect the logging directives in Apache, but manual (administrator) changes or recompiling (either downgrading or upgrading) Apache/httpd could have an effect depending on what and how customizations are applied. To clarify, the example I provided was quoting directly from and according to the official Apache/httpd wiki and documentation.
What is the version of Apache/httpd being used?
Code:
# /usr/local/apache/bin/httpd -v
In the provided details I see a few issues that should be addressed.
Please consider the following suggestions:
1.) Remove the duplicate CustomLog entry, so that the following is not specified twice:
Code:
CustomLog "logs/access_log" common
2.) Try placing double-quotes around the regular expression (regex) that is entered for the directive SetEnvIf.
3.) Try specifying only the localhost/loopback IP instead of a list to reduce the complexity involved.
Code:
SetEnvIf Remote_Addr "127\.0\.0\.1" loopback
Code:
CustomLog "logs/access_log" common env=!loopback