环境根据:http://www.cnblogs.com/zzzhfo/p/5925786.html

1、安装AWStats软件包

  1. 将软件包解压到httpd服务器中的/usr/lcoal/目录下
  2. [root@www /]# tar zxf awstats-7.3.tar.gz
  3. [root@www /]# mv awstats-7.3 /usr/local/awstats

2、为要统计的站点建立配置文件

  1. [root@www /]# cd /usr/local/awstats/tools/
  2. [root@www tools]# chmod +x awstats_configure.pl
  3. [root@www tools]# ./awstats_configure.pl
  4. 指定httpd主配置文件的路径
  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. > /usr/local/httpd/conf/httpd.conf #输入httpd.conf配置文件的路径
  9.  
  10. 设置日志的类型
  11. -----> Check and complete web server config file '/usr/local/httpd/conf/httpd.conf'
  12. Warning: You Apache config file contains directives to write 'common' log files
  13. This means that some features can't work (os, browsers and keywords detection).
  14. Do you want me to setup Apache to write 'combined' log files [y/N] ? y
  15. .......
  16.  
  17. 为指定web站点创建配置文件
  18. Do you want me to build a new AWStats config/profile
  19. file (required if first install) [y/N] ? y #确认创建新的站点配置文件
  20.  
  21. What is the name of your web site or profile analysis ?
  22. Example: www.mysite.com
  23. Example: demo
  24. Your web site, virtual server or profile name:
  25. > www.httpd.com #指定要统计的目标网站名称
  26.  
  27. -----> Define config file path
  28. In which directory do you plan to store your config file(s) ?
  29. Default: /etc/awstats
  30. Directory path to store config file(s) (Enter for default):
  31. > #直接按Enter键接受默认配置
  32.  
  33. -----> Create config file '/etc/awstats/awstats.www.httpd.com.conf'
  34. Config file /etc/awstats/awstats.www.httpd.com.conf created.
  35.  
  36. -----> Restart Web server with '/sbin/service httpd restart'
  37.  
  38. -----> Add update process inside a scheduler
  39. Sorry, configure.pl does not support automatic add to cron yet.
  40. You can do it manually by adding the following command to your cron:
  41. /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.httpd.com
  42. Or if you have several config files and prefer having only one command:
  43. /usr/local/awstats/tools/awstats_updateall.pl now
  44. Press ENTER to continue...
  45.  
  46. A SIMPLE config file has been created: /etc/awstats/awstats.www.httpd.com.conf
  47. You should have a look inside to check and change manually main parameters.
  48. You can then manually update your statistics for 'www.httpd.com' with command:
  49. > perl awstats.pl -update -config=www.httpd.com
  50. You can also read your statistics for 'www.httpd.com' with URL:
  51. > http://localhost/awstats/awstats.pl?config=www.httpd.com
  52.  
  53. Press ENTER to finish...

3、修改站点统计配置文件

  1. [root@www tools]# vim /etc/awstats/awstats.www.httpd.com.conf
  2. LogFile="/usr/local/httpd/logs/access_log"
  3. DirData="/var/lib/awstats"
  4. [root@www tools]# mkdir /var/lib/awstats

4、执行日志分析、并设置cron计划任务

  1. 使用awstats提供的awstats_updateall.pl脚本、可以更新所以站点的日志统计数据
  2. [root@www tools]# chmod +x awstats_updateall.pl
    [root@www tools]# ./awstats_updateall.pl now
    Running '"/usr/local/awstats/wwwroot/cgi-bin/awstats.pl" -update -config=www.httpd.com -configdir="/etc/awstats"' to update config www.httpd.com

Create/Update database for config "/etc/awstats/awstats.www.httpd.com.conf" by AWStats version 7.3 (build 20140126)
From data in log file "/usr/local/httpd/logs/access_log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 124
Found 0 dropped records,
Found 0 comments,
Found 0 blank records,
Found 1 corrupted records,
Found 0 old records,
Found 123 new qualified records.

  1. [root@www tools]# crontab -e
  2. */ * * * * /usr/lcoal/awstats/tools/awstats_updateall.pl now
  3. [root@www tools]# /etc/init.d/crond start
  4. [root@www tools]# chkconfig --level crond on

访问awstats分析系统

  1. http://192.168.119.131/awstats/awstats.pl?config=www.httpd.com

  1. 优化URL 做个跳转网页
  1. [root@www tools]# vim /usr/local/httpd/htdocs/awb.html
  2. <html>
  3. <head>
  4. <meta http-equiv=refresh content="0;
  5. url=http://192.168.119.131/awstats/awstats.pl?config=www.httpd.com">
  6. </head>
  7. <body></body>
  8. </html>

