Previously installed in English, now replaced with Chinese
Reference Address: http://haolulu.blog.51cto.com/3164472/630894
1. Install the Webalizer required packages (need to use the relevant JPEG,png,zlib library )
Yum-y Install gd-devel.i*
Yum Install jpeg*
Yum Install png*
2. Download the Webalizer source package
2.1 Decompression
TAR-ZXVF webalizer-2.21-02-src.tar.bz2
2.2 Go to Catalog
CD webalizer-2.21-02
2.3 go to the lang directory
webalizer_lang.simplified_chinese Convert file format to utf-8 (UltraEdit I use)
2.4 Find a Chinese font and upload it to the server
Address
(I have a Chinese font uploaded to this directory from the win system)
2.5 Jump back to the lounge file directory
2.6 Modify this file graphs.c
VI GRAPHS.C
Add at the end of the document
voidGdimagestring (Gdimageptr im, gdfontptr font,intXintY, unsignedChar*s,intcolor) {gdimagestringft (IM,0, Color,"/usr/share/fonts/simfang.ttf",9,0.0, X, y+9, s);}voidGdimagestringup (Gdimageptr im, gdfontptr font,intXintY, unsignedChar*s,intcolor) {gdimagestringft (IM,0, Color,"/usr/share/fonts/simfang.ttf",9,-pi/2, X, Y9, s);}
Note that/usr/share/fonts/simfang.ttf is the absolute location of the Chinese fonts you upload yourself.
2.7 Compiling Webzlizer
./configure--with-language=simplified_chinese
Make
2.8 Installation
1. Upgrade to replace the original
There is a webalizer in the directory that replaces the Webalizer binaries in the directory you originally installed.
CP webalizer/usr/bin/
2. Installation
Make install
Installed by default on/usr/local/bin/webalizer (can be specified at installation location--prefix=)
3. Running Webalizer
3.1 Configuring the Webalizer.conf file
Default Read/etc/webalizer.conf
# #nginx Access.log directory (can make compressed files) LogFile /usr/local/nginx/logs/access.log# #web访问目录, log generation directory OutputDir /usr/local/nginx/htmlincremental Yes
/var/lib/webalizer/webalizer.current
HostName the name of the statistic (default is host name)
3.2 Run
/usr/bin/webalizer
3.3 Timed operation
Crontab-e
0 0 * * */usr/bin/webalizer & (log generated once a day)