一、安装
- 源安装:sudo apt-get install squid squid-common;
- 源码安装:
tar xvfz squid-2.5.STABLE.tar.gz;cd squid-2.5.STABLE2;
./configure --prefix=/var/squid
--sysconfdir=/etc
--enable-arp-acl
--enable-linux-netfilter
--enable-pthreads
--enable-err-language="Simplify_Chinese"
--enable-storeio=ufs,null
--enable-default-err-language="Simplify_Chinese"
--enable-auth="basic"
--enable-baisc-auth-helpers="NCSA"
--enable-underscore
make;make install
二、基本配置(squid.conf文件)
http_port 192.168.1.68:8080
cache_mgr ***@****.org
cache_dir ufs /var/spool/squid 32 16 256
cache_mem 32 MB
cache_swap_low 90
cache_swap_high 95
visible_hostname **** Proxy
client_netmask 255.255.255.255
acl safe_ports port 80 21 443 563 70 210 1025-65535
acl all src 0.0.0.0/0
http_access allow safe_ports
http_access allow all
三、启动代理服务器
- 初始化你在 squid.conf 里配置的 cache 目录:sudo squid -z
- 验证 squid.conf 的 语法和配置:sudo squid -k parse
- 在前台启动squid,并输出启动过程:sudo squid -N -d1
- 后台启动squid服务器:sudo squid -s
- 停止squid代理服务器:sudo squid -k shutdown
四、更详细的配置情况参考:
http://wiki.ubuntu.org.cn/Squid#.E6.9C.8D.E5.8A.A1.E5.99.A8.E9.85.8D.E7.BD.AE