第 18 章 Squid - Internet Object Cache (WWW proxy cache)

目录

debian/ubuntu 安装
Proxy Server
Squid作为反向代理Cache服务器(Reverse Proxy)
代理+反向代理
Squid 管理
禁止页面被Cache
Squid 实用案例
Squid Apache/Lighttpd 在同一台服务器上
用非 root 用户守护 Squid

如果apache 安装了gzip,deflate需要开启cache_vary

cache_vary on

debian/ubuntu 安装

$ sudo apt-get install squid
$ sudo apt-get install squid
			
chown proxy.proxy -R /var/spool/squid
netkiller@Linux-server:/etc/squid$ sudo cp squid.conf squid.conf.old
netkiller@Linux-server:/etc/squid$ sudo vi squid.conf
http_access allow all
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
netkiller@Linux-server:~$ sudo squid -z
netkiller@Linux-server:~$ sudo squid -k reconfigure
		

源码安装

wget http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE13.tar.gz
./configure --prefix=/usr/local/squid-2.6
make all
make install

mkdir -p /usr/local/squid-2.6/var/cache
chown nobody.nobody -R /usr/local/squid-2.6/var/
ln -s /usr/local/squid-2.6 /usr/local/squid
cd /usr/local/squid

./squid -NCd1