用于Windows更新的Centos Squid代理服务器

前端之家收集整理的这篇文章主要介绍了用于Windows更新的Centos Squid代理服务器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在运行Centos 7作为我的操作系统并安装了squid来缓存我公司的 Windows更新.

通过日志文件,它显示所有内容都是tcp_miss,包括它何时访问Windows更新服务器.

我希望我的squid安装只缓存Windows更新.任何人都有任何想法发生了什么以及为什么它不缓存Windows更新?

以下是access.log文件的摘录:

  1. 1432161438.306 109488 192.168.5.163 TCP_MISS/200 4739 CONNECT exchange.heffron-it.com.au:443 - HIER_DIRECT/10.50.10.48 -
  2. 1432161441.375 110041 192.168.5.163 TCP_MISS/200 77216 CONNECT exchange.heffron-it.com.au:443 - HIER_DIRECT/10.50.10.48 -
  3. 1432161462.843 642 192.168.5.163 TCP_MISS/200 528 GET http://csm90-en.url.trendmicro.com/T/344/eqO8qdreMFHVsZPQHJe0cJKbush61hKMNSLH-GHMhZNC0gyHuu0CiOxud1YD3SlseyJzwmgic9qMFKrJvi2iP_ZVPlXHsmBt-a8QqO6MKTbQ5melaEY1Atd9fYSAYQRQgrChDZuAfCvHu2U5ddX40KEKuZF8YPclvhCb0giJpRgy7jPMiOyYA_wMJVDfGp5sGSbAVFEYRdJAR3hykIDkCPXPsqluymS-Y3axrSHHJzYG1b_F8GB04cbdakDlGZSBxwyHXbwiLzjcYfQ7K1ASldegziZO9ZUfRcZh1ce6txSK6qOZiDy45zaEUg63wIEEEM__EWcaJQmYIXIVS69vwQ== - HIER_DIRECT/104.72.70.19 text/html
  4. 1432161464.121 7 192.168.5.163 TCP_MISS/200 528 GET http://csm90-en.url.trendmicro.com/T/88/eqO8qdreMFHVsZPQHJe0cKMe63vDoh5niNui_qK5WZVN6azyvqm3qkTNA4CeLlgfBLjs_woCLvmIDOVQwkWfzQ== - HIER_DIRECT/104.72.70.19 text/html
  5. 1432161475.490 1793 192.168.5.163 TCP_MISS/200 6947 CONNECT www.windowssearch.com:443 - HIER_DIRECT/204.79.197.200 -
  6. 1432161475.892 399 192.168.5.163 TCP_MISS/200 5545 CONNECT www.windowssearch.com:443 - HIER_DIRECT/204.79.197.200 -
  7. 1432161487.787 1383 192.168.5.163 TCP_MISS/200 3074 CONNECT ieonlinews.microsoft.com:443 - HIER_DIRECT/131.253.34.240 -
  8. 1432161539.434 63609 192.168.5.163 TCP_MISS/200 8498 CONNECT www.windowssearch.com:443 - HIER_DIRECT/204.79.197.200 -
  9. 1432161578.224 235 192.168.5.206 TCP_MISS/200 839 GET http://wfbs900-en.census.trendmicro.com/CENSUS/192/628a34bf49944a0519fedb6d65cafaf0399b98e5d08e025bf6a03eddead1cef7af0edf488fd174e494ae518835ff9da21915bbe7aa372ec1c81e135a6361da635d174ae8fe5adb5f5d174ae8fe5adb5f5d174ae8fe5adb5ffd3c35acca94bf90 - HIER_DIRECT/104.72.70.19 text/html
  10. 1432161578.559 6 192.168.5.206 TCP_MISS/200 839 GET http://wfbs900-en.census.trendmicro.com/CENSUS/192/628a34bf49944a0519fedb6d65cafaf09a839741bab62522e6bf975b8a4f628051bd7ab79e147e846b4fa2b6ca99524eb805125d90361b4738af1be64789a8e65d174ae8fe5adb5f5d174ae8fe5adb5f5d174ae8fe5adb5ffd3c35acca94bf90 - HIER_DIRECT/104.72.70.19 text/html
  11. 1432161600.474 331 192.168.5.206 TCP_MISS/200 626 GET http://csm90-en.url.trendmicro.com/T/364/Q6aqjhhr3YQMpi9B-doTwi4FWHDaRESyTNq3zZ_1sX_X-hiFqggD7pEESKNYWwTGUOzuehXAiA3LwMcj4ro0WYN6zsxLXe4g-DX2HZ9dHAz7iA-

这是我目前的squid.conf文件

  1. acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
  2.  
  3. acl localnet src fc00::/7 # RFC 4193 local private network range
  4.  
  5. acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
  6.  
  7. acl localnet src corp.heffron-it.com.au
  8.  
  9.  
  10.  
  11. acl SSL_ports port 443
  12.  
  13. acl Safe_ports port 80 # http
  14.  
  15. acl Safe_ports port 21 # ftp
  16.  
  17. acl Safe_ports port 443 # https
  18.  
  19. acl Safe_ports port 70 # gopher
  20.  
  21. acl Safe_ports port 210 # wais
  22.  
  23. acl Safe_ports port 1025-65535 # unregistered ports
  24.  
  25. acl Safe_ports port 280 # http-mgmt
  26.  
  27. acl Safe_ports port 488 # gss-http
  28.  
  29. acl Safe_ports port 591 # filemaker
  30.  
  31. acl Safe_ports port 777 # multiling http
  32.  
  33. acl CONNECT method CONNECT
  34.  
  35.  
  36.  
  37. acl all src all
  38.  
  39. acl windowsupdate dstdomain windowsupdate.microsoft.com
  40.  
  41. acl windowsupdate dstdomain au.download.windowsupdate.com
  42.  
  43. acl windowsupdate dstdomain .update.microsoft.com
  44.  
  45. acl windowsupdate dstdomain download.windowsupdate.com
  46.  
  47. acl windowsupdate dstdomain redir.Metaservices.microsoft.com
  48.  
  49. acl windowsupdate dstdomain images.Metaservices.microsoft.com
  50.  
  51. acl windowsupdate dstdomain c.microsoft.com
  52.  
  53. acl windowsupdate dstdomain www.download.windowsupdate.com
  54.  
  55. acl windowsupdate dstdomain wustat.windows.com
  56.  
  57. acl windowsupdate dstdomain crl.microsoft.com
  58.  
  59. acl windowsupdate dstdomain sls.microsoft.com
  60.  
  61. acl windowsupdate dstdomain productactivation.one.microsoft.com
  62.  
  63. acl windowsupdate dstdomain ntservicepack.microsoft.com
  64.  
  65.  
  66.  
  67. acl wuCONNECT dstdomain www.update.microsoft.com
  68.  
  69. acl wuCONNECT dstdomain sls.microsoft.com
  70.  
  71. acl wuCONNECT dstdomain wpa.one.microsoft.com
  72.  
  73.  
  74.  
  75. http_access allow CONNECT wuCONNECT localnet
  76.  
  77. http_access allow CONNECT wuCONNECT localhost
  78.  
  79. http_access allow windowsupdate localnet
  80.  
  81. http_access allow windowsupdate localhost
  82.  
  83.  
  84.  
  85. cache_effective_user squid
  86.  
  87.  
  88.  
  89. http_access deny !Safe_ports
  90.  
  91. http_access deny CONNECT !SSL_ports
  92.  
  93.  
  94.  
  95. http_access allow localhost manager
  96. http_access deny manager
  97.  
  98.  
  99.  
  100. http_access allow localnet
  101.  
  102. http_access allow localhost
  103.  
  104.  
  105.  
  106. http_access allow WindowsUpdate
  107.  
  108.  
  109. http_access allow CONNECT wuCONNECT localnet
  110.  
  111. http_access allow windowsupdate localnet
  112.  
  113.  
  114.  
  115. request_header_access Allow allow all
  116.  
  117. request_header_access Authorization allow all
  118.  
  119. request_header_access WWW-Authenticate allow all
  120.  
  121. request_header_access Proxy-Authorization allow all
  122.  
  123. request_header_access Proxy-Authenticate allow all
  124.  
  125. request_header_access Cache-Control allow all
  126.  
  127. request_header_access Content-Encoding allow all
  128.  
  129. request_header_access Content-Length allow all
  130.  
  131. request_header_access Content-Type allow all
  132.  
  133. request_header_access Date allow all
  134.  
  135. request_header_access Expires allow all
  136.  
  137. request_header_access Host allow all
  138.  
  139. request_header_access If-Modified-Since allow all
  140.  
  141. request_header_access Last-Modified allow all
  142.  
  143. request_header_access Location allow all
  144.  
  145. request_header_access Pragma allow all
  146.  
  147. request_header_access Accept allow all
  148.  
  149. request_header_access Accept-Charset allow all
  150.  
  151. request_header_access Accept-Encoding allow all
  152.  
  153. request_header_access Accept-Language allow all
  154.  
  155. request_header_access Content-Language allow all
  156.  
  157. request_header_access Mime-Version allow all
  158.  
  159. request_header_access Retry-After allow all
  160.  
  161. request_header_access Title allow all
  162.  
  163. request_header_access Connection allow all
  164.  
  165. request_header_access Proxy-Connection allow all
  166.  
  167. request_header_access User-Agent allow all
  168.  
  169. request_header_access Cookie allow all
  170.  
  171. request_header_access All deny all
  172.  
  173.  
  174.  
  175. refresh_pattern -i microsoft.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
  176.  
  177.  
  178.  
  179. refresh_pattern -i windowsupdate.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
  180.  
  181.  
  182.  
  183. refresh_pattern -i windows.com/.*\.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip) 4320 80% 43200 reload-into-ims
  184.  
  185.  
  186.  
  187. http_access deny all
  188.  
  189.  
  190. http_port 3128
  191.  
  192. cache_dir ufs /home/Cache/squid 102400 16 256
  193.  
  194.  
  195.  
  196.  
  197.  
  198. coredump_dir /home/Cache/squid
  199.  
  200. via off
  201.  
  202. forwarded_for off
  203.  
  204.  
  205.  
  206.  
  207.  
  208. refresh_pattern ^ftp: 1440 20% 10080
  209.  
  210. refresh_pattern ^gopher: 1440 0% 1440
  211.  
  212. refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
  213.  
  214. refresh_pattern . 0 20% 4320
基于您在配置文件中已有的内容,我猜你已经找到了关于Windows更新的这个Squid FAQ: http://wiki.squid-cache.org/SquidFaq/WindowsUpdate

我建议指定以下缓存选项,以确保可以缓存更大的对象. maximum_object_size需要足够大以允许最大的更新文件. 32GB应该允许甚至是最大的Service Pack,甚至是您可能想要缓存的任何ISO文件.

  1. cache_mem 512 MB
  2. minimum_object_size 0
  3. maximum_object_size 32768 MB
  4. maximum_object_size_in_memory 16384 KB
  5. range_offset_limit 32768 MB windowsupdate
  6. quick_abort_min -1

如果这没有帮助,您可能还需要调查refresh_pattern行的以下附加选项(除了reload-into-ims):

> ignore-no-cache
> ignore-no-store
> ignore-private
>覆盖 – 过期
> override-lastmod
> ignore-reload

例如,我使用这样的行来缓存所有doc或pdf文件

  1. refresh_pattern -i \.(doc|pdf)$4320 80% 86400 ignore-no-cache ignore-no-store ignore-private override-expire override-lastmod reload-into-ims ignore-reload

猜你在找的Windows相关文章