访问192.168.119.131/awb.html

部署Apache网站访问统计-AWStats分析系统的更多相关文章

  1. Apache的安装与AWstats分析系统

    实验拓扑图: 实验要求: 1.  WEB服务器: 使用源码包apache实现.安装完成后,并优化执行路径. 启动服务后,客户端通过http://IP能访问默认的网站. 2.  DNS服务器: 安装DN ...

  2. piwik网站访问统计系统

    一.Piwik介绍 Piwik是一套基于PHP+MySQL技术构建的开源网站访问统计系统.Piwik可以给你详细的统计信息,比如网页浏览人数,访问最多的页面,搜索引擎关键词等流量分析功能.此外,它还采 ...

  3. 开源网站访问统计系统Piwik

    http://www.piwik.cn/ http://www.piwik.org/ Piwik 是一套基于 Php+MySQL 技术构建,能够与 Google Analytics 相媲美的开源网站访 ...

  4. 部署AWStats分析系统

    介绍 AWStats是使用Prel语言开发的一款开源日志分析系统,它不仅可以用来分析Apache网站服务器的访问日志,也可以用来分析Samba.Vsftpd.IIS等服务的日志信息. AWStats软 ...

  5. Apache服务器访问过慢分析及解决

    起因:线上的一台服务器,最近总是出现 访问 很慢的情况发生,点击一个链接要2秒钟以上才能打开,按照我们对于访问人数的估计,服务器应该不至于响应这么慢,从而需要针对这个问题进行分析,来解决网站访问过慢. ...

  6. CentOS7 实战源码部署apache网站服务器

    简介:实战演练apache网站服务器的搭建 Apache简介: Apache软件基金会的一个开源免费的网页服务器,也是目前世界上使用最广泛的一种web server , apache最出名的是它跨平台 ...

  7. apache网站访问缓慢的处理记录

    朋友在阿里云上开通了一台ubuntu服务器(2G内存,2核CPU),用apache搭建了一个公众号网站.网站初期,他没有做相应的优化,在后续公众号推广活动时,网站并发突增,访问十分缓慢.登陆服务器,具 ...

  8. Piwik网站访问统计软件安装

    Piwik是一个PHP和MySQL的开放源代码的Web统计软件. 它给你一些关于你的网站的实用统计报告,比如网页浏览人数, 访问最多的页面, 搜索引擎关键词等等… Piwik拥有众多不同功能的插件,你 ...

  9. 提升Apache网站访问速度的优化方法

    Apache是世界使用排名第一的Web服务器软件.它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一. 在Apache服务器上怎样优化才能提高 ...

随机推荐

  1. 深入浅出Redis02 使用Redis数据库(String类型)

    一 String类型 首先使用启动服务器进程 : redis-server.exe 1. Set 设置Key对应的值为String 类型的value. 例子:向 Redis数据库中插入一条数据类型为S ...

  2. hadoop2.6.4运行wordcount

    hadoop用户登录,启动服务: start-dfs.sh && start-yarn.sh 创建输入目录: hadoop df -mkdir /input 把测试文件导入/input ...

  3. Python MySQLdb在Linux下的快速安装

    在家里windows环境下搞了一次 见   python MySQLdb在windows环境下的快速安装.问题解决方式 http://blog.csdn.NET/wklken/article/deta ...

  4. WebDataGrid设置某行某列的值

    <ig:WebDataGrid ID="grid"  OnRowSelectionChanged="grid_RowSelectionChanged" O ...

  5. [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq

    angularjs 使用ng-repeat报错 <div ng-init="words = ['高校','高校','高校']" ng-repeat="word in ...

  6. SimPholders Xcode快速访问沙盒

    SimPholders

  7. Intent启动一个新的页面

    一,Intent(目的) 的分类 显式 Intent 构造函数重载之一: Intent intent = new Intent(FirstActivity.this,SecondActivity.cl ...

  8. live555在Raspberry Pi上的点播/直播

    1.live555在Raspberry Pi上的点播 live555MediaServer这个实例是个简单的服务器,支持多媒体点播,直接在Raspberry Pi上编译运行,或者通过交叉编译出ARM核 ...

  9. 如何使Python完美升级到新版本

    这里提供一种解决的方法 (加上一句话,发现一个新问题:这种方法yum update 后,需要将/usr/bin下的python文件删除,然后执行: # ln -s /usr/local/python2 ...

  10. guid正则表达

    a-fA-F0-9 加上下划线 _ 可以用 \w 来代替. ^\w{8}-(\w{4}-){3}\w{12}$ 如果不可以用下划线, 0-9 用 \d 代替 a-fA-F 就用其中一个 a-f,然后匹 ...