proxy代理   soft软件   IT 业界特快   norton 诺顿病毒库   代理列表   search FTP搜索   whois IP地理位置   blog 追求完美  
money理财   life生活   RSS聚合门户   firefox WEB浏览器   免费域名   typeset 假古文   AntiVirus 反病毒   ipcn 站点导航  

« 架了个面向教育网和网通的星际战网(battle.net) | Main | php 编译: gd freetype imagettfbbox »

July 18, 2006

Squid 2.6 升级指南

版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。
https://windtear.net/archives/2006/07/18/001034.html
Squid 2.6 升级指南

相关文章:
Squid 2.6.PRE2 release

http_port 80 改为
http_port 80 vhost

cache_access_log ... 改为
access_log ...

no_cache ...改为
cache ...

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_single_host off
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
删除
改为(定义内部DNS或hosts文件 或根据具体情况定义acl 设置转发)
acl ipcndm   dstdomain  .ipcn.org
cache_peer www.ipcn.org parent 80 0 no-query no-digest no-netdb-exchange login=PASS originserver
cache_peer_access www.ipcn.org allow ipcndm
cache_peer_access www.ipcn.org deny all

always_direct allow !ipcndm
never_direct allow ipcndm

其他还有很多
比如:不记图片类访问日志
acl nolog urlpath_regex \.gif \.jpg \.css \.js \.swf
access_log /data/squid/var/logs/access.log common !nolog

squid.conf 配置官方参数相关改动说明:
1.	http_port加参数
a)	http_port 80 vhost
2.	cache_peer hostname type http_port icp_port [options]
a)	originserver
b)	sourcehash
c)	name=xxx 加速同一机器时不同端口时定位用
3.	no_cache 改为 cache
a)	cache deny QUERY
4.	cache_vary on
a)	Set to off to disable caching of Vary:in objects.
5.	broken_vary_encoding 不要相信apache的 ETag 和gzip版本一样
a)	acl apache rep_header Server ^Apache (补注: 新版apache 已加-gzip标记)
b)	broken_vary_encoding allow apache
6.	logformat
a)	
b)	%>a %ui %un [%tl] "%rm http://%{Host}>h%ru HTTP/%rv" %Hs %<st \
"%{Referer}>h" "%{User-Agent}>h" "%{Cookie:;cookie_name}>h"
c)	apache参考:LogFormat "%h %l %u %t \"%m http://%v%U %H\" %>s %b \
\"%{Referer}i\" \"%{User-Agent}i\" \"%{cookie}n\"" squid
d)	下面是squid默认提供的
e)	#logformat squid  %ts.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
f)	#logformat squidmime  %ts.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A \
	%mt [%>h] [%<h]
g)	#logformat common %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st %Ss:%Sh
h)	#logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st \
	"%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
7.	access_log
a)	cache_access_log改为access_log
b)	access_log <filepath> [<logformat name> [acl acl ...]]
8.	check_hostnames on
9.	allow_underscore on
10.	refresh_pattern 增加
a)	ignore-no-cache
b)	ignore-private
c)	ignore-auth
11.	collapsed_forwarding off
12.	refresh_stale_hit 0 seconds
13.	follow_x_forwarded_for deny all
14.	acl_uses_indirect_client on
15.	log_uses_indirect_client on
16.	log_access	allow|deny acl acl...
17.	httpd_suppress_version_string off (不显示/具体版本号)
18.	httpd_accel_host删除
19.	httpd_accel_port删除
20.	httpd_accel_single_host删除
21.	httpd_accel_with_proxy删除
22.	httpd_accel_uses_host_header删除
23.	error_map http://your.server/error/404.shtml 404
24.	via on (这个要打开 这样fowarding loop detect/死循环检测才生效)
本blog WWW

Posted by windtear at July 18, 2006 11:42 PM

本站使用中的任何问题,请与 windtear @ windtear.net 联系
Copyright© 1999-2024 Windtear. All rights reserved.