UJP - 技術情報

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

     

IISにアクセスカウンタをつける

IISにアクセスカウンタをつける


0.更新履歴

  • 2001.09.11 新規作成

1.はじめに

 このドキュメントでは,IIS上で,アクセスカウンタをつけるためのCGIプログラム,Countを設定する.

2.プログラムの入手

2.インストール

  • 入手したファイルは,インストーラ形式になっているので実行する.

  • [はい]ボタンを押下する.

  • [Next]ボタンを押下する.

  • [Yes]ボタンを押下する.

  • [Next]ボタンを押下する.

  • インストールするパスを指定する.
    • ここでは,C:\inetpub\scriptsを指定している.
  • [Next]ボタンを押下する.

  • [はい]ボタンを押下する.

  • [Next]ボタンを押下する.

  • [Install]ボタンを押下する.

  • [Next]ボタンを押下する.

  • [Finish]ボタンを押下する.

3.カウンタを設定する

  • インストールされたディレクトリを見たら,次のようになっている.

  • C:\Inetpub\scripts\wcount\conf\count.cfgをメモ帳で開く.
  • 次のように設定する.

###-----------------------------------------------------------------------
### configuration file for Count 2.5
### Automatically generated from user input by the script Gen-conf
### created on: Tue Dec 29 19:18:49 EST 1998
### Note: Configuration file format for Count 2.5 is different than
###       older versions. -- mm
### The format of the file is described below:
###   - Any line starts with # or ; is considered comment and ignored.
###   - A section in the file is inside left and right bracket.
###   - Each section has parameters below the section.
###
### Please read the Configuration section in the counter webpage for details.
### The official counter homepage is at URL:
###     http://www.fccc.edu/users/muquit/Count.html
###----------------------------------------------------------------------
# versio section. follows the version number of the counter.
[version]
   2.5 
##-- options section
; If auto_file_creation=Yes, then the users can create data files. It IS
;  dangerous to set this option to Yes.
#
; strict_mode=Yes or No. Run the program in strict mode or not. It's a good
;  idea to set this option to Yes. Otherwise anyone will be able to run your
;  counter remotely.
#
; allow_rgb_database=Yes or No. Convenient to use because colorname e.g., red,
;  gold etc can be used instead of rgb components of the color, however it is
;  very inefficient to lookup. If your site is busy, set this option to No.
#
; count_reload=Yes or No. It is a good idea to set this option to No. But
;  you've to set this option to Yes if you are running a proxy server or 
;  like to count browser reload. Normally set this to No.
#
; log_error_messages=Yes or No. If your site is extremely busy and if the
;  coutner generates lots of logs, set this option to No. Normally set this
;  option to Yes.
#
; show_error_messages_to_browsers=Yes or No. Set this option to No if you are
;  concerned with privacy and you're sure that the counter works perfectly.
;  If you set this option to No, counter will not send error or warning
;  messages to the browsers. Normally set this option to Yes.
[options]
  auto_file_creation=No
  strict_mode=Yes
  allow_rgb_database=Yes
  count_reload=No
  log_error_messages=Yes
  show_error_messages_to_browsers=Yes
##--
; you can specify IP address of the hosts you want to ignore from counting.
; netmasks can be used to ignore a entire network or a specificrange of
; hosts in the network. Read the counter documentation to know about
; netmasks. Wild card can be used. one item per line.
;
[ignore IPs]
##--
; 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.
; putting a * will allow anyone in the world to run the counter remotely.
;
[authorized]
   localhost
   127.0.0.1
   testsvr.test.bo.jp

  • [authorizezd]セクションに,Countを実行できるIISサーバのホスト名かIPアドレスを設定すればよい.

4.カウンタファイルを作る

  • dataディレクトリ以下に,カウンタ値を保存するファイルを作成する.
  • 以下の手順は,コマンドプロンプトで,echoによってカウンタ用ファイルを作成している.

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-1999 Microsoft Corp.

C:\>cd c:\inetpub\scripts\wcount\data
C:\Inetpub\scripts\wcount\data>dir

 ドライブ C のボリューム ラベルがありません。

 ボリューム シリアル番号は A816-2AD9 です


 C:\Inetpub\scripts\wcount\data のディレクトリ

2001/09/11  12:58       <DIR>          .
2001/09/11  12:58       <DIR>          ..
2001/03/18  21:59                    2 sample.dat
2001/09/11  14:18                   13 top.dat
               2 個のファイル                  15 バイト

               2 個のディレクトリ   2,848,911,360 バイトの空き領域

C:\Inetpub\scripts\wcount\data>echo 1 > ee.dat

C:\Inetpub\scripts\wcount\data>dir

 ドライブ C のボリューム ラベルがありません。

 ボリューム シリアル番号は A816-2AD9 です


 C:\Inetpub\scripts\wcount\data のディレクトリ

2001/09/11  14:35       <DIR>          .
2001/09/11  14:35       <DIR>          ..
2001/09/11  14:36                    4 ee.dat
2001/03/18  21:59                    2 sample.dat
2001/09/11  14:18                   13 top.dat
               3 個のファイル                  19 バイト

               2 個のディレクトリ   2,848,911,360 バイトの空き領域

C:\Inetpub\scripts\wcount\data>

5.カウンタを使ってみる

  • 次のようなHTMLを作成し,IISのサーバに設置して呼び出してみると,カウンタが表示される.

<HTML>
<HEAD>
  <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0J Win">
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8">
  <TITLE>Untitled Document</TITLE>
</HEAD>
<BODY>

<P><CENTER><!--NOEDIT-->

<IMG SRC="http://testsvr.test.bo.jp/scripts/count.exe?dd=A|df=ee.dat"  
ALIGN=ABSCENTER>


<!--/NOEDIT--></CENTER>

</BODY>
</HTML>

  • カウンタをいっぱいつけたいときは,前出の手順でee.datに相当するファイルを作成すればよい.
  • なお,各種装飾については,インターネット上のドキュメントを参照のこと.



広告スペース
Google