CentOS 6
Contents Filtering by DansGuardian
2013/02/03
 
Install DansGuardian to block some contents.
[1] Install DansGuardian
[root@prox ~]#
yum --enablerepo=rpmforge -y install dansguardian
 
# install from RPMforge
[root@prox ~]#
vi /etc/dansguardian/dansguardian.conf
# line 88: specify the port DansGuardian listens

filterport =
8081
# line 94 : specify the port Proxy server listens

proxyport =
8080
[root@prox ~]#
/etc/rc.d/init.d/dansguardian start

Starting Web Content Filter (dansguardian): [ OK ]
[root@prox ~]#
chkconfig dansguardian on
[2] Configuration of Filtering
[root@prox ~]#
vi /etc/dansguardian/lists/bannedsitelist
# specify domain names you'd like to block

yahoo.co.jp
[root@prox ~]#
/etc/rc.d/init.d/dansguardian restart

Shutting down Web Content Filter (dansguardian): [ OK ]
Starting Web Content Filter (dansguardian): [ OK ]
# other lists you can define
bannedextensionlist
⇒ banned edextension

bannediplist
⇒ banned client IP address

bannedmimetypelist
⇒ banned MIME Type

bannedphraselist
⇒ banned phrase

bannedregexpheaderlist
⇒ banned header(regexp)

bannedregexpurllist
⇒ banned URL(regexp)

bannedsitelist
⇒ banned domain

bannedurllist
⇒ banned URL

contentregexplist
⇒ replace contents(regexp)

exceptionextensionlist
⇒ exception extension

exceptionfilesitelist
⇒ exception file domain

exceptionfileurllist
⇒ exception file URL

exceptioniplist
⇒ exception client IP address

exceptionmimetypelist
⇒ exception MIME Type

exceptionphraselist
⇒ exception phrase

exceptionregexpurllist
⇒ exception URL(regexp)

exceptionsitelist
⇒ exception domain

exceptionurllist
⇒ exception URL

filtergroupslist
⇒ filter group

greysitelist
⇒ grey domain

greyurllist
⇒ grey URL

[3] Try to access the banned domain you set, then the access has been redirected like follows.
 
Tweet