CentOS 5
Sponsored Link

Run with SquidGuard
2015/01/15
 
Configure Squid + SquidGuard to set contents filtering.
[1] Install SquidGuard.
[root@lan ~]#
yum --enablerepo=rpmforge -y install squidguard
 
# install from RPMforge
[root@lan ~]#
mv /etc/squid/squidguard.conf /etc/squid/squidguard.conf.bk

[root@lan ~]#
vi /etc/squid/squidguard.conf
# create new

dbhome /var/lib/squidguard/db
logdir /var/log/squidguard
# define 'deny' category

dest deny {
# define prohibited domain list in 'deny' category

domainlist deny/domains

# define prohibited URL list in 'deny' category

urllist deny/urls

}
acl {
default {

# permit all except 'deny' category

pass !deny all

# the redirected URL if matches 'deny'

redirect http://www.srv.world/error.html

}

}
[root@lan ~]#
mkdir /var/log/squidguard

[root@lan ~]#
mkdir -p /var/lib/squidguard/db/deny

[root@lan ~]#
vi /var/lib/squidguard/db/deny/domains
# write domains you'd like to prohibit to access

yahoo.co.jp
example.com
[root@lan ~]#
vi /var/lib/squidguard/db/deny/urls
# write URLs you'd like to prohibit to access

www.yahoo.co.jp/deny/
www.example.com/
[root@lan ~]#
squidGuard -C all

[root@lan ~]#
chown -R squid. /var/lib/squidguard/db/deny

[root@lan ~]#
vi /usr/local/etc/squidclamav.conf
# line 16: uncomment and change

squidguard
/usr/bin/squidguard
[root@lan ~]#
/etc/rc.d/init.d/squid restart

Stopping squid: ................[ OK ]
Starting squid: .[ OK ]
[2] Try to access to the URL you set as prohibited domains in [1].
Matched Content
 
Tweet