centos7.6上squid反向代理的配置
因为工作需要
1、环境:
web服务端:192.168.10.66【centos7.6】
代理服务端:192.168.10.40【centos7.6】
客户端 :我这用宿主机测试
2、部署web端,进行测试
yun install -y httpd
systemctl start httpd
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
默认路径有两个:
配置路径: /etc/httpd/conf【如果有端口冲突去此路径更改端口号】
项目路径: /var/www/html【此路径发表项目进行测试】
echo "hello world 欢迎来到英雄联盟" > index.html
直接在客户端浏览器进行测试:
3、配置反向代理
yum install -y squid
systemctl start squid
vim /etc/squid/squid.conf
加入以下两句:
【http_port 36900 vhost】
【cache_peer 192.168.10.66 parent 36900 0 proxy-only】
systemctl restart squid
就添加上面两句,改配置文件此处,如下图所示:
4、客户端测试验证