Linux与云计算——第二阶段Linux服务器架设
第七章:网站WEB服务器架设—日志分析平台
日志分析:AWstats
安装AWstats分析http日志信息.
[1] Install AWstats.
[root@client ~]# yum -y install awstats
自动生成相关配置文件awstats.(hostname).conf
[root@client ~]# vim /etc/awstats/awstats.server.example.com.conf
# line 122: 修改
# 如果你的httpd.conf配置文件中的日志类型是 'combined' 就设置为 '1'
# 如果是 'common' set here '4'。
LogFormat=1
# line 153: 指定你的主机名
SiteDomain="server.example.com"
# line 168: 主机别名:
HostAliases="localhost 127.0.0.1 REGEX[server\.world$] REGEX[^10\.0\.0\.]"
[root@client ~]# vi /etc/httpd/conf.d/awstats.conf
# line 30: 允许访问的IP地址
Require ip 192.168.96.0/24
[root@client ~]# systemctl restart httpd
# 生成报告 ( 报告会被计划任务每间隔一个小时更新一次 )
[root@client ~]# /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=server.example.com -update