Squid反向代理

直接来吧展示!!!

根据上次做的透明代理为基础进行实验
博客地址点这里

添加两台WEB服务器
添加主页

[root@web01 ~]# cd /var/www/html/
[root@web01 html]# ls
[root@web01 html]# echo "<h1>This is web01</h1>" > index.html
[root@web01 html]# systemctl stop firewalld
[root@web01 html]# systemctl start httpd

squid设置

[root@localhost squid-reports]# vim /etc/squid.conf
http_port 192.168.10.10:80 accel vhost vport
# Squid normally listens to port 3128
http_port 192.168.10.10:80 accel vhost vport
cache_peer 20.0.0.3 parent 80 0 no-query originserver round-robin max_conn=30 weight=1 name=web1
cache_peer 20.0.0.4 parent 80 0 no-query originserver round-robin max_conn=30 weight=1 name=web2
cache_peer_domain web1 web2 www.juejue.com
[root@localhost squid-reports]# systemctl stop httpd
[root@localhost squid-reports]# service squid reload
[root@localhost squid-reports]# service squid restart
正在关闭 squid...
正在启动 squid...
[root@localhost squid-reports]# netstat -ntap |grep 80
tcp        0      0 192.168.10.10:80        0.0.0.0:*               LISTEN      118551/(squid-1) 
[root@localhost ~]# systemctl stop firewalld

客户机 DNS解析设置

在这里插入图片描述在这里插入图片描述在这里插入图片描述
在这里插入图片描述

访问测试
轮询成功,一个服务器是设置了网页的,一个没有设置
在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值