个人工具
登录
查看“UbuntuHelp:DansGuardian”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:DansGuardian”的源代码
来自Ubuntu中文
←
UbuntuHelp:DansGuardian
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/DansGuardian}} {{Languages|UbuntuHelp:DansGuardian}} == Dansguardian Internet Content Filtering == === Description === DansGuardian is an award winning Open Source web content filter which currently runs on Linux, FreeBSD, OpenBSD, NetBSD, Mac OS X, HP-UX, and Solaris. It filters the actual content of pages based on many methods including phrase matching, PICS filtering and URL filtering. It does not purely filter based on a banned list of sites like lesser totally commercial filters. DansGuardian is designed to be completely flexible and allows you to tailor the filtering to your exact needs. It can be as draconian or as unobstructive as you want. The default settings are geared towards what a primary school might want but DansGuardian puts you in control of what you want to block. === Installation === <pre><nowiki> sudo apt-get install clamav-freshclam iptables dansguardian squid </nowiki></pre> Download blacklists from a site such as http://urlblacklist.com/?sec=download <pre><nowiki> tar -xzf bigblacklist.tar.gz sudo mv blacklists /etc/dansguardian/blacklists sudo chown -R root:root /etc/dansguardian/blacklists </nowiki></pre> === Configuration === You will likely want to customize some filtering options. In particular, you may want to comment (#) or uncomment options in these files: * /etc/dansguardian/lists/bannedextensionlist * /etc/dansguardian/lists/bannedsitelist * /etc/dansguardian/lists/bannedurllist Edit /etc/squid/squid.conf: Make these options appear as shown. <pre><nowiki> ... http_port 3128 transparent ... always_direct allow all ... </nowiki></pre> Edit /etc/dansguardian/dansguardian.conf: <pre><nowiki> ... #UNCONFIGURED - Please remove this line after configuration ... filterip = 127.0.0.1 ... daemonuser = 'proxy' ... daemongroup = 'proxy' ... accessdeniedaddress = 'http://localhost/cgi-bin/dansguardian.pl' ... </nowiki></pre> Change the Dansguardian log folder to the correct ownership and start Dansguardian: <pre><nowiki> sudo chown -R proxy:proxy /var/log/dansguardian sudo /etc/init.d/dansguardian start </nowiki></pre> Now configure iptables to redirect internet traffic through the filter system: <pre><nowiki> sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --uid-owner proxy -j ACCEPT sudo iptables -t nat -A OUTPUT -p tcp --dport 3128 -m owner --uid-owner proxy -j ACCEPT sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8080 sudo iptables -t nat -A OUTPUT -p tcp --dport 3128 -j REDIRECT --to-ports 8080 sudo iptables-save > iptables sudo mv iptables /etc/dansguardian/iptables </nowiki></pre> Create a script in /etc/rc2.d, such as S60iptables: <pre><nowiki>#! #!/bin/sh /sbin/iptables-restore < /etc/dansguardian/iptables </nowiki></pre> Make sure the script is executable: <pre><nowiki> sudo chmod 750 /etc/rc2.d/S60iptables </nowiki></pre> [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:DansGuardian
。