■squid(キャッシュサーバ)の設定例 # 使用ポート番号 http_port 80 # ここで指定した文字列がURL中に存在した場合、キャッシュしない設定 hierarchy_stoplist cgi-bin ? # 特定の条件(下記の場合は、URLのパスにcgi-bin \?がある場合)に当てはまる # 場合にキャッシュしない acl QUERY urlpath_regex cgi-bin \? no_cache deny QUERY # キャッシュ用のメモリの上限値 cache_mem 64 MB # キャッシュを整理するタイミングを指定。 # cache_swap_high の容量(%)に達したときにcache_swap_low の容量(%)まで # 小さくする。 cache_replacement_policy lru memory_replacement_policy lru cache_swap_low 90 cache_swap_high 95 # ファイルキャッシュの一つのファイルの最大サイズ maximum_object_size 4096 KB # メモリキャッシュの一つのファイルの最大サイズ maximum_object_size_in_memory 64 KB # ディスクへのキャッシュを行うディレクトリ cache_dir ufs /usr/local/squid/cache 8192 16 256 # クライアントの要求の状況を記録するファイル cache_access_log /usr/local/squid/logs/access_log # キャッシュ状況を記録するファイル cache_log /usr/local/squid/logs/cache_log # キャッシュ管理の動作状況を記録するファイル cache_store_log /usr/local/squid/logs/store_log # ログファイルを多くの 'httpd' プログラムが使用している形式を模倣して # 記録させる/させない emulate_httpd_log on # HTTP要求中の User-Agent ヘッダ記録するファイル useragent_log none # フルドメイン名を access.log に記録させる/させない log_fqdn off # URLリダイレクタの実行形式ファイルの場所 redirect_program /usr/local/squid/bin/redirector # リダイレクト要求のヘッダなどのいくつかのホストを書き換えさせる/させない redirect_rewrites_host_header off # アクセス許可の設定 acl all src 0.0.0.0/0.0.0.0 acl manager proto cache_object acl localhost src 127.0.0.1/255.255.255.255 acl SSL_ports port 443 563 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 563 # https, snews acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow all icp_access deny all # SQUID を使えるuserとgroup cache_effective_user www cache_effective_group www # 透過プロキシを有効にする設定 httpd_accel_port 8080 httpd_accel_host virtual httpd_accel_uses_host_header on # ログファイルの数を指定 logfile_rotate 0 # アロケートされている(しかし使われていない)メモリプールを、今後の使用の # ために取っておく/おかない memory_pools off back