Squid

Squid

作者:LAMP小白  点击:1625  发布日期:2013-05-06 22:42:00  返回列表

目录

/etc/squid


ICP协议的缓存服务器

CDN = DNS+CACHE


去掉注释和空行

Grep -v ‘^#’ squid.conf | grep -v “^$”


配置

定义Acl资源


IP/网段

ALL src x.x.x.x/xx


域名

Acl cname srcdomain .mx1985.com


目标地址

Dstdom


来源地址

Srcdom


反向加速服务器

Acl test aclname dstdom .mx1985.com

http_access allow test


Cache_mem 15000MB


Vhost 多台服务器

Vport 一台服务器

Accel 加速模式运行

http_port 80 accel vhost vport=xx


Sransparent 透明代理


http_port 3128 transparent

Iptables -t nat PREROUTING -s 192.168.0.0/24 -i eth1 -j REDIRECT --to-port 3128


设置规则

http_access deny all

http_access allow all


设置端口

http_Port


默认占用内存

Cache_mem


磁盘缓存目录

Cache_dir

          100MB 16个子目录 256的孙子目录

Ufs /var/xxx 100 16 256


Netstat -antp | grep squid


Telnet xxx.xxx.xxx....

GET http://www.mx1985.com






上一篇:Httpd vhost 下一篇:快递查询API
0