释义:
AWStats在Sourceforge发展很快的一个基于PerlWEB日志分析工具。
相对于另外一个非常优秀的开放源代码的日志分析工具WebalizerAWStats的优势在于:
1.界面友好:可以根据浏览器直接调用相应语言界面(有简体中文版)
2.基于Perl:并且很好的解决了跨平台问题,系统本身可以运行在GNU/Linux上或Windows上(安装了ActivePerl后);分析的日志直接支持Apache格式 (combined)IIS格式(需要修改)Webalizer虽然也有Windows平台版,但目前已经缺乏 维护;AWStats完全可以实现用一套系统完成对自身站点不同WEB服务器:GNU/Linux/ApacheWindows/IIS服务器的统一统计。
3.效率比较高:AWStats输出统计项目比Webalizer丰富了很多,速度仍可以达到Webalizer1/3左右,对于一个日访问量 百万级的站点,这个速度都是足够的;
4.配置/定制方便:系统提供了足够灵活但缺省也很合理的配置规则,需要修改的缺省配置不超过34项就可以开始运行,而且修改和扩展的插件还是 比较多的;
5.AWStats的设计者是面向精确的"Human visits"设计的,因此很多搜索引擎的机器人访问都被过滤掉了,因此有可能比其他日志统计工具统计的数字要低,来自公司内部的访问也可以通过IP过滤 设置过滤掉。
6.提供了很多扩展的参数统计功能:使用ExtraXXXX系列配置生成针对具体应用的参数分析会对产品分析非常有用。
AWStats 是一个免费的强大而有个性的工具,带来先进的网络,流量,FTP或邮件服务器统计图. 本日志分析器作为CGI或从命令行在数个图形网页中显示你日志中包含的所有可能信息. 它利用一部分档案资料就能经常很快地处理大量日志档案, 它能分析日志文件来自从各大服务器工具 , Apache日志档案 s (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C的日志格式)及许多其他网站,Proxy(代理服务器)Wap、流量服务器、邮件服务器和一些 FTP服务器 .
看一看这个比较表在最著名统计工具 (AWStats, Analog, Webalizer,...)之间有何特点和不同的想法.
AWStats 是一个在GNU通用公共许可证下发行的免费软件. 你可以看看这个许可证图表而知道你可以/不可以做.
由于AWStats工程来自网上信息,但也作为CGI、 它可以与允许进入Perl,CGI与日志的大型网站主办提供商一起工作.[1]
所以我们就不举例安装webalizer,直接高级的,当然大家可以参考这个也能将webalizer做出来。
首先我们先安装perl
Yum安装
解压awstats
[root@localhost awstats-7.1.1]# tar -zxvf awstats-7.1.1.tar.gz
建立两个目录分别用于存放站点日志分析配置文件,一个用于存放日志信息
[root@localhost awstats-7.1.1]# mkdir /etc/awstats
[root@localhost awstats-7.1.1]# mkdir /var/lib/awstats
然后将awstats-7.1.1移动到/usr/local/目录下面
[root@localhost ~]# mv awstats-7.1.1 /usr/local/
然后配置awstats
 [root@localhost tools]# perl awstats_configure.pl
 
----- AWStats awstats_configure 1.0 (build 1.9) (c) Laurent Destailleur -----
This tool will help you to configure AWStats to analyze statistics for
one web server. You can try to use it to let it do all that is possible
in AWStats setup, however following the step by step manual setup
documentation (docs/index.html) is often a better idea. Above all if:
- You are not an administrator user,
- You want to analyze downloaded log files without web server,
- You want to analyze mail or ftp log files instead of web log files,
- You need to analyze load balanced servers log files,
- You want to 'understand' all possible ways to use AWStats...
Read the AWStats documentation (docs/index.html).
 
-----> Running OS detected: Linux, BSD or Unix
Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.
If you want to use standard directory, you should first move all content
of AWStats distribution from current directory:
/usr/local/awstats-7.1.1
to standard directory:
/usr/local/awstats
And then, run configure.pl from this location.
Do you want to continue setup from this NON standard directory [yN] ? y
 
-----> Check for web server install
 
Enter full config file path of your Web server.
Example: /etc/httpd/httpd.conf
Example: /usr/local/apache2/conf/httpd.conf
Example: c:\Program files\apache group\apache\conf\httpd.conf
Config file path ('none' to skip web server setup):
> none
 
Your web server config file(s) could not be found.
You will need to setup your web server manually to declare AWStats
script as a CGI, if you want to build reports dynamically.
See AWStats setup documentation (file docs/index.html)
 
-----> Update model config file '/usr/local/awstats-7.1.1/wwwroot/cgi-bin/awstats.model.conf'
  File awstats.model.conf updated.
 
-----> Need to create a new config file ?
Do you want me to build a new AWStats config/profile
file (required if first install) [y/N] ? y
 
-----> Define config file name to create
What is the name of your web site or profile analysis ?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> www.aaaa.com
 
-----> Define config file path
In which directory do you plan to store your config file(s) ?
Default: /etc/awstats
Directory path to store config file(s) (Enter for default):
>  
 
-----> Create config file '/etc/awstats/awstats.www.aaaa.com.conf'
 Config file /etc/awstats/awstats.www.aaaa.com.conf created.
 
-----> Add update process inside a scheduler
Sorry, configure.pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/usr/local/awstats-7.1.1/wwwroot/cgi-bin/awstats.pl -update -config=www.aaaa.com
Or if you have several config files and prefer having only one command:
/usr/local/awstats-7.1.1/tools/awstats_updateall.pl now
Press ENTER to continue...
 
 
A SIMPLE config file has been created: /etc/awstats/awstats.www.aaaa.com.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www.aaaa.com' with command:
> perl awstats.pl -update -config=www.aaaa.com
You can also build static report pages for 'www.aaaa.com' with command:
> perl awstats.pl -output=pagetype -config=www.aaaa.com
 
Press ENTER to finish...
根据提示进行操作
因为awstats是基于apache进行监控的所以我们去修改apache的配置文件,
 强大的Web日志分析工具_AWSTATS 应用实例_awstats应用实例

编辑修改apache的成功的日志存放的位置
vim /etc/awstats/awstats.www.aaa.com.conf(该文件awstats_configure.pl在安装的时候产生的)
强大的Web日志分析工具_AWSTATS 应用实例_awstats应用实例_02
然后开始测试,我们大家先看之前的日志
强大的Web日志分析工具_AWSTATS 应用实例_web日志分析工具_03
这个是我们测试之前的检测结果,可以看出所以的记录都为0,也就是我们没有收到访问,上图的日志文件也为1308
强大的Web日志分析工具_AWSTATS 应用实例_awstats应用实例_04
然后我们访问一次www.aaaa.com然后在看结果:
强大的Web日志分析工具_AWSTATS 应用实例_web日志分析工具_05
呵呵,看到结果没,记录加1,然后日志也加了1,所以就证明我们awstats检测是正确的,但是为了方便管理,也是这篇博客的目的我们把它重定向到一个网页内,从而方便管理
强大的Web日志分析工具_AWSTATS 应用实例_awstats应用实例_06
然后我们访问
强大的Web日志分析工具_AWSTATS 应用实例_awstats应用实例_07
成功,页面我们也能管理了。
我们试一下用在虚拟机外用域名访问
强大的Web日志分析工具_AWSTATS 应用实例_awstats应用实例_08
成功,这样我们就可以随时随地的进行对访问web的日志分析监控。
<如果不懂什么事perl的话,可以查看我的其他博客,有详细的介绍的>