source:http://blog.sina.com.cn/s/blog_5ce0e67e0100baf5.html
http://doc.linuxpk.com/28437.html

1、事先安装好Apache

2、安装awstats的命令(将awstats安装在/opt/awstats目录)
mkdir -p /var/lib/awstats
cd /opt
wget http://www.awstats.cn/files/awstats-6.6.tar.gz
tar zxvf awstats-6.6.tar.gz
mv awstats-6.6 awstats
cd awstats/tools/
perl awstats_configure.pl

3、Perl脚本awstats_configure.pl安装过程(以下内容引用AWStats英文使用说明)

(1)
-----> 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:
/opt/awstats
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回车。

(2)
-----> 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):

第一次使用请输入Apache的httpd.conf路径,例如/opt/sina/apache/conf/httpd.conf
以后如果再使用perl awstats_configure.pl生成配置文件,则可以输入none跳过。

(3)
-----> Check and complete web server config file '/opt/sina/apache/conf/httpd.conf'
Warning: You Apache config file contains directives to write 'common' log files
This means that some features can't work (os, browsers and keywords detection).
Do you want me to setup Apache to write 'combined' log files [y/N] ?

选择y,将日志记录方式由CustomLog /yourlogpath/yourlogfile common改为更详细的CustomLog /yourlogpath/yourlogfile combined

(4)
-----> Update model config file '/opt/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

(5)
-----> 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:
>

输入站点名称,例如sina

(6)
-----> 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):
>

输入AWStats配置文件存放路径,一般直接回车则使用默认路径/etc/awstats

(7)
-----> 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:
/opt/awstats/wwwroot/cgi-bin/awstats.pl -update -config=sina
Or if you have several config files and prefer having only one command:
/opt/awstats/tools/awstats_updateall.pl now
Press ENTER to continue...

按回车键继续

(8)
A SIMPLE config file has been created: /opt/awstats/etc/awstats.sina.conf
You should have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'sina' with command:
> perl awstats.pl -update -config=sina
You can also read your statistics for 'sina' with URL:
> http://localhost/awstats/awstats.pl?config=sina

Press ENTER to finish...

按回车键结束

4、修改awstats.sina.conf配置
vi /etc/awstats/awstats.sina.conf

按?,在之后输入要搜索的内容LogFile="
然后按Ins键,找到LogFile="/var/log/httpd/access_log"
改为要分析的Apache日志路径与文件名。

(1)多日志合并分析(例:新浪播客其中两台服务器2月6日的日志30.0206.vblog.log与31.0206.vblog.log)
LogFile="/opt/awstats/tools/logresolvemerge.pl /var/apachelogs/30.0206.vblog.log /var/apachelogs/31.0206.vblog.log|"

LogFile="/opt/awstats/tools/logresolvemerge.pl /var/apachelogs/*.0206.vblog.log|"

(2)分析使用gzip压缩过的日志文件
LogFile="gzip -d </var/log/apache/access.log.gz|"

5、更新分析报告
perl /opt/awstats/wwwroot/cgi-bin/awstats.pl -config=sina -update

如果出现以下错误提示,很大可能是Apache的Log文件中存在以前CustomLog /yourlogpath/yourlogfile common生成的日志,删除掉这些行的日志即可:
This means each line in your web server log file need to have "combined log format" like this:
111.22.33.44 - - [10/Jan/2001:02:14:14 +0200] "GET / HTTP/1.1" 200 1234 "http://www.fromserver.com/from.htm" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"

6、查看分析报告
http://localhost/awstats/awstats.pl?config=sina

这里的sina对应/etc/awstats/awstats.sina.conf中的sina

