美文网首页
squid反向代理

squid反向代理

作者: Lin_haobin | 来源:发表于2017-12-30 20:00 被阅读0次

实验环境:

(1)双网卡Redhat7系统--SQUID

(2)Redhat7系统--WEB

(3)Windows 7 --物理机

实验环境部署:

SQUID :外网使用NAT模式

    内网IP 172.25.0.10/24 网关 0.0.0.0

WEB : 内网IP 172.25.0.11/24 网关 172.25.0.10

物理机:能够ping通SQUID的外网卡

实验过程:

WEB 部署apache服务

[root@localhost ~]# yum - y install httpd

设置apache网页的主页面

[root@localhost ~]# echo "this is a squid server " > /var/www/html/index.html

重启apache服务

[root@localhost ~]# systemctl restart httpd

关闭防火墙

[root@localhost ~]# systemctl stop firewalld

SQUID  安转squid服务

[root@localhost ~]# yum -y install squid

配置squid主配置文件

添加:

  http_access allow all

  cache_peer 172.25.0.11 parent 80 0 originserver weight=1

  #172.25.0.11 为apache服务器的ip地址

修改:http_port 3128 为http_port 80 accel vhost

重启下squid服务

[root@localhost ~]# systemctl restart squid

关闭防火墙

[root@localhost ~]# systemctl stop firewalld

物理机 打开浏览器输入squid外网卡的ip地址,查看是否跳转到web服务器的页面

相关文章

网友评论

      本文标题:squid反向代理

      本文链接:https://www.haomeiwen.com/subject/erengxtx.html