Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1061778
  • 博文数量: 321
  • 博客积分: 7872
  • 博客等级: 少将
  • 技术积分: 2120
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-16 09:06
文章分类

全部博文(321)

文章存档

2017年(1)

2016年(1)

2015年(12)

2014年(17)

2013年(78)

2012年(15)

2011年(17)

2010年(67)

2009年(102)

2008年(11)

分类: LINUX

2009-11-02 11:36:01

本文来自: 作者:
原文链接: IT运维专家网--"自由平等,互助分享!"
安装笔记中的大多配置是默认的,作为测试用,如果要用到生产环境中还需更详细的配置,然后根据服务器运行状况不断调整,一般服务器可能会有多个虚拟主机,通过配置squid可以轻松为同一服务器上的多个虚拟主机进行缓存
cache_peer parent 80 0 no-query originserver
cache_peer parent 80 0 no-query originserver
acl exampleorg dstdomain .example.org.cn
acl examplenet dstdomain .example.net.cn

##1th
cache_peer_domain .example.org.cn
cache_peer_domain .example.net.cn
http_access allow exampleorg
http_access allow examplenet
http_access deny all
##2nd
cache_peer_access allow exampleorg
cache_peer_access allow examplenet
cache_peer_access deny all
cache_peer_access deny all
以上两种方式都可以达到为同一服务器上的多个虚拟主机进行缓存的目的,2.6改进之后配置相当灵活,包括Log配置、缓存规则配置、支持虚拟主机配置

另外需要注意一点的是经过apache的deflate模块压缩的文件可能不会被缓存,只要配置一下就可以
cache_vary on

squid常用命令
/usr/local/squid/sbin/squid -z 初始化缓存空间
/usr/local/squid/sbin/squid 启动
/usr/local/squid/sbin/squid -k shutdown 停止
/usr/local/squid/sbin/squid -k reconfigure 重新载入配置文件
/usr/local/squid/sbin/squid -k rotate 轮循日志
阅读(963) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~