webalizer 増設するメモ(バーチャルホスト)

すでにwebalizerを設置しているホストで、バーチャルホストのログを解析する。

設定ファイルの用意

FreeBSDのWebalizerの設定ファイルは、/usr/local/etc/ja-webalizer.conf にあるが、もうひとつ解析するので、

# cp /usr/local/etc/ja-webalizer.conf /usr/local/etc/ja-webalizer_tfc.conf

として、LogFileOutputDirHistoryName、DNSCache、を再設定する。 特に、DNSCache を既存のものと別にしないといつまでたっても終わらない

LogFile        /usr/local/www/apache22/data/logs/xag
#LogFile        /var/log/tfc.kuji-clinic.info-access_log
OutputDir      /usr/local/www/apache22/data/webalizer_tfc
HistoryName	/usr/local/etc/webalizer_tfc.hist
#Incremental	no
HostName	guard.kuji-clinic.info

PageType	htm*
PageType	cgi
#PageType	shtml
#PageType	phtml
#PageType	php3
PageType	php
#PageType	pl
#PageType	rb 

UseHTTPS    yes

DNSCache	/usr/local/etc/dns_cache_tfc.db

DNSChildren	20
 
# Usually you want to hide these
HideURL		*.gif
HideURL		*.GIF
HideURL		*.jpg
HideURL		*.JPG
HideURL		*.png
HideURL		*.PNG
HideURL		*.ra
HideURL		*.css
HideURL		*.CSS
HideURL		*.ico
 
#IgnoreSite	bad.site.net
#IgnoreURL	/test*
#IgnoreReferrer	file:/*
#IgnoreAgent	RealPlayer
#IgnoreUser     root

# End of configuration file...  Have a nice day!

japanese/webalizerを設置するメモ

japanese/webalizer のインストール

#portinstall japanese/webalizer

http://piano.smb.net/webalizer

http://www.smb.net/webalizer

http://www.niihama-med.or.jp/webalizer

http://guard.kuji-clinic.info/webalizer

option_webalizer.gif文字変換有効にオプション設定してみる。

CoolMaster:root {73} % cp ja-webalizer.conf-dist ja-webalizer.conf
CoolMaster:root {74} % mkdir /usr/local/www/apache22/data/webalizer
CoolMaster:root {75} % ja-webalizer -c /usr/local/etc/ja-webalizer.conf
ja-webalizer: Command not found.
CoolMaster:root {76} % rehash
CoolMaster:root {77} % ja-webalizer -c /usr/local/etc/ja-webalizer.conf
Webalizer V2.20-01 (FreeBSD 6.3-RELEASE-p5 i386) Japanese
Using logfile /var/log/httpd-access.log (clf)
Creating output in /usr/local/www/apache22/data/webalizer
Hostname for reports is 'piano.smb.net'
History file not found...
Skipping bad record (1)
Generating report for October 2008
Saving history information...
Generating summary report
17225 records (1 bad) in 1 seconds, 17225/sec
CoolMaster:root {78} % cp -Rp /usr/local/www/apache22/data/webalizer /usr/local/www/data/webalizer

japanese/webalizer の設定

CoolMaster:root {108} % pwd
/usr/local/etc
CoolMaster:root {107} % diff -urN ja-webalizer.conf-dist ja-webalizer.conf
--- ja-webalizer.conf-dist      2008-10-11 06:36:18.000000000 +0900
+++ ja-webalizer.conf   2008-10-11 11:57:56.000000000 +0900
@@ -27,6 +27,7 @@
 # is being read.

 #LogFile        /var/lib/httpd/logs/access_log
+LogFile        /var/log/httpd-access.log

 # LogType defines the log type being processed.  Normally, the Webalizer
 # expects a CLF or Combined web server log as input.  Using this option,
@@ -41,6 +42,7 @@
 # If no output directory is specified, the current directory will be used.

 #OutputDir      /var/lib/httpd/htdocs/usage
+OutputDir       /usr/local/www/data/webalizer

 # HistoryName allows you to specify the name of the history file produced
 # by the Webalizer.  The history file keeps the data for previous months,
@@ -91,7 +93,7 @@
 # try to get the hostname via a uname system call.  If that fails,
 # it will default to "localhost".

-#HostName      www.webalizer.org
+HostName       piano.smb.net

 # HTMLExtension allows you to specify the filename extension to use
 # for generated HTML pages.  Normally, this defaults to "html", but
@@ -110,7 +112,7 @@
 #PageType      shtml
 #PageType      phtml
 #PageType      php3
-#PageType      php
+PageType       php
 #PageType      pl
 #PageType      rb

@@ -171,7 +173,7 @@
 # relative to the default output directory.  See the DNS.README file for
 # additional information.

-#DNSCache      dns_cache.db
+DNSCache       /usr/local/etc/dns_cache.db

 # DNSChildren allows you to specify how many "children" processes are
 # run to perform DNS lookups to create or update the DNS cache file.
@@ -185,7 +187,7 @@
 # normal system operations.  Reasonable values should be between 5 and
 # 20.  See the DNS.README file for additional information.

-#DNSChildren   0
+DNSChildren    20

 # CacheIPs allows unresolved IP addresses to be cached in the DNS
 # database.  Normally, only resolved addresses are saved.  At some
@@ -660,8 +662,16 @@
 # remember, the use of these will MAKE YOUR STATS INACCURATE and you
 # should consider using an equivalent 'Hide*' keyword instead.

-#IgnoreSite    bad.site.net
-#IgnoreURL     /test*
+IgnoreSite     219.117.246.208
+IgnoreSite     210.255.122.209
+IgnoreSite     smb208.smb.net
+IgnoreSite     gw.kuji-clinic.net
+
+#IgnoreURL     /
+IgnoreURL      /mailman*
+IgnoreURL      /~tfc/anonymouse_mailform/*
+IgnoreURL      /~kuji/pukiwiki-1.4.7_notb_utf8/skin*
+IgnoreURL      /cgi-bin*
 #IgnoreReferrer        file:/*
 #IgnoreAgent   RealPlayer
 #IgnoreUser     root

cron で自動更新

vi /root/bin/japanese_webalizer.sh

#!/bin/sh
ja-webalizer -c /usr/local/etc/ja-webalizer.conf

vi /etc/crontab

00	0	*	*	*	root	/root/bin/japanese_webalizer.sh

を追加。

apache のログローテションは5:00 なのだが、合わせなくて良いのかな??

http://freebsd.server-manual.com/webalizer.html


Counter: 5341, today: 1, yesterday: 0

2014-04-28 (月) 17:36:57



トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS