SLES 11 SP4
Sponsored Link

Squid + SquidGuard2015/12/03

 
Configure Squid + SquidGuard to set contents filtering.
[1] Install SquidGuard.
prox:~ #
zypper -n install squidGuard
prox:~ #
mv /etc/squidguard.conf /etc/squidguard.conf.org

prox:~ #
vi /etc/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
    }
}
prox:~ #
mkdir -p /var/lib/squidGuard/db/deny

prox:~ #
vi /var/lib/squidGuard/db/deny/domains
# write domains you'd like to prohibit to access

yahoo.co.jp
example.com
prox:~ #
vi /var/lib/squidGuard/db/deny/urls
# write URLs you'd like to prohibit to access

www.yahoo.co.jp/deny/
www.example.com/
prox:~ #
squidGuard -C all

prox:~ #
chown -R squid. /var/lib/squidGuard/db/deny

prox:~ #
vi /etc/squid/squid.conf
# add follows to the end

url_rewrite_program /usr/sbin/squidGuard
prox:~ #
/etc/init.d/squid restart

[2] Try to access to the URL you set as prohibited domains in [1].
Matched Content