Squid

インストール    Squid Web Proxy Cache (Japan Mirror)
1 インストール
./configure --enable-err-language=Japanese
make
make install
2 squid.confの修正
vi /usr/local/squid/etc/squid.conf

-----------------------------------------------------
Squidのポート設定変更
# TAG: http_port
http_port 8080

キャッシュ変更
# TAG: cache_mem (bytes)
cache_mem 16 MB

# TAG: cache_dir
cache_dir ufs /usr/local/squid/cache 400 16 256 ← 容量(MB) ディレクトリの数 ファイルの数

アクセスの許可設定
#INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
acl [xxxx] src 192.168.0.0/24
http_access allow [xxxx]

プライベートアドレスのデータはキャッシュしない
# TAG: no_cache
acl privates dst 192.168.0.0/16 127.0.0.1/32
no_cache deny privates

キャッシュの有効期限
# TAG: refresh_pattern
refresh_pattern . 0 20% 4320

refresh_pattern . 0 20% 14400 ← 分(10日)

環境変数用設定
# TAG: visible_hostname
visible_hostname unknown

# TAG: forwarded_for on|off
forwarded for off
-----------------------------------------------------

3 初期化
cd /usr/local/squid/var
mkdir cache
chown nobody:nobody cache logs
/usr/local/squid/sbin/squid -z
4 起動・自動起動の設定
/usr/local/squid/sbin/squid &
/etc/rc.d/rc.localに記述すると自動起動
5 ログ更新
kill -USR1 `cat /usr/local/squid/var/logs/squid.pid`
crontabに記述すると自動的に更新