Personal tools
You are here: Home サーバ設定 Webalizer Webalizerインストール
Document Actions

Webalizerインストール

by tamohiko last modified 2006-10-31 00:32

webalizerのインストール

環境

今回の作業は以下の環境で実行しています。 FedoraCore5
webalizer-2.01

インストール (yum編)

とりあえず、さくっと試してみたいのでyum でインストールします。

# yum install -y webalizer
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for webalizer to pack into transaction set.
webalizer-2.01_10-25.i386 100% |=========================| 101 kB 00:15
---> Package webalizer.i386 0:2.01_10-25 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
webalizer i386 2.01_10-25 base 101 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 101 k
Downloading Packages:
(1/1): webalizer-2.01_10- 100% |=========================| 101 kB 00:12
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: webalizer ######################### [1/1]

Installed: webalizer.i386 0:2.01_10-25
Complete!
webalizer基本設定

webalizerに数多くの設定項目がありますので、ここでは最低限必要な設定項目についてのみ記述します。

/etc/webalizer.confが設定ファイルなので、このファイルを設定します。
# cp -p /etc/webalizer.conf /etc/webalizer.conf_yyyymmdd   <--- 念のためバックアップ
# vi /etc/webalizer.conf
最低限必要な設定項目
  • LogFile       解析を行うapacheのログファイルの場所を指定します。
  • OutpotDir   解析結果を出力するディレクトリを指定します。
デフォルト設定値
LogFile   /var/log/httpd/access_log
OutputDir   /var/www/usage

webalizer実行

webalizerコマンドを実行すると、webalizer.confのOutputDir項目で設定したデイレクトリに解析結果が出力されます。

webalizer実行
# /usr/bin/webailzer
出力されたファイルたち
# cd /var/www/usage
# ls
ctry_usage_200608.png hourly_usage_200608.png usage.png
daily_usage_200608.png index.html usage_200608.html

解析結果の確認

webalizer.confデフォルトの設定を使用している場合は、webブラウザで、http://xxxxx/usage (xxxxxはwebサーバのIPアドレス)を表示すると解析結果を 確認することができます。

403 Forbidden

ブラウザで解析結果を確認しても、403 Forbidden が表示されてアクセス出来ない場合

/etc/httpd/conf.d を確認してみてください。webalizer.confという設定ファイルが作成されていると思います。

# cd /etc/httpd/conf.d
# ls
README mrtg.conf_org ssl.conf_org welcome.conf
mrtg.conf ssl.conf webalizer.conf <--このファイル

apacheのhttpd.confで特にアクセス制限をを行っていないのに、Forbiddenが表示されてしまうのは このファイルの中でアクセス制限の設定がされているためです。

/etc/httpd/conf.d/webalizer.conf設定内容
Alias /usage /var/www/usage

<Location /usage>
Order deny,allow
Deny from all
Allow from 127.0.0.1 <--自サーバからのみ閲覧許可設定
Allow from ::1
# Allow from .example.com
</Location>

Forbiddenにならないようにするには、Allow from を編集します。

/etc/httpd/conf.d/webalizer.confの編集
# cp -p /etc/httpd/conf.d/webalizer.conf /etc/httpd/conf.d/webalizer.conf_yyyymmdd
# vi /etc/httpd/conf.d/webalizer.conf
編集内容

閲覧を許可させたいクライアントのIP情報等をAllow from 項目に追加します。今回の例は192.168.0.0/24のネットワークからは 閲覧を許可するという設定にしてみました。

Alias /usage /var/www/usage

<Location /usage>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168.0.0/24 <--閲覧を許可するネットワークを追加 Allow from ::1 # Allow from .example.com </Location>
apacheでの設定反映

/etc/httpd/conf.d/webalizer.confの設定が終わったら、apacheにその設定ファイルの情報反映させます。

設定の読込
rpmでインストールされているapacheならば、以下の方法で設定の反映ができます。
# /etc/init.d/httpd reload
httpd を再読み込み中: [ OK ]
これで、無事閲覧できるようになるはずです。
Related content
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: