Squid を Windows で使う

プロキシサーバである Squid は、ウィンドウズ版もある。ダウンロードはこちらから。

で、c:\squid に置く場合はほとんど問題ない。上記サイトからバイナリをダウンロードして、アーカイブを解凍、c:\squid\sbin\squid -z を実行(これは、キャッシュディレクトリを作成する。c:\squid\var\cache ディレクトリがないとエラーになったら、cache ディレクトリだけは手動で作成すること)した後、c:\squid\sbin\squid.exe を実行すればいいと思う。

が、ウィンドウズなので、C:\Program Files\Squid などのロングファイル名の付いたディレクトリにセットアップしたい場合はどうするのだろう?ロングファイル名をそのまま squid.conf に書いてもエラーとなるだけなので、この場合は C:\Progra~1 など、ショートファイル名にするとよい。設定ファイルで該当する場所、すべてを書き換える。他にも、すべてのサイトにアクセス場合とか、親プロキシを指定したい場合とか、以下の通り。

# 親プロキシを指定したい場合。ウィンドウズだけでプロキシる場合は、いらない。 cache_peer proxy.yourdomain.com parent 8080 7 proxy-only no-query # すべてのネットワークにアクセスしたい。 acl our_networks src 127.0.0.1/255.255.255.255 http_access allow our_networks # deny all の前に書く # And finally deny all other access to this proxy http_access deny all # d:/data/squid/cache ディレクトリを作成 cache_dir ufs d:/data/squid/cache 10000 16 256 # 以下、おおよそ必要なものを挙げてみた auth_param basic program c:/progra~1/squid/libexec/ncsa_auth.exe c:/progra~1/squid/etc/passwd.exe access_log c:/progra~1/squid/var/logs/access.log squid cache_log c:/progra~1/squid/var/logs/cache.log cache_store_log c:/progra~1/squid/var/logs/store.log mime_table c:/progra~1/squid/etc/mime.conf pid_filename c:/progra~1/squid/var/logs/squid.pid diskd_program c:/progra~1/squid/libexec/diskd-daemon.exe unlinkd_program c:/progra~1/squid/libexec/unlinkd.exe icon_directory c:/progra~1/squid/share/icons error_directory c:/progra~1/squid/share/errors/English coredump_dir c:/progra~1/squid/var/cache