1. 安装 Squid
sudo apt-get update sudo apt-get upgrade sudo apt-get install squid
或者
yum install squid
2. 配置 HTTP 代理
注意,在 Ubuntu 下配置文件的默认位置可能是 /etc/squid3/,下面均用 CentOS 的 /etc/squid/ 举例,请自行替换。
基础设置:
首先设置允许访问该代理的 IP 列表:
# /etc/squid/squid.conf acl client src 12.34.56.78 #客户端1 IP 地址 acl client src 21.43.56.78 #客户端2 IP 地址 ... http_access allow client
注意这几行要加在配置文件原有的
http_access deny all
之前,不然不会生效。
然后重启 (更多…)