http:192.168.1.6、192.168.1.8
squid:192.168.1.4、2.2.2.2
client:2.2.2.3
1、
分别开启后台httpd服务器的web服务。
# service httpd start
2、配置squid作为反向代理。
# iptables -F -t nat
# vim /etc/squid/squid.conf
http_access allow all
http_port 2.2.2.2:80 accel vhost
cache_peer 192.168.1.6 parent 80 0 originserver round-robin weight=1
cache_peer 192.168.1.8 parent 80 0 originserver round-robin weight=1
3、此时客户端访问2.2.2.2的时候,squid服务会轮流获取后台的httpd服务器的web资源响应给客户端。