基本設定

広告

利用するにあたって基本設定を行っていきます。まずインストールしたディレクトリに含まれる「sample.conf」をコピーして「webalizer.conf」と言うファイルを作成します。

Webalizerの基本設定

作成した「webalizer.conf」はテキストファイルですのでテキストエディタで開いて下さい。

#
# Sample Webalizer configuration file
# Copyright 1997-2000 by Bradford L. Barrett (brad@mrunix.net)
#

...

「#」で始まる行はコメントになっています。では順番に見ていきましょう。

対象のログファイルの位置

まず解析の対象となるログファイルの位置を指定します。「LogFile」に対してファイル名をフルパスで指定します。

# LogFile defines the web server log file to use.  If not specified
# here or on on the command line, input will default to STDIN.  If
# the log filename ends in '.gz' (ie: a gzip compressed file), it will
# be decompressed on the fly as it is being read.

#LogFile        /var/lib/httpd/logs/access_log

現在上記のようになっています。まず「LogFile」の先頭の「#」を外します。そして例えばログファイルの位置が「D:¥Apache Group¥Apache2.2¥logs¥access.log」だった場合には次にように記述します。

# LogFile defines the web server log file to use.  If not specified
# here or on on the command line, input will default to STDIN.  If
# the log filename ends in '.gz' (ie: a gzip compressed file), it will
# be decompressed on the fly as it is being read.

LogFile        D:/Apache Group/Apache2.2/logs/access.log

対象のログファイルの形式

WebalizerはWebサーバだけではなくFTPサーバやプロキシサーバのログも解析が可能です。そこでどのタイプのログを解析の対象とするのかを指定します。「LogType」に対して識別子で指定します。

# LogType defines the log type being processed.  Normally, the Webalizer
# expects a CLF or Combined web server log as input.  Using this option,
# you can process ftp logs as well (xferlog as produced by wu-ftp and
# others), or Squid native logs.  Values can be 'clf', 'ftp' or 'squid',
# with 'clf' the default.

#LogType	clf

現在上記のようになっています。まず「LogType」の先頭の「#」を外します。そしてWebサーバのログを対象とする場合は「clf」を指定します。

# LogType defines the log type being processed.  Normally, the Webalizer
# expects a CLF or Combined web server log as input.  Using this option,
# you can process ftp logs as well (xferlog as produced by wu-ftp and
# others), or Squid native logs.  Values can be 'clf', 'ftp' or 'squid',
# with 'clf' the default.

LogType	clf

解析結果の保存ディレクトリ

解析した結果を保存するためのディレクトリを指定します。「OutputDir」に対してディレクトリ名をフルパスで指定します。

# OutputDir is where you want to put the output files.  This should
# should be a full path name, however relative ones might work as well.
# If no output directory is specified, the current directory will be used.

#OutputDir      /var/lib/httpd/htdocs/usage

現在上記のようになっています。まず「OutputDir」の先頭の「#」を外します。そして例えば結果を保存する位置が「D:¥webalizer¥out¥」だった場合には次にように記述します。

# OutputDir is where you want to put the output files.  This should
# should be a full path name, however relative ones might work as well.
# If no output directory is specified, the current directory will be used.

OutputDir      D:/webalizer/out

古い結果を残しておくかどうか

解析を実行すると古いアクセスログに対して行った結果は順次消えていくようにデフォルトではなっています。新しいログに対して解析を実行した場合にでも、古い解析結果を消さずに追加して新しい結果を加えていく場合には「Incremental」に対して「yes」を設定します。

# Incremental processing allows multiple partial log files to be used
# instead of one huge one.  Useful for large sites that have to rotate
# their log files more than once a month.  The Webalizer will save its
# internal state before exiting, and restore it the next time run, in
# order to continue processing where it left off.  This mode also causes
# The Webalizer to scan for and ignore duplicate records (records already
# processed by a previous run).  See the README file for additional
# information.  The value may be 'yes' or 'no', with a default of 'no'.
# The file 'webalizer.current' is used to store the current state data,
# and is located in the output directory of the program (unless changed
# with the IncrementalName option below).  Please read at least the section
# on Incremental processing in the README file before you enable this option.

#Incremental	no

現在上記のようになっています。まず「Incremental」の先頭の「#」を外します。そして「no」の代わりに「yes」を記述します。

# Incremental processing allows multiple partial log files to be used
# instead of one huge one.  Useful for large sites that have to rotate
# their log files more than once a month.  The Webalizer will save its
# internal state before exiting, and restore it the next time run, in
# order to continue processing where it left off.  This mode also causes
# The Webalizer to scan for and ignore duplicate records (records already
# processed by a previous run).  See the README file for additional
# information.  The value may be 'yes' or 'no', with a default of 'no'.
# The file 'webalizer.current' is used to store the current state data,
# and is located in the output directory of the program (unless changed
# with the IncrementalName option below).  Please read at least the section
# on Incremental processing in the README file before you enable this option.

Incremental	yes

現在上記のようになっています。まず「Incremental」の先頭の「#」を外します。そして「no」の代わりに「yes」を記述します。

Webalizerは非常に多くの設定項目がありますので、全ての設定項目を見ていくのは大変なのですが、取りあえず基本的な設定として以上のことを行っておけば利用することは可能です。

( Written by Tatsuo Ikura )