WWWアクセスカウンタWWWCount

これも基本ですね

WWW Countとは

 私もそうですが、どれだけの人が自分のWebページにアクセスしに来ているかということについて、自分のWebページを持つ人で関心を持たない人はいないと思います。その関心を満たすのがアクセスカウンタです。

 アクセスカウンタには何種類もありますし、少々心得があれば自分で作成することも難しくはありませんが、その仲でも最もよく利用されているのがWWWCountだと思います。

 オプション機能を利用することにより、アクセスカウント以外にも年月日や時間の表示、またカウントの概観の変更などを行うことも出来ます。

 

WWW Countのインストール

 WWWCountは、untestedという形ではありますが、Turbo Linux JapanのFTPサイトにあります。

ftp://ftp.turbolinux.co.jp/pub/TurboLinux/stable/untested/current/i386/wwwcount-2.4-6.i386.rpm

 最新版はwwwcount-2.5-1.i386.rpmですが、私は上記のバージョンを利用しています。このファイルをダウンロードし、ダウンロードしたディレクトリに移動し、suしてrootになってから、

 rpm -Uvh wwwcount-2.4-6.i386.rpm

 でインストールされます。

 

WWW Countの設定と利用

 インストールが終了すると、/etcにwwwcounter.confというファイルが出来ます。WWWCounterの動作の制御はこのファイルで行うので、設定はこのファイルの内容を変更することになります。ちなみに、WWWCounterの実体は、/home/httpd/cgi-bin/Count.cgiになります。

 wwwcounter.confは小さいファイルですが、様々なオプションが用意されています。ここではとりあえず利用するための情報ということで、実際に私のサイトで利用している設定を以下に示します。

#######
# configuratin file for Count 2.4
# Automatically generated from user input by the script Gen-conf
# Created on: Tue Oct 21 17:43:28 EDT 1997
# Edit by hand, if you need to add something
##############################################
####
# BLOCK 1
# Allow automatic datafile creation or not
# it's a required block. 1 means allow, 0 means do not allow.
####
{
1
}
###
# BLOCK 2
# run the program in strict mode or not.
# it's a required block. 1 means strict, 0 means not strict.
###
{
1
}
####
# BLOCK 3
# Allow to use RGB color database. 1 means allow, 0 means don't.
# convenient to use because colorname e.g., red, gold etc can
# be used instead of rgb components of the color, however it's
# very inefficient to lookup.
####
{
1
}
####
# BLOCK 4
# Ignore count block, you might want to ignore the local sites.
# If you do not want to ignore any hosts from
# counting, just put { on one line and } on the next line but make sure
# the braces exist!
# It's a required block.
##
# netmasks can be used to ignore a entire network or a specific
# range of hosts in the network. Read the counter documentation to
# know about netmasks. Wild carding can be used.
# one item per line.
#131.249.*
####
{
192.168.0.*
127.0.0.1

}
####
# BLOCK 5
# Auth block
# All possible names and IP addresses by which your host can be referred.
# These hosts can access the counter remotely or locally. Host running
# the http server must exist here. Wild card can be used.
# one item per line.
##
{
192.168.0.100
*.bflets.dyndns.org
bflets.dyndns.org
localhost
}

 ちょっとだけアドバイスするならば、 BLOCK 4には自分のローカルマシンが持っているIPアドレスとローカルホストのIPアドレスを加えておくといいと思います。なぜかというと、自分でWebページの更新を行って更新内容の確認を行ったときに、この部分に何も設定をしていないとカウントされてしまうからです。

 あとは、カウンターを利用したいページ(通常サイトのトップページ)に以下の行を追加してやればOKです。

<img src="cgi-bin/Count.cgi?df=counter.dat&dd=B">