在centos6上部署webalizer日志分析工具
2012-09-13 09:17
323 查看
Webalizer + Centos 6
参考文章:
http://blog.slogra.com/post-86.html
http://www.chinaitpower.com/A/2005-05-10/116491.html
/article/3818244.html
webalizer + logzilla: /article/6930736.html
安装过程:
我们这里首先需要一个apache,作为webalizer的页面展示服务器
# yum -y install httpd
# yum -y install gd*
# yum -y install zlib*
# yum -y install font*
# yum install db4-devel
geoip软件下载:
http://www.findthatzip.com/search-41538008-hZIP/winrar-winzip-download-webalizer-geoip-2.1.10-13.tbz.htm
http://www.findthatzip.com/search-3066664-fZIP/winrar-winzip-download-webalizer-geoip-2.23.5.tbz.htm
# cd /home/jtian/softwares
# wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
# tar -zxf GeoIP.tar.gz
# cd GeoIP-1.4.8
# ./configure
# make && make install clean
# cd /home/jtian/softwares/GeoIP-1.4.8/data
# cp GeoIP.dat /usr/share/GeoIP
准备ip查询库:
# cd /home/jtian/softwares
# wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-geodb-latest.tgz
# tar -zxf webalizer-geodb-latest.tgz
# cp GeoDB.dat /usr/share/GeoDB
准备国旗图片库
在webalizer的首页上下载国旗库
# mkdir /var/www/html/usage ; cd /var/www/html/usage
# wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-flags.tgz
# tar -zxf webalizer-flags.tgz
# ll
总用量 188
-rw-r--r-- 1 root root 6607 9月 7 11:30 ctry_usage_201201.png
-rw-r--r-- 1 root root 3652 9月 7 11:30 ctry_usage_201209.png
-rw-r--r-- 1 root root 5992 9月 7 11:30 daily_usage_201201.png
-rw-r--r-- 1 root root 5687 9月 7 11:30 daily_usage_201209.png
drwxr-xr-x 2 root root 12288 9月 7 11:30 flags
-rw-r--r-- 1 root root 4316 9月 7 11:30 hourly_usage_201201.png
-rw-r--r-- 1 root root 3650 9月 7 11:30 hourly_usage_201209.png
-rw-r--r-- 1 root root 7879 9月 7 11:30 index.html
-rw-r--r-- 1 root root 74757 9月 7 11:30 usage_201201.html
-rw-r--r-- 1 root root 37979 9月 7 11:30 usage_201209.html
-rw-r--r-- 1 root root 5153 9月 7 11:30 usage.png
-rw-r--r-- 1 root root 2883 9月 7 11:30 webalizer.hist
//所以,我们的国旗库路径在/var/www/html/usage/flags
webalizer的下载地址: http://www.webalizer.org/download.html
# cd /home/jtian/softwares
# wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.23-05-src.tgz
# tar -zxf webalizer-2.23-05-src.tgz
# cd webalizer-2.23-05/lang
# mv webalizer_lang.simplified_chinese webalizer_lang.simplified_chinese.bak
# iconv -f gb2312 -t utf-8 -s -c --verbose webalizer_lang.simplified_chinese.bak -o webalizer_lang.simplified_chinese 转换编码
webalizer_lang.simplified_chinese.bak:
# rm -rf webalizer_lang.simplified_chinese.bak
# cd ..
# vi graph.c
这里是在做汉化的基本过程,需要在最后加入下面的内容
void gdImageString(gdImagePtr im, gdFontPtr font, int x, int y, unsigned char *s, int color)
{
gdImageStringFT(im, 0 , color, "/usr/share/fonts/chinese/TrueType/STFANGSO.TTF", 9 , 0.0, x, y+9, s);
}
void gdImageStringUp(gdImagePtr im, gdFontPtr font, int x, int y, unsigned char *s, int color)
{
gdImageStringFT(im, 0 , color, "/usr/share/fonts/chinese/TrueType/STFANGSO.TTF", 9 , -PI/2, x, y-9 , s);
}
# mkdir -p /usr/share/fonts/chinese/TrueType/
//从windows上上传一个字体文件到上面建立的目录下
开始正式编译软件:
# ./configure --prefix=/usr/local/webalizer --with-gd=/usr/bin --with-gdlib=/usr/lib --with-png --with-pnglib --with-geoip=/usr/local/lib --with-language=simplified_chinese --enable-geoip --with-geodb=/usr/share/GeoDB
# make && make install clean
安装完成后
# cd /usr/local/webalizer
# ll
total 12
drwxr-xr-x 2 root root 4096 Sep 6 13:54 bin
drwxr-xr-x 2 root root 4096 Sep 6 13:54 etc
drwxr-xr-x 3 root root 4096 Sep 6 13:54 share
基本环境配置:
# mkdir /var/www/html/usage
//准备页面所在的目录地址
# cd /usr/local/webalizer/etc
# cp webalizer.conf.sample webalizer.conf
# vi webalizer.conf
//需要注意的是,这里的flags要用相对路径来表示,否则国旗图案将不能够正常显示
LogFile /etc/httpd/logs/access_log
OutputDir /var/www/html/usage
PageType htm*
PageType cgi
GeoDB yes
GeoDBDatabase /usr/share/GeoDB
GeoIP yes
GeoIPDatabase /usr/share/GeoIP
CountryGraph yes
CountryFlags yes
FlagDir flags
HideURL *.gif
HideURL *.GIF
HideURL *.jpg
HideURL *.JPG
HideURL *.png
HideURL *.PNG
HideURL *.ra
# cd /etc/ld.so.conf.d
# vi webalizer.conf
/usr/local/lib/
# ldconfig
# vi /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html/usage"
<Directory "/var/www/html/usage">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
AuthName "Webalizer Access"
AuthType Basic
AuthUserFile /etc/httpd/conf/htpasswd.users
Require valid-user
</Directory>
# htpasswd -c /etc/httpd/conf/htpasswd.users webalizer
New password:
Re-type new password:
Adding password for user webalizer
# service httpd restart
手动运行一下webalizer:
# /usr/local/webalizer/bin/webalizer -c /usr/local/webalizer/etc/webalizer.conf
Webalizer V2.23-05 (Linux 2.6.32-220.el6.x86_64 x86_64) Simplified Chinese
使用日志文件 /etc/httpd/logs/access_log (clf)
输出结果到 /var/www/html/usage
产生报表的主机名是 'www.lingling.com'
没有找到历史信息文件...
正在生成报表 ---- 为 九月 2012
正在保存历史信息文件...
正在生成综合报表
76 条记录 共用时 1 秒, 76/sec
//可见正常的完成了日志的发布更新工作
本文出自 “无辜de心碎” 博客,请务必保留此出处http://chenjiuling.blog.51cto.com/3057028/989325
参考文章:
http://blog.slogra.com/post-86.html
http://www.chinaitpower.com/A/2005-05-10/116491.html
/article/3818244.html
webalizer + logzilla: /article/6930736.html
安装过程:
我们这里首先需要一个apache,作为webalizer的页面展示服务器
# yum -y install httpd
# yum -y install gd*
# yum -y install zlib*
# yum -y install font*
# yum install db4-devel
geoip软件下载:
http://www.findthatzip.com/search-41538008-hZIP/winrar-winzip-download-webalizer-geoip-2.1.10-13.tbz.htm
http://www.findthatzip.com/search-3066664-fZIP/winrar-winzip-download-webalizer-geoip-2.23.5.tbz.htm
# cd /home/jtian/softwares
# wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
# tar -zxf GeoIP.tar.gz
# cd GeoIP-1.4.8
# ./configure
# make && make install clean
# cd /home/jtian/softwares/GeoIP-1.4.8/data
# cp GeoIP.dat /usr/share/GeoIP
准备ip查询库:
# cd /home/jtian/softwares
# wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-geodb-latest.tgz
# tar -zxf webalizer-geodb-latest.tgz
# cp GeoDB.dat /usr/share/GeoDB
准备国旗图片库
在webalizer的首页上下载国旗库
# mkdir /var/www/html/usage ; cd /var/www/html/usage
# wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-flags.tgz
# tar -zxf webalizer-flags.tgz
# ll
总用量 188
-rw-r--r-- 1 root root 6607 9月 7 11:30 ctry_usage_201201.png
-rw-r--r-- 1 root root 3652 9月 7 11:30 ctry_usage_201209.png
-rw-r--r-- 1 root root 5992 9月 7 11:30 daily_usage_201201.png
-rw-r--r-- 1 root root 5687 9月 7 11:30 daily_usage_201209.png
drwxr-xr-x 2 root root 12288 9月 7 11:30 flags
-rw-r--r-- 1 root root 4316 9月 7 11:30 hourly_usage_201201.png
-rw-r--r-- 1 root root 3650 9月 7 11:30 hourly_usage_201209.png
-rw-r--r-- 1 root root 7879 9月 7 11:30 index.html
-rw-r--r-- 1 root root 74757 9月 7 11:30 usage_201201.html
-rw-r--r-- 1 root root 37979 9月 7 11:30 usage_201209.html
-rw-r--r-- 1 root root 5153 9月 7 11:30 usage.png
-rw-r--r-- 1 root root 2883 9月 7 11:30 webalizer.hist
//所以,我们的国旗库路径在/var/www/html/usage/flags
webalizer的下载地址: http://www.webalizer.org/download.html
# cd /home/jtian/softwares
# wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.23-05-src.tgz
# tar -zxf webalizer-2.23-05-src.tgz
# cd webalizer-2.23-05/lang
# mv webalizer_lang.simplified_chinese webalizer_lang.simplified_chinese.bak
# iconv -f gb2312 -t utf-8 -s -c --verbose webalizer_lang.simplified_chinese.bak -o webalizer_lang.simplified_chinese 转换编码
webalizer_lang.simplified_chinese.bak:
# rm -rf webalizer_lang.simplified_chinese.bak
# cd ..
# vi graph.c
这里是在做汉化的基本过程,需要在最后加入下面的内容
void gdImageString(gdImagePtr im, gdFontPtr font, int x, int y, unsigned char *s, int color)
{
gdImageStringFT(im, 0 , color, "/usr/share/fonts/chinese/TrueType/STFANGSO.TTF", 9 , 0.0, x, y+9, s);
}
void gdImageStringUp(gdImagePtr im, gdFontPtr font, int x, int y, unsigned char *s, int color)
{
gdImageStringFT(im, 0 , color, "/usr/share/fonts/chinese/TrueType/STFANGSO.TTF", 9 , -PI/2, x, y-9 , s);
}
# mkdir -p /usr/share/fonts/chinese/TrueType/
//从windows上上传一个字体文件到上面建立的目录下
开始正式编译软件:
# ./configure --prefix=/usr/local/webalizer --with-gd=/usr/bin --with-gdlib=/usr/lib --with-png --with-pnglib --with-geoip=/usr/local/lib --with-language=simplified_chinese --enable-geoip --with-geodb=/usr/share/GeoDB
# make && make install clean
安装完成后
# cd /usr/local/webalizer
# ll
total 12
drwxr-xr-x 2 root root 4096 Sep 6 13:54 bin
drwxr-xr-x 2 root root 4096 Sep 6 13:54 etc
drwxr-xr-x 3 root root 4096 Sep 6 13:54 share
基本环境配置:
# mkdir /var/www/html/usage
//准备页面所在的目录地址
# cd /usr/local/webalizer/etc
# cp webalizer.conf.sample webalizer.conf
# vi webalizer.conf
//需要注意的是,这里的flags要用相对路径来表示,否则国旗图案将不能够正常显示
LogFile /etc/httpd/logs/access_log
OutputDir /var/www/html/usage
PageType htm*
PageType cgi
GeoDB yes
GeoDBDatabase /usr/share/GeoDB
GeoIP yes
GeoIPDatabase /usr/share/GeoIP
CountryGraph yes
CountryFlags yes
FlagDir flags
HideURL *.gif
HideURL *.GIF
HideURL *.jpg
HideURL *.JPG
HideURL *.png
HideURL *.PNG
HideURL *.ra
# cd /etc/ld.so.conf.d
# vi webalizer.conf
/usr/local/lib/
# ldconfig
# vi /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html/usage"
<Directory "/var/www/html/usage">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
AuthName "Webalizer Access"
AuthType Basic
AuthUserFile /etc/httpd/conf/htpasswd.users
Require valid-user
</Directory>
# htpasswd -c /etc/httpd/conf/htpasswd.users webalizer
New password:
Re-type new password:
Adding password for user webalizer
# service httpd restart
手动运行一下webalizer:
# /usr/local/webalizer/bin/webalizer -c /usr/local/webalizer/etc/webalizer.conf
Webalizer V2.23-05 (Linux 2.6.32-220.el6.x86_64 x86_64) Simplified Chinese
使用日志文件 /etc/httpd/logs/access_log (clf)
输出结果到 /var/www/html/usage
产生报表的主机名是 'www.lingling.com'
没有找到历史信息文件...
正在生成报表 ---- 为 九月 2012
正在保存历史信息文件...
正在生成综合报表
76 条记录 共用时 1 秒, 76/sec
//可见正常的完成了日志的发布更新工作
本文出自 “无辜de心碎” 博客,请务必保留此出处http://chenjiuling.blog.51cto.com/3057028/989325
相关文章推荐
- Linux部署webalizer日志分析工具
- linux下日志监控分析工具webalizer的安装及使用
- awstats日志分析工具部署
- apache 日志分析工具(webalizer、awstats)的使用
- Webalizer 日志分析工具
- Apache服务器的性能测试工具ab 、http_load 日志分析工具webalizer
- Apache服务器的性能测试工具ab 、http_load 日志分析工具webalizer
- Awstats日志分析工具部署
- Oracle9i LogMiner日志分析工具入门
- linux Apache 环境下安装AWStatsWEB日志分析工具
- mysql慢日志分析工具之mysqlsla学习笔记
- LINUX下性能监控工具NMON以及日志分析ANALYSER
- MySQL慢日志分析工具mysqlsla
- Linux下日志分析工具Awstats安装笔记
- GC日志分析工具汇总
- pt-query-digest查询日志分析工具
- GAEA Winlog v4.50 1CD(创建钻井日志和测井曲线的工具) GAEA Winsieve v1.2 1CD(快速输入和打印结晶粒度分析曲线)
- mysql日志分析工具-mysqldumpslow
- 可视化日志分析工具Gltail的安装与使用
- 搭建ELK(ElasticSearch+Logstash+Kibana)日志分析系统(十) elasticsearch集群部署