LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Squid not blocking websites (http://www.linuxquestions.org/questions/linux-newbie-8/squid-not-blocking-websites-765158/)

bittus 10-28-2009 07:36 PM

Squid not blocking websites
 
I am trying to configure a squid proxy in such a way that it will be blocking all the unwanted sites I list in a file. But I can see that the configuration is not getting worked.

My config is as follows :


squid.conf
Quote:

acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8

acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT

acl cok src 192.168.1.0/24
acl blocksites url_regex "/usr/local/squid/blocked.domains.acl"

http_access allow cok
http_access deny blocksites
http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
http_access allow localnet

# And finally deny all other access to this proxy
http_access deny all
blocked.domains.acl
Quote:

.orkut.com
.gmail.com
.yahoo.com
.hotmail.com
I can access all the sites using this squid, even the blocked ones are getting opened :(

Can someone help me on this ?

I also need help on the log files of squid. I don't understand a single line from squid. Can someone suggest me an efficient squid log reader ?

Version of my squid:
The command squid -v gives me the result :
Squid Cache: Version 3.0.STABLE19

Thanks in advance.

acid_kewpie 10-29-2009 02:27 AM

Is this "cok" acl relevant? What are your source IP's?

linuxlover.chaitanya 10-29-2009 04:09 AM

Try putting the cok acl in http_access area below blocksites. Your cok acl states all the ip addresses in the range. And if that is the range of your systems then it aint going to work. It will parse from top to bottom so the first acl that is matched is cok which allowed everything.

bittus 11-03-2009 06:48 PM

Quote:

Originally Posted by linuxlover.chaitanya (Post 3736360)
Try putting the cok acl in http_access area below blocksites. Your cok acl states all the ip addresses in the range. And if that is the range of your systems then it aint going to work. It will parse from top to bottom so the first acl that is matched is cok which allowed everything.

Thanks Chaitanya. It works now. I dont know somehow I missed that order. Thanks again for reminding me :)

linuxlover.chaitanya 11-04-2009 03:10 AM

Good to hear you got it working.


All times are GMT -5. The time now is 05:26 PM.