配置Squid限制特殊的站点访问
首先创建/usr/local/etc/allowed-sites.squid和/usr/local/etc/restricted-sites.squid这两个文件。allowed-sites.squid中加入允许的网站,restricted-sites.squid中加入拒绝访问的网站。如下所示:
# File: /usr/local/etc/allowed-sites.squid
linuxhomenetworking.com
# File: /usr/local/etc/restricted-sites.squid
illegal.com
接着编辑squid.conf文件,加入如下行:
#
# Add this to the bottom of the ACL section of squid.conf
#
acl home_network src 192.168.1.0/24
acl business_hours time M T W H F 9:00-17:00
acl GoodSites dstdomain "/usr/local/etc/allowed-sites.squid"
acl BadSites dstdomain "/usr/local/etc/restricted-sites.squid"
#
# Add this at the top of the http_access section of squid.conf
#
http_access deny BadSites
http_access allow home_network business_hours GoodSites
ok,重启一下squid服务试试吧!
阅读(1209) | 评论(0) | 转发(0) |