「Squid で アクセス制御」の編集履歴(バックアップ)一覧に戻る

Squid で アクセス制御 - (2008/03/14 (金) 09:47:12) のソース

// 現在のページ名
*&this_page() 

**概要
プロキシ利用時に、特定のIPアドレスまたはドメインへのアクセスを禁止または許可する。

***元ネタ
-[[squid(アクセス制御の話がある)>>http://oku.edu.mie-u.ac.jp/~okumura/networking/squid.html]]

**前提条件
-[[Squid インストール]]

**手順
「c:\squid\etc\squid.conf」をエディタで編集する。

***10.0.0.0/8 と 127.0.0.1(自分自身)以外からの利用を禁止する場合 

#highlight(ini){
acl ourhosts src 10.0.0.0/255.0.0.0 127.0.0.1/255.255.255.255
http_access deny !ourhosts
}

***アクセスできないアドレスのブラックリストを作る 

#highlight(ini){
acl blacklist url_regex -i "c:/squid/ext/blacklist.txt"
acl blackpath urlpath_regex -i "c:/squid/ext/blackpath.txt"

http_access deny blacklist
http_access deny blackpath
}

***blacklist.txt の例
アクセスできないURLを正規表現で指定するファイル。 

^http://www.yahoo.co.jp/Business_and_Economy/Companies/Sex/
^http://www.yahoo.co.jp/Society_and_Culture/Sexuality/Activities_and_Practices/Anal_Sex/
記事メニュー
目安箱バナー