Wednesday, December 21, 2011

Awstat not Updating in cPanel and Combined error Log

Yesterday I found a strange issue with awstat as it suddenly stopped reporting the data. I could get the past data but not able to get the current data. As usual as a part of debugging i opened the errorlogs and domlogs. I found something strange in the domlogs.  The word "combined" was repeating in the logs:

 # vi /usr/local/apache/domlogs/
combined
combined
combined
combined
combined
combined
combined
combined



After hours of searching and testing i found the solution. I am sharing it below:


Open the apache conf with your favorite editor.
#vi /usr/local/apache/conf/httpd.conf
Search for the line
--------
ErrorLog /usr/local/apache/logs/error_log
--------
Beneth that line add the following:
--------
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
/scripts/restartsrv_httpd
--------
Awstat started updating itself at last. :)

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews