当前位置:首页 > 行业资料 > 冶金工业 > awstats日志分析工具的作用和安装
awstats日志分析工具的安装和使用awstats是一个较好的日志分析工具,主要是用来分析apache和iis的日志,对日志格式重新配置之后可支持nginx。awstats需要perl支持,需先安装perl。使用方式上,为避免在web服务器上运行统计程序影响系统负载,计划每天把日志文件下载到另外的计算机,运行统计程序。安装步骤(windows下):1下载windows版awstats和perl2运行perl安装程序,安装perl环境3运行awstats安装程序,安装awstats4awstats安装过程中配置参数,如下-----CheckforwebserverinstallEnterfullconfigfilepathofyourWebserver.Example:/etc/httpd/httpd.confExample:/usr/local/apache2/conf/httpd.confExample:c:\Programfiles\apachegroup\apache\conf\httpd.confConfigfilepath('none'toskipwebserversetup):#none#因为我们这里用的是Nginx,所以写none,跳过。回车Yourwebserverconfigfile(s)couldnotbefound.YouwillneedtosetupyourwebservermanuallytodeclareAWStatsscriptasaCGI,ifyouwanttobuildreportsdynamically.SeeAWStatssetupdocumentation(filedocs/index.html)-----Updatemodelconfigfile'/usr/local/awstats/(requirediffirstinstall)[y/N]?#y#y创建一个新的统计配置回车-----DefineconfigfilenametocreateWhatisthenameofyourwebsiteorprofileanalysis?Example::#统计网站的域名例:(s)?Default:/etc/awstatsDirectorypathtostoreconfigfile(s)(Enterfordefault):#使用默认直接回车,接下来便会出现以下的提示----AddupdateprocessinsideaschedulerSorry,configure.pldoesnotsupportautomaticaddtocronyet.Youcandoitmanuallybyaddingthefollowingcommandtoyourcron:/usr/local/awstats/=回车继续安装结束以上为windows下的安装,linux下的安装过程与此类似5修改配置文件,修改cgi-bin中的awstats.model.conf为awstats.修改文件中的配置参数,写入日志文件路径、日志格式、域名、生成的统计文件等参数。6编写运行脚本输出静态统计页面awstats.pl-update-config==修改nginx的配置文件,把日志格式改为'$remote_addr-$remote_user[$time_local]$request''$status$body_bytes_sent$http_referer''$http_user_agent$http_x_forwarded_for'重启nginx8下载日志文件,运行脚本既可生成新的统计结果9添加定时任务,加入awstats的统计脚本,设为每天运行如果在本地计算机运行的awstats,统计结果页面在配置文件中指定的目录中,直接打开如果在服务器上运行的awstats,需要配置一个专门的网站来查看统计结果
本文标题:awstats日志分析工具的作用和安装
链接地址:https://www.777doc.com/doc-313814 .html