linux上awstats配置
具体配置过程如下:
http://prdownloads.sourceforge.net/awstats/awstats-6.9.tar.gz
<1>tar -zxvf awstats-6.9.tar.gz -C /usr/local 解压到/usr/local目录下
<2>进入解压目录cd /usr/local/awstats-6.9/tools
perl awstats_configure.pl按提示信息来操作
<3>修改awstats配置文件,修改注释行内容:(无须特殊配置,自动生成即可)
LogFile=” /var/log/httpd/access_log”
LogType=w
LogFormat=1
LogSeparator=" "
SiteDomain=”192.168.200.149”
HostAliases="192.168.200.149 www.192.168.200.149 127.0.0.1 localhost"
DNSlookup=2
DirData="/var/lib/awstats"
DirCgi="/awstats"
DirIcons="/awstatsicons"
<4>创建动态链接库目录,更新日志报表:
mkdir /var/lib/awstats
执行此命令:/usr/local/awstats-6.9/wwwroot/cgi-bin/awstats.pl -update -config=192.168.200.149
如执行错误,根据提示来更改
<5>配置/etc/httpd/conf/httpd.conf主配置文件,在主配置文件末尾添加以下内容即可Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/local/awstats/wwwroot">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<6>重启服务service httpd restart
查看监听端口netstat -ntlp|grep httpd
<7>打开浏览器输入http://192.168.200.149/awstats/awstats.pl?config=192.168.200.149,打开日志分析界面
<8>设置计划任务
vi /etc/cron.d/awstats
30 4 * * * root run-parts /usr/local/awstats/tools/awstats_updateall.pl now
service crond restart
在配置过程中报如下错:Error: Can't find AWStats program ('awstats.pl').
只要执行此命令:/usr/local/awstats-6.9/wwwroot/cgi-bin/awstats.pl -update -config=192.168.200.149,问题即可解决
转载于:https://blog.51cto.com/xieyanhuang123/410472