Linuxでwebalizerをインストールしてnginxとapacheログを解析

1.依存ライブラリをインストール
yum install gd-devel libpng-devel zlib-devel

2.webalizerをインストール
# wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.23-05-src.tgz
# tar xzf webalizer-2.23-05-src.tgz
# cd webalizer-2.23-05
# ./configure –prefix=/usr/local/webalizer –with-language=simplified_chinese
# make && make install

3.webalizer.confの変更
# cd /usr/local/webalizer/etc/
# cp webalizer.conf.sample webalizer.conf
# vi webalizer.conf

修正箇所:
LogFile /home/centos/log/access.log
OutputDir /home/centos/web/log
Incremental yes
HostName www.arkgame.com

LogFile /home/centos/log/access.log
Incremental yes
HostName www.arkgame.com
/usr/local/webalizer -c /usr/local/webalizer/etc/webalizer.conf

apacheログ形式:
LogFormat “%h %l %u %t “%r" %s %b “%{Referer}i" “%{User-agent}i""

Nginx

Posted by arkgame