Introduction:
Webalizer is an efficient, free web server log analyzer. Its analysis results are saved in HTML file format so that it can be easily browsing through the web server. Many sites on the Internet use Webalizer to analyze the web server log analysis. Webalizer has the following features:
1. It is a program written with C, so it has high operating efficiency. On a machine with a 200 MHz, Webalizer can analyze 10,000 records per second, so analyze a 40M size log file only take 15 seconds.
2. Webalizer supports standard general log file formats (in addition to this, several combined logfile formats) can also be a variant of combine logfile format, which can count customer situations and customer operating system types. And now Webalizer has already supported the WU-ftpd xferlog log format and the Squid log file format.
3. Support command line configurations and profiles.
4. You can support multiple languages or your localization work.
5. Support a variety of platforms, such as UNIX, Linux, NT, OS / 2, and MacOS, etc.
installation:
1. From the official website of Webalizer http://www.mrunix.net/webalizer/ Download Webalizer, the current latest version is Webalizer-2.01-06-Src.tgz.
2. First untie the source code package:
TAR XVZF Webalizer-2.01-06-src.tgz
3. There is a lang directory in the generated directory, which saves various language files, but only the traditional Chinese version can be converted into simplifications, or you will re-translate it.
4. Then enter the generated directory:
./configuremake --with-language = Chinese
5. After the compilation is successful, a Webalizer executable can be generated, you can copy it to / usr / sbin / directory:
CP Webalizer / USR / SBIN /
Then you can start configuring Webalizer.
Configuration:
As mentioned above, you can configure Webalizer by command line, or configured by configuration files. In this article, we will introduce the use of command line parameters to configure, you need to understand the configuration file usage method, you can refer to the readme file, there is very detailed Introduce.
You can perform Webalizer -H get all command line parameters:
Usage: Webalizer [Options] [log file] -H = Print Help Information -V -V = Print version information -D = Print Additional debug information -f type = log format type. TYPE = (CLF | FTP | Squid) -i = Ignore the history file -P = reserved status (increment mode) -q = ignore message information -Q = ignore all information -y = ignore national graphic -G = ignore hours Statistics graphic - h = ignore HOM statistics -L = ignore color Image -L Num = Using Digital Background in Graphs - M Num = Access Timeout (SECONDS) -T = Print Time Information - C File = Specified Profile-Name = Host Name - O Dir = Result Output Directory - T Name = Host Name-A Name = Hidden User Agent Name -R Name = Hide Client-UAME = Hide URL-X Name = Using File Extensions URL-X Name = Using File Extensions Type extension -i name = index alias -a num = the first few customer types -c num = display previous few countries -R num = display previous link -s num = display first several customers -U Num = The first few URLS-E Num = The first few access pages are displayed - E Num = Page in the first few unsaved pages -X = hidden individual users -D name = Using DNS Cache file -N Num = DNS process number (0 = Disabled DNS) Assume that the web server host is www.test.com, the statistical site domain is www.test.com, access the log as / var / log / httpd / access_log, we output the Webalizer analysis result to / var / www / html / log below. Then we can build the following script /etc/rc.d/webalizer:
#! / bin / shrun = / usr / sbin / webalizer $ run -f clf -p -n '' -t 'www.test.com' -o / var / www / html / log / var / log / httpd / ACCESS_LOG
Description:
-F CLF indicates that our web log format is a standard general log file format (CommON logfile format)
-p Specifies to use increment mode, which is that Webalizer will produce a historical file after every analysis, which is not analyzed in the next analysis. This way we can convert our log files in a short time without having to worry that the number of access is increased.
"" "Specifies the server host name, so the output is beautiful.
-o "www.test.com" Specifies the output title title.
/ var / log / httpd / access_log: Specify log file
Then join / etc / crontab:
01 1 * * * root /etc/rc.d/webalizer
That is, the script is executed at 1 o'clock in the morning. Then run /etc/rc.d/init.d/crond releva to redouble load CROND service.
test:
Perform the following command:
# /etc/rc.d/webalizer
Then visit http://www.test.com/log/ in the browser to see the analysis of Webalizer.
Note: If you use a Chinese language file, but your Linux does not support Chinese, the word in the generated picture may be garbled.