- 论坛徽章:
- 0
|
作者:
ADJ网络实验室
一.前言:
Webalizer 是一个好用的Web Server 纪录文件分析软件,它除了能够分析 Apache web server 所产生的log 纪录文件之外,还能够分析FTP 的 Log 档,以相当精美的HTML网页输出,目前相当多的网站便是使用这一个软件作为流量分析统计之用,因此在这边也分享给各位来使用。
Webalizer 还有一个好处便是您可以透过这个软件来分析网站的运作情况,同时还有支持中文语系,不过要使用时请先看一下 INSTALL 及 README 两个档案,因为并不是很好安装,同时设定也颇为困难,您可能先要了解 Apache Web Server 的运作才比较能够了解选项的内容.
如何取得Package(目前最新版为webalizer-2.01-09):
Webalizer Homepage:
http://www.mrunix.net/webalizer/download.html
ADJ网页流量分析:
http://www.adj.idv.tw/usage
Before you compiler, decompress the tarball (tar.gz) :
[root@linux /]# cp webalizer-2.01-09-src.tgz /home/webalizer/
[root@linux /]# cd /home/webalizer/
[root@linux webalizer]# tar zxvf webalizer-2.01-09-src.tgz
说明一下,由于网页输出时会用到 gd 这一个程序来作绘图的部分,所以你必须先要有gd这一个软件。您可以透过这个指令来看看是否有安装gd:
[root@linux webalizer]# rpm -qi gd
Name : gd Relocations: /usr
Version : 1.3 Vendor: Red Hat, Inc.
Release : 6 Build Date: 公元2000年02月04日 (星期五) 01时31分42秒
Install date: 公元2001年08月02日 (星期四) 11时59分35秒 Build Host: porky.devel.redhat.com
Group : System Environment/Libraries Source RPM: gd-1.3-6.src.rpm
Size : 322718 License: BSD-style
Packager : Red Hat, Inc.
Summary : A graphics library for drawing .gif files.
Description :
Gd is a graphics library for drawing .gif files. Gd allows your code to
quickly draw images (lines, arcs, text, multiple colors, cutting and
pasting from other images, flood fills) and write out the result as a
.gif file. Gd is particularly useful in web applications, where .gifs
are commonly used as inline images. Note, however, that gd is not a
paint program.
Install gd if you are developing applications which need to draw .gif
files. If you install gd, you'll also need to install the gd-devel
package.
二.Compile webalizer:
Move into the new Webalizer directory and type the following commands on your terminal:
--with-language=chinese:就是让webalizer变成中文化
[root@linux webalizer]#./configure --with-language=chinese --with-gdlib=/usr/lib --with-gd=/usr/bin
[root@linux webalizer]#make
[root@linux webalizer]#mkdir /var/www/html/usage
Compiler之后.数据夹会多几个档案:
[root@linux webalizer]#ls
CHANGES README.FIRST dns_resolv.h lang/ parser.c webalizer.LSM
COPYING aclocal.m4 dns_resolv.o lang.h parser.h webalizer.c
Copyright config.cache graphs.c linklist.c parser.o webalizer.h
DNS.README config.log graphs.h linklist.h preserve.c webalizer.o
INSTALL config.status* graphs.o linklist.o preserve.h webalizer.png
Makefile configure* hashtab.c msfree.png preserve.o webalizer_lang.h@
Makefile.in configure.in hashtab.h output.c sample.conf webazolver@
Makefile.std country-codes.txt hashtab.o output.h webalizer*
README dns_resolv.c install-sh* output.o webalizer.1
To run Webalizer, the following file is required, and must be created or copied to the appropriate directory on your server:
[root@linux webalizer]#cp webalizer /usr/bin/
[root@linux webalizer]#cd /etc
[root@linux etc]#ls webalizer*
webalizer.conf.sample
[root@linux etc]#cp webalizer.conf.sample webalizer.conf.adj
[root@linux etc]#vi webalizer.conf.adj
三.Configure the /etc/webalizer.conf file:
Edit the webalizer.conf.adj file(将里面的值改成下列):
LogFile /var/log/httpd/access_log
OutputDir /var/www/html/usage
HostName www.adj.idv.tw
Incremental yes
PageType htm*
PageType cgi
PageType php
HideURL *.gif
HideURL *.GIF
HideURL *.jpg
HideURL *.JPG
HideURL *.ra
IgnoreURL /taskbar*
四.Make Apache aware of Webalizer output directory:
Once Webalizer has been installed in the system we must add the following lines into the httpd.conf file of Apache to be able to locate and use it features:
1.编辑 httpd.conf , vi /etc/httpd/conf/httpd.conf and add the following lines :
Options None
AllowOverride None
Order deny,allow
Allow from all
2.别忘了重起 Apache:
[root@linux webalizer]#service httpd restart
Shutting down http: [ OK ]
Starting httpd: [ OK ]
五:Running Webalizer manually first time:
第一次手动执行 Webalizer ,会有找不到记录的现像..这是正常的...只要执行过第二次...就没问题啰..:
[root@linux webalizer]#/usr/bin/webalizer -c /etc/webalizer.conf.adj
正常讯息如下:
[root@linux webalizer]#/usr/bin/webalizer -c /etc/webalizer.conf.adj
Webalizer V2.01-09 (Linux 2.4.3-20mdk) Chinese
使用记录文件 /var/log/httpd/access_log (clf)
产生输出于 /var/www/html/usage
主机名称是 'www.adj.idv.tw'
读取历史记录 webalizer.hist
Reading previous run data.. webalizer.current
Saving current run data... [03/03/2002 18:21:06]
产生报表给 三月 2002
产生汇总报表
储存历史记录信息
120778 记录 (119881 忽略) in 6.02 秒, 20062/sec
设定crontab ..让它每二小时跑一次:
[root@linux webalizer]#crontab -e
0 */2 * * * /usr/bin/webalizer -c /etc/webalizer.conf.adj
执行结果如下:
????????在此怎么贴不上图片,郁闷呀!!!!
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/41578/showart_354788.html |
|