手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

FreeBSD安装Awstats日志分析工具

[日期:2012-06-19] 来源:Linux社区  作者:webteam [字体:大 中 小]

AWStats是在Sourceforge上发展很快的一个基于Perl的WEB日志分析工具。相对于另外一个非常优秀的开放源代码的日志分析工具Webalizer,AWStats的优势在于:

1.界面友好:可以根据浏览器直接调用相应语言界面(有简体中文版)

2.基于Perl:并且很好的解决了跨平台问题,系统本身可以运行在GNU/Linux上或 Windows上(安装了ActivePerl后);分析的日志直接支持Apache格式 (combined)和IIS格式(需要修改)。Webalizer虽然也有Windows平台版,但目前已经缺乏 维护;AWStats完全可以实现用一套系统完成对自身站点不同WEB服务器:GNU/Linux/Apache和Windows/IIS服务器的统一统 计。

3.效率比较高:AWStats输出统计项目比Webalizer丰富了很多,速度仍可以达到Webalizer的1/3左右,对于一个日访问量 百万级的站点,这个速度都是足够的;

4.配置/定制方便:系统提供了足够灵活但缺省也很合理的配置规则,需要修改的缺省配置不超过3,4项就可以开始运行,而且修改和扩展的插件还是 比较多的;   

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服务器 .

一.安装

  1. cd /usr/ports/www/awstats 
  2. make install clean 

二、配置

安装后,会产生一个 /usr/local/www/awstats目录,然后执行tools目录中的 awstats_configure.pl 配置向导,创建一个新的统计。

  1. www# cd /usr/local/www/awstats/tools 
  2. www# ./awstats_configure.pl 

系统会提示:

  1. -----> Check for web server install 
  2.  
  3. Enter full config file path of your Web server. 
  4. Example: /etc/httpd/httpd.conf 
  5. Example: /usr/local/apache2/conf/httpd.conf 
  6. Example: c:\Program files\apache group\apache\conf\httpd.conf 
  7. Config file path ('none' to skip web server setup): 
  8. #>  

 #因为我们这里用的是Nginx,所以写 none,跳过。

  1. Your web server config file(s) could not be found. 
  2. You will need to setup your web server manually to declare AWStats 
  3. script as a CGI, if you want to build reports dynamically. 
  4. See AWStats setup documentation (file docs/index.html) 
  5.  
  6. -----> Update model config file '/usr/local/awstats/www/cgi-bin/awstats.model.conf' 
  7.   File awstats.model.conf updated. 
  8.  
  9. -----> Need to create a new config file ? 
  10. Do you want me to build a new AWStats config/profile 
  11. file (required if first install) [y/N] ? 
  12. #>  

输入 y,创建一个新的统计配置

  1. -----> Define config file name to create 
  2. What is the name of your web site or profile analysis ? 
  3. Example: www.mysite.com 
  4. Example: demo 
  5. Your web site, virtual server or profile name: 
  6. #> 

输入您需要统计的域名,例如:www.test.com,回车:

  1. -----> Create config file '/etc/awstats awstats.www.mytest.com.conf' 
  2. Config file /etc/awstats/awstats.www.test.com.conf created. 
  3.  
  4. -----> Add update process inside a scheduler 
  5. Sorry, configure.pl does not support automatic add to cron yet. 
  6. You can do it manually by adding the following command to your cron: 
  7. /usr/local/wwwroot/cgi-bin/awstats.pl -update -config=www.test.com 
  8.  
  9. Or if you have several config files and prefer having only one command: 
  10.  
  11. /usr/local/tools/awstats_updateall.pl now 
  12.  
  13. Press ENTER to continue... 

回车,继续……

  1. A SIMPLE config file has been created: /etc/awstats/awstats.www.test.com.conf 
  2.  
  3. You should have a look inside to check and change manually main parameters. 
  4.  
  5. You can then manually update your statistics for 'www.test.com' with command: 
  6.  
  7. > perl awstats.pl -update -config=www.test.com 
  8.  
  9. You can also build static report pages for 'www.test.com' with command: 
  10. > perl awstats.pl -output=pagetype -config=www.test.com 
  11.  
  12. Press ENTER to finish... 

回车完成!

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款