.. squid.rst --- .. .. Description: .. Author: Hongyi Wu(吴鸿毅) .. Email: wuhongyi@qq.com .. Created: 五 8月 13 20:27:50 2021 (+0800) .. Last-Updated: 五 8月 13 20:32:12 2021 (+0800) .. By: Hongyi Wu(吴鸿毅) .. Update #: 1 .. URL: http://wuhongyi.cn ################################################## Squid HTTP Proxy ################################################## 在CentOS7上设置Squid HTTP Proxy正向代理 ============================================================ 安装Squid ============================================================ 在有外网访问的机器上,安装Squid作为HTTP proxy server: .. code:: bash yum -y install squid ============================================================ 配置Squid ============================================================ Squid的配置文件为 **/etc/squid/squid.conf** 。 默认允许同一个子网的其他服务器使用Squid作为proxy server。 .. code:: bash acl localnet src 10.0.0.0/8 # RFC1918 possible internal network acl localnet src 172.16.0.0/12 # RFC1918 possible internal network acl localnet src 192.168.0.0/16 # RFC1918 possible internal network 默认拒绝其他访问: .. code:: bash # And finally deny all other access to this proxy http_access deny all 默认端口为3128: # Squid normally listens to port 3128 http_port 3128 一般地,如果proxy server只是提供给同一个子网的客户端机器访问,不需要修改Squid配置文件。 ============================================================ 以服务方式运行Squid ============================================================ 以服务方式运行Squid: .. code:: bash systemctl enable squid systemctl start squid 查看Squid服务状态: .. code:: bash systemctl status squid -l 查看3128端口: .. code:: bash netstat -tnlp | grep 3128 https://blog.csdn.net/nklinsirui/article/details/109225537 https://blog.csdn.net/weixin_42082634/article/details/115913963 .. .. squid.rst ends here