Friday, 9 December 2011

apache domlogs content is combined


When i opened the domlogs, i saw the word "combined" was repeating in the logs:

# vi /usr/local/apache/domlogs/example.com
combined
combined
combined
combined
combined
combined
combined
combined

and i found the following lines in httpd.conf was the issue.

--------------------------------------
<IfModule log_config_module>
LogFormat "&#37;h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

CustomLog "logs/access_log" common

<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

</IfModule>

</IfModule>

--------------------------------------

Its fix is

--------------------------------------
vi /usr/local/apache/conf/httpd.conf

look for ErrorLog /usr/local/apache/logs/error_log

Beneath that add:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{Referer}i -> %U" referer
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{User-agent}i" agent

Save and exit, then run:
/usr/local/cpanel/bin/apache_conf_distiller --update
/usr/local/cpanel/bin/build_apache_conf
restart apache.
--------------------------------------

No comments:

Post a Comment