webalizer is a highly efficient, free web server log analysis program. Analysis of the results of its documents to HTML format, which can easily browse through the web server. Many Internet sites use webalizer for analysis of web server logs. Webalizer has the following characteristics:
1. As is written in C, so it has very high operating efficiency. In frequency to 200Mhz machine, webalizer per second can be analyzed 10,000 records, so analysis of the size of a 40M log files only 15 seconds.
2. Webalizer general support for the standard log file format (Common Logfile Format); In addition, also support some combination of the log format (Combined Logfile Format) variant, which can be clients, as well as statistics on the type of client operating system. Webalizer and can now support the wu-ftpd xferlog log format, as well as the squid log file formats.
3. To support the command-line configuration and the configuration file.
4. Can support multiple languages, you can localize their own work.
5. To support multiple platforms, such as UNIX, linux, NT, OS / 2 and MacOS and other.
Installation:
1, set the zlib
# Tar zxvf zlib-1.1.4.tar.gz
# Mv zlib-1.1.4 zlib
# Cd zlib
#. / Configure
# Make
# Cd ..
2, set the zlib
# Tar zxvf libpng-1.2.5.tar.gz
# Mv libpng-1.2.5 libpng
# Cd libpng
# make-f scripts / makefile.std CC = gcc ZLIBLIB =.. / zlib ZLIBINC =.. / zlib
# Cd ..
3, set gd
# Tar zxvf gd-1.8.3.tar.gz
# Mv gd-1.8.3 gd
# Cd gd
# make INCLUDEDIRS = "-I. -I../zlib -I../libpng"
LIBDIRS = "-L../zlib-L. -L../libpng"
LIBS = "-lgd-lpng-lz-lm"
# Cd ..
4. Webalizer official site from http://www.mrunix.net/webalizer/ download webalizer, the latest version of the current is webalizer-2.01-06-src.tgz.
5. First of all remove the source code package:
tar xvzf webalizer-2.01-06-src.tgz
6. The generated lang directory has a directory, the directory to save the document in various languages, but English version only, can be simplified into their own, or about their own re-translation.
7. And then into the generated directory:
. / configure
make - with-language = chinese
8. Compile successfully, it will create a webalizer executable file, you can copy to / usr / sbin / directory:
cp webalizer / usr / sbin /
And then can begin the webalizer configuration.
Configurations:
Mentioned above can be configured through the command line webalizer, can also be configured through the configuration file, in this paper we will introduce the use of command-line configuration parameters, configuration files need to be aware of the use of the README file can refer to a friend, which had a very detailed introduced.
Webalizer-h can be implemented by all command line parameters:
Usage: webalizer [options] [log file]
-h = print help information
-v-V = print version information
-d = print additional debugging information
-F type = log format type. Type = (clf | ftp | squid)
-i = ignore the historical document
-p = reservation state (incremental mode)
-q = ignore news information
-Q = ignore all the information
-Y = ignore national graphics
-G = ignore-hour statistical graphics
-H = ignore hours of statistical information
-L = ignore color legend
-l num = in graphics in the context of the use of digital lines
-m num = access time (seconds)
-T = print time information
-c file = specified configuration file
-n name = use the host name
-o dir = output directory
-t name = report title of the specified host name on the
-a name = hide the user agent name
-r name = hide visited links
-s name = hide Guest
-u name = hide URL
-x name = use the file extension
-P name = Page type extension
-I name = index alias
-A num = display before the number of customer types
-C num = show before several countries
-R num = show several links before
-S num = display before the number of customers
-U num = display before the number of URLs
-e num = display before the page number of visits
-E num = show before a few pages that does not exist
-X = Hide individual users
-D name = use dns cache file
-N num = DNS process a number (0 = disable dns)
Assumptions, web server host name www.test.com, statistics site domain name www.test.com, access logs to / var / log / httpd / access_log, the results of the analysis we will webalizer output to / var / www / html / log below. Then we can create the following script / etc / rc.d / webalizer:
#! / bin / sh
run = / usr / sbin / webalizer
$ run-F clf-p-n ""-t "www.test.com"
-o / var / www / html / log / var / log / httpd / access_log
Description:
We-F clf specified in the web log format to a standard log file format in general (Common Logfile Format)
-p specify the use of incremental mode, which means that for an analysis of each, webalizer will produce a historical document, so that when the next analysis can not analyze the part has been handled. Such a short period of time we can convert our log file, and not have to worry about too much traffic when the log file increases unlimited.
-n "" the specified server host name space, so that some of the output results will be beautiful.
-o "www.test.com" the title of the designated output.
/ var / log / httpd / access_log: specified log file
Then / etc / crontab add:
01 1 * * * root / etc / rc.d / webalizer
1:00 per day to implement the script.
And then run / etc / rc.d / init.d / crond reload service crond heavy loading.
Test:
The following command:
# / Etc / rc.d / webalizer
In the browser and then visit http://www.test.com/log/ can see the results of the analysis of the webalizer.
Note: If you are using a Chinese language paper, but linux does not support your English, then in the resulting picture may be garbled text.
0 评论:
发表评论