1.安装squid
sudo apt-get install squid
2,修改配置,增加需要使用代理的ip
vi命令修改: vi /etc/squid/squid.conf
图形界面编辑 sudo gedit /etc/squid/squid.conf
1) 定位到 # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS # Example rule allowing access from your local networks. Adapt # to list your (internal) IP networks from where browsing should # be allowed #acl our_networks src 192.168.1.0/24 192.168.2.0/24 #http_access allow our_networks http_access allow localhost ########add 需要使用代理的ip acl my_network src 192.168.0.133 192.168.0.122 #这里加了两个ip http_access allow my_network #########end add # And finally deny all other access to this proxy http_access deny all
-----------------------------------
2)端口可以不修改(默认3128)。
3,初始化配置
1>当设置好SQUID.CONF文件之后,第一次执行SQUID之前,记住先用命令squid -z制作缓冲区目录
squid -z
2>如果对SQUID.CONF配置文件做了修订之后,通常采用重新读取配置文件的方式,以确保SQUID持续提供服务。
service squid restart
3>关闭squid
squid -k kill 直接停止服务
squid -k shutdown 关闭LOG后停止服务
4>检查squid状态
squid -k check 检查SQUID 是否正常运行
参考: http://blog.chinaunix.net/uid-20778906-id-540115.html
http://blog.csdn.net/zinking3/article/details/1653897