Fedora 20
Sponsored Link

Run with SquidGuard2014/01/06

 
Run Squid with SquidGuard that is a URL redirector.
[1] Install and configure SquidGuard (this config is most simply example)
[root@lan ~]#
yum -y install squidGuard
[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 a category 'deny'

dest deny {
# prohibited domain list

domainlist deny/domains

# prohibited url list

urllist deny/urls

}
acl {
default {

# allow access except 'deny'

pass !deny all

# redirect URL

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

}

}
[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 /etc/squid/squid.conf
# add at the last line

url_rewrite_program /usr/bin/squidGuard
[root@lan ~]#
systemctl restart squid.service

[2] Try to access to denied URL set as prohibited domain in [1]. Prohibited domain is blicked normally.
 
Matched Content