如何设置鱿鱼只caching特定的域名?

例如,我想让squid只为*.archive.ubuntu.comcaching被防火墙阻止的HTTP内容,而不会caching其他域。

而且,只有LAN(192.168.0.0/16)用户可以访问caching内容,但所有用户都可以访问非caching内容。

 User-IP Dest-Domain acl Expect ---------------- ----------------------- ------ ------------------------- 192.168.0.0/16 *.archive.ubuntu.com allow Cache Proxy, Fast 192.168.0.0/16 *.other allow Pass Proxy, Slow Other * allow Pass Proxy, Slow 

这是一个闪避,但如果你只关心自动cachingdebian / Ubuntu的包,尝试大约:

 apt-get install approx 

这要求客户端configuration为从代理服务器下载软件包列表,而不是通常的Ubuntu服务器,但是如果您已经使用puppet或cfengine等configurationpipe理软件,这很容易。

你的sources.list文件看起来像这样:

 deb http://my.proxy.tld:9999/ubuntu/ lucid lucid main restricted universe multiverse deb http://my.proxy.tld:9999/ubuntu-security/ lucid-security main restricted universe multiverse ... 

和你的approx.conf文件一样:

 ubuntu http://us.archive.ubuntu.com/ubuntu ubuntu-security http://security.ubuntu.com/ubuntu ...