- 论坛徽章:
- 1
|
编译Squid
./configure --prefix=/usr/local/squid --sysconfdir=/etc/squid --enable-async-io=32 --enable-auth="basic,ntlm" --enable-external-acl-helpers="wbinfo_group " --enable-kill-parent-hack --enable-poll --enable-removal-policies="heap,lru" --disable-icmp --disable-delay-pools --disable-useragent-log -disable-arp-acl --disable-ident-lookups --disable-internal-dns --enable-err-language="Simplify_Chinese" --enable-storeio=aufs,ufs,diskd,coss,null
make;make install
vi /etc/squid/squid.conf
找到 cache_dir,http_port,http_access,cache_effective_user & cache_effective_ group
去掉cache_dir,http_port,http_reply_access allow all前面的#号
把#cache_effective_user nobody改成cache_effective_user squid
#cd /usr/local/squid/var
#mkdir cache
#useradd -s /sbin/nologin -c "Only Squid" squid 加squid用户
#chown squid:squid cache (默认所有者和组是root,不改在后面的配置过程中将出现错误,下同)
#chown squid:squid logs (同上)
启动squid:
#/usr/local/squid/sbin/squid -z
[root@MISDELL1 squid-2.6.STABLE11]# /usr/local/squid/sbin/squid -z
FATAL: Could not determine fully qualified hostname. Please set 'visible_hostname'
这个错误是在squid.conf里没有设置主机名引起的,用hostname -f,得出主机名,再填上去即可。
#/usr/local/squid/sbin/squid -NCd1 (后面是数字1哦!)
如果没问题的话将显示:"Ready to serve requests".
#/usr/local/squid/sbin/squid
如果在启动squid时出现这个错误(FATAL: ERROR: Unknown policy lru),时要在./configure时加上参数(--enable-removal-policies="heap,lru")
先将squid.conf里的http_access deny all改为http_access allow all
重启动squid,看看可不可以代理上网。可以的话,再开始设置结合域验证。开始设置域验证的时候要再将http_access allow all改为http_access deny all
然后在squid.conf加上: Domain_Internet_Users这个组里的用户可以上网。
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 5
auth_param ntlm keep_alive on
auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
external_acl_type NT_global_group %LOGIN /usr/local/squid/libexec/wbinfo_group.pl
acl ProxyUsers external NT_global_group Domain_Internet_Users
acl AuthenticatedUsers proxy_auth REQUIRED
http_access allow AuthenticatedUsers ProxyUsers
http_access deny all
chgrp squid /var/cache/samba/winbindd_privileged
chmod -R 750 /var/cache/samba/winbindd_privileged
如果使用域帐号登陆计算机,那么浏览网页时就不会提示输入用户名及密码认证,非域用户登陆计算机,通过代理访问网站时,IE将弹出用户身份验证窗口要求用户输入用户名及密码验证。
在squid.conf中同样可以设置允许访问的域用户,及不允许访问的域用户。对于windows域用户来说,说有的验证都是透明的。不需要手动输入用户名及密码,方便用户的使用。
另外squid封qq 还是挺容易的 squid.conf里加规则
第二条denyqq_ip.list可以不要
acl badurls dstdomain -i .qq.com .tencent.com
http_access deny badurls
acl qq_ip dst "/etc/squid/denyqq_ip.list"
http_access deny qq_ip
参考资料:
http://bbs.chinaunix.net/viewthr ... 3Ddigest&page=1
http://blog.chinaunix.net/u/2937/showart.php?id=86752
http://allanzr.spaces.live.com/b ... 9847fb691!134.entry
[ 本帖最后由 枫影谁用了 于 2007-4-28 15:59 编辑 ] |
|