免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1475 | 回复: 0
打印 上一主题 下一主题

[IaaS与数据中心] 关于Awstats实现站点信息统计 [复制链接]

论坛徽章:
18
IT运维版块每日发帖之星
日期:2016-06-07 06:20:0015-16赛季CBA联赛之北控
日期:2016-06-30 21:19:06IT运维版块每日发帖之星
日期:2016-06-29 06:20:00每日论坛发贴之星
日期:2016-06-28 06:20:00IT运维版块每日发帖之星
日期:2016-06-28 06:20:00数据库技术版块每日发帖之星
日期:2016-06-23 06:20:00每日论坛发贴之星
日期:2016-06-22 06:20:00IT运维版块每日发帖之星
日期:2016-06-22 06:20:00IT运维版块每日发帖之星
日期:2016-06-21 06:20:00wusuopu
日期:2016-06-17 17:43:45IT运维版块每日发帖之星
日期:2016-06-16 06:20:00IT运维版块每日发帖之星
日期:2016-06-15 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2016-06-25 23:40 |只看该作者 |倒序浏览
Awstats是一个免费非常简洁而且强大有个性的统计工具。它可以统计您站点的如下信息:
 一:访问量,访问次数,页面浏览量,点击数,数据流量等
 二:精确到每月、每日、每小时的数据
 三:访问者国家
 四:访问者IP
 五:Robots/Spiders的统计
 六:纺客持续时间
 七:对不同Files type 的统计信息
 八:Pages-URL的统计
 九:访客操作系统浏览器等信息
 十:其它信息(搜索关键字等等)  
  1、首先下载最新版的awstats至某目录中,而后进行安装配置的准备工作:
  
  # mkdir /var/lib/awstats
  # tar zxvf awstats-6.95.tar.gz
  # mv awstats-6.95  /usr/local/awstats
  
  2、配置awstats
  
  # cd /usr/local/awstats
  # mkdir -m 755 data
  # perl tools/awstats_configure.pl
  
  
  
  ----- AWStats awstats_configure 1.0 (build 1. (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
  
  -----> 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):
  > /etc/httpd/conf/httpd.conf      《---------此处需要给出httpd的主配置文件的位置以使得awstats可以添加新的配置项。如果此前已经做过此配置,则使用"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/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        《----------这里用来指定是否需要为某站点创建统计日志的配置文件,如果需要,则指定"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.eboy.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):
  >         《-------这里指定上述配置文件的存放目录,默认为/etc/awstats,通常默认即可。
  
  
  -----> Create config file '/etc/awstats/awstats.www.test.com.conf'
  Config file /etc/awstats/awstats.www.test.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/wwwroot/cgi-bin/awstats.pl -update -config=www.test.com
  Or if you have several config files and prefer having only one command:
  /usr/local/awstats/tools/awstats_updateall.pl now
  Press ENTER to continue...            《--------“回车”继续
  
  
  
  A SIMPLE config file has been created: /etc/awstats/awstats.www.test.com.conf
  You should have a look inside to check and change manually main parameters.
  You can then manually update your statistics for 'www.test.com' with command:
  > perl awstats.pl -update -config=www.test.com
  You can also build static report pages for 'www.test.com' with command:
  > perl awstats.pl -output=pagetype -config=www.test.com
  
  Press ENTER to finish...       《--------“回车”继续,并结束配置过程
  
  
  
  3、调整前面为某站点创建的统计日志所需的配置文件中指定的、某站点实际使用的日志文件的路径
  
  # vim /etc/awstats/awstats.www.eboy.com.conf
  
  找到如下行:
  LogFile="/var/log/httpd/mylog.log"
  
  把后的日志文件的路径修改为您此站点实际日志文件的路径即可,如您的日志文件路径为“/var/log/httpd/access_log”,需要将上述行修改为如下行:
  LogFile="/var/log/httpd/access_log"
  #此处为LogFile="/var/log/httpd/eboy.access"(我的配置)
  
  
  
  4、手动更新网站的统计数据,以上面的www.test.com为例
  
  # cd /usr/local/awstats/wwwroot/cgi-bin/
  赋予执行权限
  # perl awstats.pl -update -config=www.eboy.com
  
  
  现在就可以在浏览器地址栏输入类似如下地址查看日志了:
  
  
  # http://www.test.com/awstats/awstats.pl?config=www.test.com
  此处为http://www.eboy.com/awstats/awstats.pl?config=www.eboy.com
  
  注: 如果需要将某统计信息生成为静态的html页面,使用以下命令即可实现:
  
  perl awstats.pl -output=pagetype -config=www.eboy.com > awstats.www.eboy.com.html
  
  
  5、可以将以上命令放到crontab中执行,并根据需要指定更新的频率和时间:
  
  33 6 * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.eboy.com >/dev/null 2>&1
  
  如图所示:   
  如下
  
  
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP