以下、ディレクトリ構成などはFedoraを想定。
#yum install webalizer
/etc/webalizer.confを編集。ログファイルの位置と出力先のディレクトリをlighttpdに合わせる。
LogFile /var/log/lighttpd/access_log OutputDir /srv/www/lighttpd/usage
同様に/etc/cron.daily/00webalizer内のログファイル位置を編集。
#! /bin/bash # update access statistics for the web site if [ -s /var/log/lighttpd/access_log ] ; then /usr/bin/webalizer fi exit 0
webalizerを起動してusage下に解析結果が生成されることを確認する。
#webalizer
/usageに認証を設定する。
/etc/lighttpd.confでバーチャルホストごとにログを設定しておく。
$ mkdir /srv/www/lighttpd/usage/vhost $ mkdir /etc/webalizer $ cp /etc/webalizer.conf /etc/webalizer/vhost.conf $ vi /etc/webalizer/vhost.conf $ cat /etc/webalizer/vhost.conf LogFile /var/log/lighttpd/vhost.access_log OutputDir /srv/www/lighttpd/usage/vhost HistoryName /var/lib/webalizer/vhost.hist IncrementalName /var/lib/webalizer/vhost.current HostName vhost
$ vi /etc/cron.daily/00webalizer $ cat /etc/cron.daily/00webalizer #! /bin/bash # update access statistics for the web site if [ -s /var/log/lighttpd/access_log ] ; then /usr/bin/webalizer fi if [ -s /var/log/lighttpd/vhost.access_log ] ; then /usr/bin/webalizer -c /etc/webalizer/vhost.conf fi exit 0