Personal tools
You are here: Home PC Linux Webalizer
Document Actions

Webalizer

by かわうぃん last modified 2006-01-29 06:59

Webalizerによるアクセス解析設定、バーチャルホストも含む

アクセスログを表示するためにWebalizerを使用しています。http://www.webalizer.org/からダウンロード
コマンドは、

/usr/local/bin/webalizer -c /etc/webalizer.conf

Confファイルは、/etc/webalizer.conf.sampleにあるので、これをコピーして流用します。

Confファイル設定内容(最低限のみ抜粋)

# LogFile は、使用するWebサーバーログを指定。

LogFile        /var/lib/httpd/logs/access_log

# OutputDir は、Webalizerの出力ファイルを生成する位置を指定。Webブラウジング可能なように権限等与える

OutputDir      /var/lib/httpd/htdocs/usage

# HistoryName は、Webalizerにより生成された履歴ファイル名を記述する。このファイルは12ヶ月間ログを維持し、TOPページ生成にも使用される。絶対パスにて指定
HistoryName    webalizer.hist

# Incremental は単一ログファイルの変わりに複数分割したログ使用を許可。
Incremental    yes

# IncrementalName は、増分データを保存するためのファイル名を記述。上記YESの場合必要
IncrementalName        webalizer.current

そこで、それぞれConfファイルを/etcの下に生成します。
/etc/webalizer.apache.conf

LogFile /var/log/httpd/access_log
OutputDir /var/www/usage/apache
HistoryName     /var/lib/webalizer/webalizer.apache.hist
Incremental yes
IncrementalName /var/lib/webalizer/webalizer.apache.current

自動起動

/etc/cron.daily/の中に00webalizerスクリプトがあるので、こちらを複製し様々なCondを読み込む。

#! /bin/bash
# update access statistics for the web site

if [ -s /var/log/httpd/zopeserver-access_log ] ; then
/usr/bin/webalizer -c /etc/webalizer.apache.conf
fi

exit 0

 


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: