squid集群配置

简介:
[背景]
在学习CDN方面资料时,所搭建的squid集群环境,供以后学习!
[基本架构]
squid1
                squid      web
squid2
squid1和squid2是姐妹关系,squid1,squid2和squid是父子关系,squid与web也是父子关系.
[IP分配信息]
squid    192.168.5.163
squid1   192.168.5.161
squid2   192.168.5.145
web      192.168.5.162
[内容]将其配置文件Copy下
squid1配置文件
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl CONNECT method CONNECT
acl purge method PURGE
#acl gsrc src 192.168.5.161 192.168.5.162 192.168.5.163
#acl gdst dst 192.168.5.161 192.168.5.162 192.168.5.163
acl Safe_ports port 80
acl Safe_ports port 3130
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
#http_access allow gsrc
#http_access allow gdst
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
#http_access deny all
icp_access allow all
#http_port 80 accel vhost vport
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
visible_hostname slibing1.squid.com
cache_mgr  [email]zhengjun.zhu@tiancity.com[/email]
access_log /usr/local/squid/var/logs/access.log squid
#refresh_pattern ^ftp:          1440    20%     10080
#refresh_pattern ^gopher:       1440    0%      1440
refresh_pattern -i .html$       10      50%     20
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
coredump_dir /usr/local/squid/var/cache
cache_mem 64 MB
#negative_ttl 1 second
###################################################
http_port 80 accel vhost vport
icp_port 3130
cache_peer 192.168.5.163 parent 80 0 no-query originserver no-digest name=cache0
cache_peer 192.168.5.161 sibling 80 3130 name=cache1
cache_peer 192.168.5.163 sibling 80 3130 name=cache2
cache_peer 192.168.5.165 sibling 80 3130 name=cache3
cache_peer_domain cache0  [url]www.squid.com[/url]
http_access deny !Safe_ports
negative_ttl 1 second
icp_query_timeout 2000
digest_generation on
log_icp_queries on
icp_hit_stale   on
squid2配置文件
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl CONNECT method CONNECT
acl purge method PURGE
#acl gsrc src 192.168.5.161 192.168.5.162 192.168.5.163
#acl gdst dst 192.168.5.161 192.168.5.162 192.168.5.163
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
#http_access allow gsrc
#http_access allow gdst
#http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
#http_access deny all
icp_access allow all
#http_port 80 accel vhost vport
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
visible_hostname slibing2.squid.com
cache_mgr  [email]zhengjun.zhu@tiancity.com[/email]
access_log /usr/local/squid/var/logs/access.log squid
#refresh_pattern ^ftp:          1440    20%     10080
#refresh_pattern ^gopher:       1440    0%      1440
refresh_pattern -i .html$       10      50%     20
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
coredump_dir /usr/local/squid/var/cache
cache_mem 64 MB
#negative_ttl 1 second
###################################################
http_port 80 accel vhost vport
icp_port 3130
cache_peer 192.168.5.163 parent 80 0 no-query originserver no-digest name=cache0
cache_peer 192.168.5.161 sibling 80 3130 name=cache1
cache_peer 192.168.5.163 sibling 80 3130 name=cache2
cache_peer 192.168.5.165 sibling 80 3130 name=cache3
cache_peer_domain cache0  [url]www.squid.com[/url]
acl Safe_ports port 80
acl Safe_ports port 3130
http_access deny !Safe_ports
negative_ttl 1 second

icp_query_timeout 2000
digest_generation on
log_icp_queries on
icp_hit_stale   on
squid配置文件
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443
acl CONNECT method CONNECT
acl purge method PURGE
acl CactiServer src 127.0.0.1 192.168.5.163
acl CactiServer src 192.168.5.161/255.255.255.255
acl SNMP snmp_community passwd
#acl gsrc src 192.168.5.161 192.168.5.162 192.168.5.163
#acl gdst dst 192.168.5.161 192.168.5.162 192.168.5.163

http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
#http_access allow gsrc
#http_access allow gdst
#http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
#http_access deny all
snmp_port 3401
snmp_access allow SNMP CactiServer
snmp_access deny all
icp_access allow all
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
visible_hostname parent.squid.com
cache_mgr  [email]zhengjun.zhu@tiancity.com[/email]
access_log /usr/local/squid/var/logs/access.log squid
#refresh_pattern ^ftp:          1440    20%     10080
#refresh_pattern ^gopher:       1440    0%      1440
refresh_pattern -i .html$       10      50%     20
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
coredump_dir /usr/local/squid/var/cache
cache_mem 64 MB
#negative_ttl 1 second
###################################################
http_port 80 accel vhost vport
icp_port 3130
cache_peer 192.168.5.162 parent 80 0 no-query originserver no-digest name=cache0
cache_peer 192.168.5.162 sibling 80 3130 name=cache1
cache_peer 192.168.5.163 sibling 80 3130 name=cache2
cache_peer 192.168.5.165 sibling 80 3130 name=cache3
cache_peer_domain cache0  [url]www.squid.com[/url]
acl Safe_ports port 80
acl Safe_ports port 3130
http_access deny !Safe_ports
negative_ttl 1 second

icp_query_timeout 2000
icp_access allow all
digest_generation on
log_icp_queries on
icp_hit_stale   on
web配置
在其加了一个mod_expires模块
ExpiresActive On
ExpiresDefault A600


本文转自hahazhu0634 51CTO博客,原文链接:http://blog.51cto.com/5ydycm/113271,如需转载请自行联系原作者
相关文章
|
安全 程序员 测试技术
推荐7款程序员常用的API管理工具
本文所有工具都已收录至Awesome Tools,程序员常用高效实用工具、软件资源精选,办公效率提升利器。
958 3
|
JavaScript 前端开发 测试技术
如何测试 CORS 是否正常工作?
通过以上多种方法的综合测试,可以全面地检查 CORS 是否正常工作,及时发现和解决跨域资源共享中可能存在的问题,确保不同源的网页和服务器之间能够正常地进行数据交互。
1382 60
|
缓存 Ubuntu Python
Squid中正向代理的配置与使用
Squid中正向代理的配置与使用
1557 4
|
前端开发 安全 搜索推荐
【专栏】ngrok` 是一款让本地服务器暴露到公网的工具,提供外网访问、临时公网地址、安全隧道及实时更新功能
`【4月更文挑战第29天】ngrok` 是一款让本地服务器暴露到公网的工具,提供外网访问、临时公网地址、安全隧道及实时更新功能。使用简单,包括下载客户端、注册认证、启动本地服务和执行命令。在前端开发中,ngrok 用于本地开发调试、跨设备测试、前后端联调、演示分享和应急处理。它提高了开发效率,简化网络环境和部署问题。无论是移动应用测试还是团队协作,ngrok 都能发挥关键作用,是前端开发者必备神器。尝试使用 ngrok,提升你的开发体验。
1090 3
|
人工智能 JSON 运维
AI大模型运维开发探索第三篇:深入浅出运维智能体
大模型出现伊始,我们就在SREWorks开源社区征集相关的实验案例。玦离同学提供了面向大数据HDFS集群的智能体案例,非常好地完成了运维诊断的目标。于是基于这一系列的实验和探索。本文详细介绍智能体在运维诊断中的应用探索。
|
弹性计算 对象存储 CDN
阿里云流量费用价格表(每GB流量0.8元,地域不同流量价格不同)
2023阿里云流量费用价格表,每GB流量价格0.8元,地域不同流量价格不同,阿里云百科分享不同地域流量价格
3498 0
阿里云流量费用价格表(每GB流量0.8元,地域不同流量价格不同)
|
NoSQL 前端开发 Redis
Flask+Redis实现登录权限管理
Flask+Redis实现登录权限管理
437 0