14.5 反向代理

1.配置外网http服务器,地址:192.168.1.12/24

[root@dsrw ~]# yum install httpd -y
已安装:
  httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64                               
  apr-util-bdb-1.6.1-6.el8.x86_64                                               
  apr-util-openssl-1.6.1-6.el8.x86_64                                           
  apr-1.6.3-9.el8.x86_64                                                        
  apr-util-1.6.1-6.el8.x86_64 httpd-filesystem-2.4.37-10.module+el8+2764+7127e69e.noarch                    
  httpd-tools-2.4.37-10.module+el8+2764+7127e69e.x86_64                         
  mod_http2-1.11.3-1.module+el8+2443+605475b7.x86_64                            
  redhat-logos-httpd-80.7-1.el8.noarch   
完毕!
[root@dsrw ~]# systemctl start httpd
[root@dsrw ~]# systemctl enable httpd

[root@dsrw ~]# echo "Welcome To dsrw.Com" > /var/www/html/index.html

2.Squid代理服务器反向代理配置(透明代理配置如上)

[root@dsrw ~]# vim /etc/squid/squid.conf
http_access allow all
http_port 3129 transparent
http_port 192.168.1.11:80 vhost#外网IP
cache_peer 192.168.1.12 parent 80 0 originserver#服务站IP
cache_dir ufs /var/spool/squid 100 16 256
[root@dsrw ~]# systemctl restart squid

3.WIN7客户机模拟外网用户(桥接模式)

IP地址:192.168.11.1

图片[1]-14.5 反向代理-大赛人网
图14-7 win7客户机浏览内网服务器主页
© 版权声明
THE END
喜欢就支持一下吧
点赞10 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    请登录后查看评论内容