[iyunv@web01 tools]# vim awstats_configure.pl
#!/usr/bin/perl
运行配置文件进行配置
[iyunv@web01 tools]# perl awstats_configure.pl
Config file path ('none' to skip web server setup):
> /etc/httpd/conf/httpd.conf #<== 填写配置文件的路径
Do you want me to build a new AWStatsconfig/profile
file (required if first install) [y/N] ? y
Your web site, virtual server or profile name:
> web #<==设置一个网站的域名或名称(自定义)
Directory path to store config file(s) (Enter fordefault):
> #<== 以下均可一路回车
You can then manually update your statistics for'web' with command:
> perl awstats.pl -update -config=web #<== 分析日志命令(直接回车)
You can also read your statistics for 'web' withURL:
> http://localhost/awstats/awstats.pl?config=web #<== 回车
[iyunv@web01 tools]# tail /etc/httpd/conf/httpd.conf
#
# This is to permit URL access to scripts/files inAWStats directory.
#
<Directory"/usr/local/awstats/wwwroot">
OptionsNone
AllowOverride None
Orderallow,deny
Allowfrom all
</Directory>
[iyunv@web01 ~]# perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl-update -config=web
#-----------------出现以下结果表明成功-----------------------------
Update for config"/etc/awstats/awstats.web.conf"
With data in log file"/var/log/httpd/access_log"...
Phase 1 : First bypass old records, searching newrecord...
Searching new records from beginning of log file...
Jumped lines in file: 0
Parsed lines in file: 0
Found 0dropped records,
Found 0corrupted records,
Found 0 oldrecords,
Found 0 newqualified records.
现在将分析的日志结果放到站点目录下的一个文件,得以在web界面上查看日志分析的结果
cd /usr/local/awstats/wwwroot/cgi-bin/
perl awstats.pl -update -config=web -output-staticlinks >/var/www/html/awastats.html
[iyunv@web01 cgi-bin]# perl awstats.pl -opdate-config=web
Update for config"/etc/awstats/awstats.web.conf"
With data in log file"/var/log/httpd/access_log"...
Phase 1 : First bypass old records, searching newrecord...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history ondisk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 9631
Found 84dropped records,
Found 0corrupted records,
Found 0 oldrecords,
Found 9547new qualified records.