Home > Documentation > Squid Proxy Server > Controlling Access to Websites Using Squidguard

Controlling Access to Websites Using Squidguard

Posted by peter on October 13, 2011

SquidGuard (website blocking)

Download or copy the following to the proxy server

shallalist.tar.gz (All black list files)

squidGuard-1.4.tar.gz

 

 

Un tar squidGuard-1.4.tar.gz with the following command

tar -vzxf squidGuard-1.4.tar.gz

cd to directory and use the following commands

./configure

make

make install 

Create the following directories:

/var/lib/squidguard

/var/lib/squidguard/dest

/var/lib/squidguard/dest/white

Copy the whitelist.txt (backed up) into the /var/lib/squidguard/dest/white folder

Unzip shallalist.tar.gz into the /var/lib/squidguard/dest/ folder

create a /var/log/squidguard folder

Edit the /usr/local/squidGuard/squidGuard.conf file as needed. Set the “redirect” to the IP address of the server you are working on.

Create a "blocked.html" file in “/var/www/html/” folder that will alert users to the fact that they have been blocked.

Create a “custom” folder under /var/lib/squidguard/dest/BL/

cd /var/lib/squidguard/dest/BL/custom

vi domains (creating a new file called "domains")

add domain names of websites you want to block (like facebook.com) into the domain file created above.

Makesure that the user squid has ownership of the /var/lib/squidguard/ and the /var/log/squidguard folders.

Run the command

squidGuard -C all

Run the following comand in a second shell to see if squidguard is running correctly when you run the above command

tail -f /usr/local/squidGuard/log/squidGuard.log” and see if squidguard is working.

NB - Set “squid” user permissions on the files and databases created with the following command (you need to do this again):

chown squid -R /var/lib/squidguard/

Check in one of the directories listed (eg /var/lib/squidguard/dest/BL/porn) nand see if there is a file called domains.db

If there is no file called domain.db then possibly the BerkeleyDB is not installed or the squidguard needs to be told of the location with the following command

./configure --with-db=/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/BerkeleyDB

If BerkeleyDB is not installed then install it. Make sure the correct repositories are installed.

Put the following line in your squid.conf file (# it out until needed)

url_rewrite_program /usr/local/bin/squidGuard -c /usr/local/squidGuard/squidGuard.conf

Look at the following web site for help to setup squidguard

http://www.squidguard.org/Doc/

restart squid with the command

service squid restart

Comments:

Leave a Reply



(Your email will not be publicly displayed.)

Please type the letters and numbers shown in the image.Captcha CodeClick the image to see another captcha.