Log Analysis For Web Server

July 25, 2014   

There are two service called, Loggly and splunk. They are good. But I will discuss opensource solution here.

AWStats:

Follow this steps, then take this configration:

LogFile="/var/log/nginx/access.www.example.com.log"
#Apatch2 "/var/log/apache2/access.log"
#Nginx checkout where do you save log
LogFormat=1
SiteDomain="www.example.com"
DNSLookup=0
DirData="/var/lib/awstats/"
HostAliases="example.com"

Analysis the log:

sudo /usr/lib/cgi-bin/awstats.pl -config=example.com -update

to start over and search with totally new log

#delete old one
sudo rm /var/lib/awstats/awstats{date}.example.com.txt then do
sudo /usr/lib/cgi-bin/awstats.pl -config=example.com -update

See your analysis: http://www.example.com/awstats/awstats.pl?config=example.com

Analog

Config:

vi /etc/analog.cfg
LOGFILE /var/log/apache2/access.log
LOGFILE /var/log/nginx/site.access.log

OUTFILE location_for_saving_report/index.html

Update report:

sudo analog -G +g/etc/analog.cfg

Nginx:

To check for Nginx errors:

sudo tail -f /var/log/nginx/error.log

Ref: https://help.ubuntu.com/community/AWStats http://www.bytetouch.com/blog/system-administration/how-to-awstats-installation-and-configuration-on-debian/



comments powered by Disqus