附:
(1)参考资料:AWStats logfile analyzer 6.6 Documentation -- AWStats Installation, Configuration and Reporting (http://www.awstats.cn/docs/awstats_setup.html)
(2)测试环境:在DELL PowerEdge 2950 服务器+CentOS 4.4 Linux操作系统+Apache 2.0.59下测试通过。

from blog.s135.com

转载于:https://blog.51cto.com/comtv/328347

Linux下Apache日志分析工具--AWStats安装使用相关推荐

  1. Linux下常用日志分析工具

    Linux下常用日志分析工具 Logcheck简介 对于拥有大量账户.系统繁忙的Linux系统而言,其日志文件是极其庞大的,很多没有用的信息会将值得注意的信息淹没,给用户分析日志带来了很大的不便.现在 ...

  2. linux 如何查看php的日志,Linux下apache日志分析与状态查看方法

    假设apache日志格式为:118.78.199.98 – - [09/Jan/2010:00:59:59 +0800] "GET /Public/Css/index.css HTTP/1. ...

  3. 日志分析工具Awstats实战之Apache篇-多站点日志分析

    前面两篇都在讲述如何去部署nginx下的awstats日志分析工具,现在终于轮到apache.作为老牌的网页服务器,awstats对apache的支持非常完美,所以整个配置过程也是十分简单.因此,在这 ...

  4. linux日记的监控与分析,linux下apache日志监控与分析——webalizer与awstat

    (一)   Webalizer 从webalizer官网(http://www.webalizer.org/)我们可以看到对其做的如下说明,从中我们可以对webalizer有一个简单的了解 The W ...

  5. web 日志分析工具 awstats 简单安装

    awstats安装使用 awstats是一个开源的日志分析工具,用perl编写.感觉还不错,把安装记录写下,也许有人用的到. 可以分析大部分标准日志数据,如apache的,nginx的都可以 首先下载 ...

  6. tomcat日志分析工具awstats配置

    Awstats是一个免费非常简洁而且强大有个性的统计工具. 配置环境:windows xp.tomcat 6.0.26.Awstats 6.95.ActivePerl-5.12.2.1202 一.下载 ...

  7. 强大的日志分析工具AWStats经典备忘

    awstats经典备忘 [保留] 日志分析软件awstats的安装使用简易指南 http://www.chinaunix.net 作者:missing-cn   发表于:2006-09-30 08:1 ...

  8. LAMP攻略: LAMP环境搭建,Linux下Apache,MySQL,PHP安装与配置

    之前写过一个red hat 9下的LAMP环境的配置,不过由于版本比较旧,很多不适用了. 所以决定写一个新的LAMP环境搭建与配置教程.本配置是在 CentOS-5.3 下 httpd-2.2.11. ...

  9. linux下网络包分析工具下载,Wireshark下载-网络封包分析工具 v3.2.6 官方版 - 下载吧...

    Wireshark(前称Ethereal)是免费的网络协议检测程序,支持Unix,Windows.让您经由程序抓取运行的网站的相关资讯,包括每一封包流向及其内容.资讯可依操作系统语系看出,方便查看.监 ...

最新文章

  1. eclipse外观设置
  2. CentOS系统如何搭建离线yum源
  3. thinkphp3.0部分总结
  4. 蚂蚁金服的 Service Mesh 演进之道?
  5. Qt的简单介绍和安装
  6. EduCoder Linux之文件/目录搜索
  7. scrapy-redis 分布式哔哩哔哩网站用户爬虫
  8. linux怎么用jconsole_jconsole监控上Linux上的JVM
  9. 【转】Android编程点滴(14) -- Android中资源文件夹res/raw和assets的使用
  10. 信息学奥赛一本通 1080:余数相同问题 2022.1.29 AC
  11. mysql的sql执行过程和explain语句
  12. 时间序列-Auto-ARIMA模型
  13. MongoDB官网下载和安装(ZIP安装)
  14. 腾讯云通信、网易云通信、极光IM、阿里百川、容云通信国内云通信抉择之路 看云通信市场风云与掌控力 带腾讯云通信实战代码demo
  15. maven 设置本地仓库
  16. 【复现笔记】Iterative Corresponding Geometry
  17. python 遍历列表中的每个元素 for循环 while循环 迭代器
  18. 用程序员的语言:5000工科男抢200女同学做女朋友,怎么完美解决
  19. ET篇:做好准备工作并运行master分支的Demo
  20. 【Java编程】调用方法判断一个数是否是素数

热门文章

  1. c++ 虚函数_到底什么情况下会合成默认构造函数?
  2. python自学到精通
  3. 当程序员的一个人无聊时,甚至用Python开发出机器人看他们聊天
  4. 湖南科技学院计算机科学与技术分数,湖南科技学院计算机科学与技术专业2016年在河南理科高考录取最低分数线...
  5. 何为Java 中的多态?
  6. 如何使用Fiddler抓包操作?
  7. 3加2大专计算机专业考什么,3加2学校有什么专业 初中生怎么报考3+2
  8. 计算机公开课课前互动小游戏,公开课前课堂小游戏
  9. java qq ui界面,java UI之QQ登录
  10. php函数细节_php strip_tags()函数使用注意细节