VPSをキャッシュサーバとして使う

(追記あり)

タイトルの経緯は、アレがアレでアレということです。アレ。

某所のVPSを契約して、Squidぶち込んで、設定して、ブラウザに串を刺す。ここまで約2時間。

squid.conf

acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1

acl ikanet src all

acl winupdate dstdomain .microsoft.com .windowsupdate.com

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl CONNECT method CONNECT

auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/.htpasswd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
acl password proxy_auth REQUIRED

http_access allow password
http_access allow winupdate
http_access allow ikanet
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all

http_port 8080

hierarchy_stoplist cgi-bin ?

cache_dir ufs /var/spool/squid 1024 16 256

coredump_dir /var/spool/squid

refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

forwarded_for off

visible_hostname unknown

request_header_access Referer deny all
request_header_access X-Forwarded-For deny all
request_header_access Via deny all
request_header_access Cache-Control deny all

access_log /var/log/squid/access.log common

cache_mem 128 MB

cache_peer 127.0.0.1 parent 8081 7 no-query
never_direct allow all

とりあえずアレがアレになったのでよしとする。

にしても、仕事でもプライベートでもCentOSというかRed Hat系でハゲる。

2015/6/19 追記

以下の構成に変更。それに伴い、上記squid.confも修正。

串アルヨ -> squid -> ziproxy -> privoxy -> 魑魅魍魎

ziproxyはNextProxyとNextPortを変更して、それ以外はデフォルト。
privoxyはネット上に転がっているフィルタ設定を丸々コピー。
後は適宜変更していく、つもりだったけど面倒になって放置。