我们在参考有关Squid的资料时,可能会发现有些资料适用于老版本的Squid,但是自己使用的是当前最新的Squid 3.x版本,有些配置项并不通用。本文总结了一些常会用到的配置在Squid 2.7和Squid 3.0之间的不同之处。

从1996年到现在,Squid发展了很长的时间。Squid 3.0的***个稳定版在2007年底发布,与之前的2.x系列有一些不同。本文列举一些常见的Squid 3.0与Squid 2.7在配置方面的不同之处。

从Squid 2.7到Squid 3.0的配置改变一览(squid配置详解)  Squid 3.0 2.7 第1张

Squid 3.0最重要的新特性:

  1. Code converted to C++, with significant internal restructuring and rewrites.
  2. ICAP implementation (RFC 3507 and www.icap-forum.org)
  3. Edge Side Includes (ESI) implementation (www.esi.org)

更多的请参考官方说明

来说说配置方法的不同之处(只说我自己实际使用的)

./configure的配置项

./configure
--prefix=/usr/local/squid
--with-large-files
--enable-useragent-log
--enable-referer-log
--enable-linux-netfilter
--enable-x-accelerator-vary
--disable-internal-dns
--disable-mempools
--with-maxfd=65535

3.0版本去掉了以下选项:

--enable-dlmalloc 不再需要

--enable-epoll 系统会自己选择***的I/O Loop Method

--enable-truncate 不再需要

--enable-follow-x-forwarded-for 没有此项配置了

增加了以下选项:

--disable-mempools 相当于2.7配置文件里面的memory_pools off,适合内存使用较大的情况,系统会调用free()来清除没用到的缓存内存

--with-maxfd=65535 相当于ulimit -n 65535,2.7配置文件里面的max_filedescriptors 65535

配置文件(Squid.conf)差别

在Squid3.0版本的配置文件中,如下主要tag发生了变化

acl 去掉了对src为all的定义,已集成;对protocol的定义简写为proto

http_port 去掉了选项http11和act_as_origin;增加了类型http_status

cache_peer 去掉了选项http11

header_access 删除了此tag,以request_header_access和reply_header_access取代

server_http11 删除了此tag

incoming_rate 删除了此tag

memory_pools 删除了此tag,在./configure的时候实现

max_filedescriptors 删除了此tag,在./configure的时候实现

上面只列出了我自己实际配置Squid时,3.0版本和2.7版本的不同之处,关于更多的大家可以参考官方文档。

参考文档

http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE14-RELEASENOTES.html

转载请说明出处
知优网 » 从Squid 2.7到Squid 3.0的配置改变一览(squid配置详解)

发表评论

您需要后才能发表评论