您的位置:首页 > 运维架构 > 反向代理

利用webalizer分析squid日志

2013-10-09 09:03 561 查看

利用webalizer分析squid日志


(2010-02-28 22:42:22)


转载▼

标签:

squid

日志分析

webalizer

it

分类:squid服务
1 安装

先下载源代码安装包吧

1.1 http://www.mrunix.net/webalizer/download.html

1.2 解压缩tar -xvf webalizer-2.21-02-src.tgz

安装./configure ,make

1.3 此时会在webalizer的安装包内产生一个webalizer的可执行文件,

执行cp webalizer /usr/bin下,安装就成功了,超简单。

2 使用

2.1 安装个apache服务器(用于网页浏览webalizer的结果)

yum -y install httpd

2.2 建立webalizer的配置文件

vi /etc/webalizer.conf

LogFile /var/log/squid/access.log

LogType squid

OutputDir /var/www/html/usages

LogFile /var/log/squid/access.log #指定要分析的squid日志的位置

LogTypesquid # 指定要分析的日志为squid服务

OutputDir/var/www/html/usages #结果输出到apache的网页发布目录

2.3 启动apache服务器

好了所有的准备都做好了。下面开始测试了

2.4 测试

执行 webalizer -c /etc/webalizer.conf

输出 如下内容

Webalizer V2.21-02 (Linux2.6.18-92.el5xen x86_64) English

Using logfile /var/log/squid/access.log (squid)

Creating output in /var/www/html/usages

Hostname for reports is 'tiny'

History file not found...

Generating report for February 2010

Saving history information...

Generating summary report

937442 records in 36 seconds, 26040/sec

大体上就是汇报处理过程,没啥东西。。。。。

直接打开网页看看,结果:

http://11.1.2.6/usages/index.html

靠非常全面呀。。。

当让还可以分析apache,nginx等其他服务器的日志,感兴趣的兄弟自己玩吧。



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: