用squid做代理服务器
安装:
sudo apt-get install squid
由于我机器是多网卡+网桥,于是出现
FATAL: Could not determine fully qualified hostname. Please set ‘visible_hostname’
于是编辑配置文件,在相应的visible_hostname位置加上一行
sudo gedit /etc/squid/squid.conf
visible_hostname discover
(discover是用hostname得到的机器名)
接下来就是配置了。
你希望的代理端口:
http_port: 8848
对所有人开启代理
http_access allow all
icp_access allow all
只给指定的ip开代理的话(后面的是子网掩码):
acl advance src 202.118.xxx.xxx/32
然后
http_access allow advance
然后初始化+启动
sudo squid -z
sudo squid