搜索泥称 发表于 2017-5-21 11:27:53

awstats安装插曲小记

awstats是一个用于分析apache日志文件的工具软件,它的安装过程这里就不重复了,网上资料一大把,也比较简单。这里仅记录安装过程中出现的两个小问题:
安装参考:【原创】【AWStats】配置 Apache/Windows IIS 的日志分析工具
1、照着安装成功后,通过http://218.*.*.254/awstats/awstats.pl?config=qu6zhi.com这种地址访问的时候,页面总是报403错误,提示没有权限访问。
   经过一阵反复折腾,终于发现问题所在:
   安装的时候,它在apache的http.conf里加了一段配置:
   #
# Directives to allow use of AWStats as a CGI
#
#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>
注意:这里的注释是我后来解决问题加上的。
同时,它也在http.d目录下面,单独生成了一个配置文件:awstats.conf,内容如下:
#
# Directives to add to your Apache conf file to allow use of AWStats as a CGI.
# Note that path "/usr/share/awstats/" must reflect your AWStats install path.
#
Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/share/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/"
#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/usr/share/awstats/wwwroot">
Options None
AllowOverride None
Order allow,deny
Allow from 127.0.0.1
</Directory>
# Additional Perl modules
<IfModule mod_env.c>
SetEnv PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
</IfModule>

而在http.conf中又引用了这个配置文件,结果导致两段配置,起作用的是awstats.conf中的内容,它里面配置了只允许从本机访问,所有会出现403错误,把它改成all就OK了。
最终的界面效果:

具体功能体验中。。。
页: [1]
查看完整版本: awstats安装插曲小记