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,如需转载请自行联系原作者
相关文章
|
10月前
|
人工智能 Serverless API
评测|全网最强🚀!5min部署满血版DeepSeek,零成本,无需编程!
本文介绍了阿里云提供的四种DeepSeek部署方案,包括基于百炼调用满血版API、基于函数计算部署、基于人工智能平台PAI部署和GPU云服务器部署。通过这些方案,用户可以摆脱“服务器繁忙”的困扰,实现快速部署与使用
2654 3
评测|全网最强🚀!5min部署满血版DeepSeek,零成本,无需编程!
|
JavaScript 前端开发 测试技术
如何测试 CORS 是否正常工作?
通过以上多种方法的综合测试,可以全面地检查 CORS 是否正常工作,及时发现和解决跨域资源共享中可能存在的问题,确保不同源的网页和服务器之间能够正常地进行数据交互。
1297 60
|
安全 程序员 测试技术
推荐7款程序员常用的API管理工具
本文所有工具都已收录至Awesome Tools,程序员常用高效实用工具、软件资源精选,办公效率提升利器。
875 3
|
缓存 Ubuntu Python
Squid中正向代理的配置与使用
Squid中正向代理的配置与使用
1513 4
|
人工智能 数据处理 Python
🔍数据侦探的AI助手:Prompt技巧大公开,洞察商业先机不手软
【8月更文挑战第1天】在数据驱动时代,AI助手作为数据侦探的强大伙伴,通过精心设计的AI Prompt技巧帮助解析复杂市场。案例中,一电商平台欲进入新兴市场,面临数据挑战。初始Prompt聚焦消费者偏好及影响因素分析。为进一步深化洞察,Prompt加入节假日购物模式、商品类别偏好及社交媒体影响等细节。结合领域知识,优化Prompt关注价格敏感度与定制化营销策略。最终,AI助手生成的报告揭示了消费者行为模式,并提出市场策略建议,助力电商成功布局新兴市场。此过程展示了AI Prompt在商业洞察中的关键作用,预示着其在未来洞察之旅中的广阔前景。
449 2
|
前端开发 安全 搜索推荐
【专栏】ngrok` 是一款让本地服务器暴露到公网的工具,提供外网访问、临时公网地址、安全隧道及实时更新功能
`【4月更文挑战第29天】ngrok` 是一款让本地服务器暴露到公网的工具,提供外网访问、临时公网地址、安全隧道及实时更新功能。使用简单,包括下载客户端、注册认证、启动本地服务和执行命令。在前端开发中,ngrok 用于本地开发调试、跨设备测试、前后端联调、演示分享和应急处理。它提高了开发效率,简化网络环境和部署问题。无论是移动应用测试还是团队协作,ngrok 都能发挥关键作用,是前端开发者必备神器。尝试使用 ngrok,提升你的开发体验。
1007 3
|
Kubernetes 负载均衡 网络安全
【K8S系列】深入解析k8s网络
【K8S系列】深入解析k8s网络
2245 0
|
SQL IDE Java
通过一次性能优化,再次记牢了mybatisplus的QueryWrapper、LambdaQueryWrapper、AbstractWrapper这三者之间的关系...
本文描述了一次针对SpringBoot应用中MyBatisPlus分页查询的性能优化过程。在优化时,作者重写了BaseMapper的`selectPage`方法,通过`Wrapper`的`between`操作添加了ID区间限制以提升SQL执行效率。然而,由于在业务服务类中循环调用分页查询时未每次都创建新的`Wrapper`对象,导致`id BETWEEN ? AND ?`条件重复出现在SQL中。那么,如何解决这个问题呢?
1345 5
|
Java 应用服务中间件 Apache
tomcat下载与使用教程
tomcat下载与使用教程
1221 0
|
人工智能 JSON 运维
AI大模型运维开发探索第三篇:深入浅出运维智能体
大模型出现伊始,我们就在SREWorks开源社区征集相关的实验案例。玦离同学提供了面向大数据HDFS集群的智能体案例,非常好地完成了运维诊断的目标。于是基于这一系列的实验和探索。本文详细介绍智能体在运维诊断中的应用探索。