我的BLOG开张了,做好准备喔!!!

squid 的一个配置config研究学习用

上一篇 / 下一篇  2008-09-18 01:18:14 / 个人分类:技术文章

本以为来这里可以解决问题,结果连个回复都没有,唉,难道高手都闭关修炼去了
靠人不如靠自己,问题已经解决了,贴出来大家共享下巴,可怜我调服务器调到1点钟

# 监听80端口,并配置为加速模式
http_port 80 vhost vport http11

# cache服务器之间通信的端口UDP
icp_port 3130

# cache服务器的名称
visible_hostname nn.xx.com

# cache目录和大小的设置,1GB硬盘空间和500M内存
cache_dir aufs f:/squid/var/cache 2048 16 256
#cache_dir null f:/squid/var/cache  
cache_mem 500 MB

#不记录访问日志
#access_log f:/squid/var/logs/access.log squid
access_log none

#记录squid日志
cache_log f:/squid/var/logs/cache.log

#不记录缓存存储日志
#cache_store_log f:/squid/var/logs/store.log emulate_httpd_log on
cache_store_log none

cache_swap_low 90
cache_swap_high 95
minimum_object_size 0 KB
maximum_object_size 1 MB
maximum_object_size_in_memory 4 MB

######强烈建议写上下面两句,经测试能显著提高Mem_hit 至少我的很有效#####
memory_replacement_policy heap LFUDA      
cache_replacement_policy heap GDSF

memory_pools on
memory_pools_limit 500 MB

# 设置要缓存的“图片服务器”的地址,这里我设为缓存本机8080 端口,对应外网为 img.A.com
cache_peer 127.0.0.1 parent 8080 0 no-query originserver no-digest name=ImgDataServer

# 设置要不缓存,只是代理转发的 新闻服务器的地址,这里我设为缓存本机8081 端口,对应外网为 news.A.com
#若要缓存,把proxy-only 改成 originserver 即可
cache_peer 127.0.0.1 parent 8081 0 no-query proxy-only no-digest name=NewsDataServer

# 设置要不缓存,只是代理转发的 论坛服务器的地址,这里我设为缓存本机8082 端口,对应外网为 bbs.A.com
cache_peer 127.0.0.1 parent 8082 0 no-query proxy-only no-digest name=BBSDataServer

# 注意了,这里设置外网用户访问过来,如何根据主机头转发到相应的本机站点
#设定 任何img.A.com 的请求都交给 mapDataServer,也就是我们做了缓存的图片服务器
cache_peer_domain ImgDataServer img.A.com

#设定 任何news.A.com 的请求都交给NewsDataServer,是我们只做转发的新闻服务器
cache_peer_domain NewsDataServer news.A.com

#设定 任何news.A.com 的请求都交给NewsDataServer,是我们只做转发的新闻服务器
cache_peer_domain BBSDataServer BBS.A.com




   acl QUERY urlpath_regex cgi-bin \?
    acl forcecache url_regex -i \.ashx
    no_cache allow forcecache
    no_cache deny QUERY

    refresh_pattern -i \.ashx 1440 50% 10080 override-expire override-lastmod reload-into-ims ignore-reload


cache_vary on
# 主机文件路径
hosts_file c:/windows/system32/drivers/etc/hosts

acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8

# 允许所有用户访问
http_access allow all
# 缓存管理员
cache_mgrwebmaster@example.com

http://home.arcor.de/jeffpang/squid/chap06.html SQUID权威指南
http://wiki.ubuntu.org.cn/Squid%E9%85%8D%E7%BD%AE%E8%AF%A6%E8%A7%A3  SQUID配置详解

 

 

http://hi.baidu.com/wsh1688/blog/item/25088a3458067eb3d0a2d3b1.html

这里有个配置跟起落的很像.可以研究,

 

acl all src 0.0.0.0/0.0.0.0
acl aclname dstdomain .3736.net
http_access allow aclname
http_access deny all

自已写的


TAG: config squid 学习 研究

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-11-20  
      1
2345678
9101112131415
16171819202122
23242526272829
30      

数据统计

  • 访问量: 7632
  • 日志数: 105
  • 图片数: 5
  • 影音数: 2
  • 文件数: 2
  • 书签数: 5
  • 建立时间: 2007-05-01
  • 更新时间: 2008-10-31

RSS订阅

Open Toolbar