c语言sscanf函数的用法是什么
227
2022-11-09
squid缓存服务器————反向代理
squid缓存服务器————反向代理如果 Squid 反向代理服务器中缓存了该请求的资源,则将该请求的资源直接返回给客户端,否则反向代理服务器将向后台的 WEB 服务器请求资源,然后将请求的应答返回给客户端,同时也将该应答缓存在本地,供下一个请求者使用1、首先给网页做区分
[root@web cd /var/www/html/ [root@web html]# ls [root@web html]# vim index.html this is test1 web
2、在前面实验的基础上,新开一台web2服务器:192.168.247.161
[root@localhost ~]# hostnamectl set-hostname web2 [root@localhost ~]# su [root@web2 ~]# [root@web2 ~]# systemctl stop firewalld [root@web2 ~]# setenforce 0 [root@web2 ~]# yum install -y [root@web2 ~]# cd /var/www/html/ [root@web2 html]# vim index.html this is test2 web2 [root@web2 html]# systemctl start httpd [root@web2 html]# netstat -natp | grep 80 tcp6 0 0 :::80 :::* LISTEN 17713/ [root@web2 html]# route add -net 192.168.10.0/24 gw 192.168.247.206
3、切换到squid服务器192.168.247.206进行反向代理配置
[root@squid sarg]# vim /etc/squid.conf # Squid normally listens to port 3128 192.168.247.206:80 accel vhost vport //修改 //下面为增加 cache_peer 192.168.247.160 parent 80 0 no-query orginserver round-robinmax_conn=30 weight=1 name=web1 cache_peer 192.168.247.161 parent 80 0 no-query orginserver round-robin max_conn=30 weight=1 name=web2 cache_peer_domain web1 web2 yun.com [root@squid sarg]# netstat -natp | grep 80 tcp6 0 0 :::80 :::* LISTEN 63454/ [root@squid sarg]# systemctl stop [root@squid sarg]# netstat -natp | grep 80 [root@squid sarg]# service squid restart 正在关闭 squid... 正在启动 squid... [root@squid sarg]# netstat -natp | grep 80 tcp 0 0 192.168.247.206:80 0.0.0.0:* LISTEN
4、关闭防火墙和增强性安全功能
[root@squid sarg]# systemctl stop firewalld [root@squid sarg]# setenforce 0
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~