AWStats分析Apache,Nginx,Squid,Tomcat和Lighttpd日志

AWStats是一个非常好用的日志统计工具,下面我对其他主要Web Server/proxy(httpd,nginx,squid,lighttpd,tomcat)的日志如何进行分析展开说明。在awstats配置修改最小的前提说明下如何进行修改,希望对有需要的朋友能够提供帮助。

awstats日志分析之apache

apache:

修改配置:%apache%/conf/httpd.conf

CustomLog logs/access_log combined

awstats:

修改配置:awstats.xiayige.conf

LogFile="%apache%/logs/access_log"

awstats日志分析之tomcat

tomcat:

修改配置:%tomcat%/conf/server.xml

修改为:

awstats:

修改配置:awstats.xiayige.conf

LogFile="%tomcat%/logs/access_log.%yyyy%mm%dd.log"

awstats日志分析之nginx

nginx:

修改配置:%nginx%/conf/nginx.conf

 #log_format main '$remote_addr - $remote_user [$time_local] $request '
 # '"$status" $body_bytes_sent "$http_referer" '
 # '"$http_user_agent" "$http_x_forwarded_for"';
 #access_log logs/access.log main;

修改为:

 log_format main '$remote_addr - $remote_user [$time_local] "$request" '
 '$status $body_bytes_sent "$http_referer" '
 '"$http_user_agent" $http_x_forwarded_for';
 access_log logs/access.log main;

awstats:

修改配置:awstats.xiayige.conf

LogFile="%nginx%/logs/access.log."

awstats日志分析之squid

squid:

修改配置:%squid%/etc/squid.conf

access_log /usr/local/opt/squid//var/logs/access.log squid

修改为:

logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %>Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
 access_log /usr/local/opt/squid/var/logs/access.log combined

awstats:

修改配置:awstats.xiayige.conf

LogFile="%squid%/var/log/access.log"

awstats日志分析之lighttpd

awstats直接支持lighttpd默认的日志输出格式。