— 本帖被 不靠谱贝贝 设置为精华(2017-11-20) —
云友“bouyei”等在帖子 里问到,所以实践了一下。
环境:轻量云服务器,CentOS 7.3
过程:
- yum update # 更新
- yum install squid # 安装 squid
- vi /etc/squid/squid.conf # 编辑 squid 的配置文件,将默认的 3128 端口替换成其它,如 3888,http_port 3888,且在添加上用户的IP地址,允许访问 squid,如 acl localnet src x.x.x.x/32
- systemctl restart squid # 重启 squid 服务
- systemctl stop firewalld # 停止 CentOS 7 的默认防火墙服务
- 在阿里云ECS实例安全组规则里,放行相应的端口,如本例的 3888 端口
- 在用户的浏览器里填写相应的 http 代理连接信息
- 浏览器里测试,可用
参考:https://www.liquidweb.com/kb/how-to-install-squid-caching-proxy-on-centos-7/