LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 05-25-2006, 04:08 PM   #1
Atifkhan
LQ Newbie
 
Registered: May 2006
Posts: 4

Rep: Reputation: 0
i want to block a URL from squid


i m running Red hat enterprise linux EL core4, i want to block a URL for my clients. kindly help me to place a access control list.
thanks
 
Old 05-25-2006, 04:39 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
You can do this with regular expressions or destination domain lists (and probably other ways as well). A short example would be:
Code:
acl Cooking1 url_regex cooking
acl Recipe1 url_regex recipe
acl myclients src 172.16.5.0/24
http_access deny Cooking1
http_access deny Recipe1
http_access allow myclients
http_access deny all
I suggest having a look through the the following to get more info:
http://wiki.squid-cache.org/SquidFaq
http://www.linuxhomenetworking.com/linux-adv/squid.htm
 
Old 02-06-2010, 11:54 AM   #3
iseymur
LQ Newbie
 
Registered: Jan 2010
Posts: 8

Rep: Reputation: 0
I like block different users different sites

Example I have 3 user list and 3 file with block site names

acl group1 src 192.168.0.2 192.168.0.3 192.168.0.4/24
acl group2 src 192.168.0.5 192.168.0.6 192.168.0.7/24
acl group3 src 192.168.0.8 192.168.0.9 192.168.0.10/24

and

acl blocksites1 url_regex -i "/etc/squid/block1.txt"
acl blocksites2 url_regex -i "/etc/squid/block2.txt"
acl blocksites3 url_regex -i "/etc/squid/block3.txt"

I like block blocksites1 for group1, blocksites2 for group2,
blocksites3 for group3,

help me please
 
Old 02-23-2010, 01:47 PM   #4
tboyer
LQ Newbie
 
Registered: Dec 2009
Distribution: RHEL
Posts: 16

Rep: Reputation: 1
Quote:
Originally Posted by iseymur View Post
Example I have 3 user list and 3 file with block site names

acl group1 src 192.168.0.2 192.168.0.3 192.168.0.4/24
acl group2 src 192.168.0.5 192.168.0.6 192.168.0.7/24
acl group3 src 192.168.0.8 192.168.0.9 192.168.0.10/24

and

acl blocksites1 url_regex -i "/etc/squid/block1.txt"
acl blocksites2 url_regex -i "/etc/squid/block2.txt"
acl blocksites3 url_regex -i "/etc/squid/block3.txt"

I like block blocksites1 for group1, blocksites2 for group2,
blocksites3 for group3,

help me please
OK, I'm doing this a bunch of different ways.

I've got the office, the plant, our security shack, and the union office:

acl office src 192.168.50.0/24
acl plant src 192.168.99.0/24
acl union src 192.168.128.70/32
acl security src 192.168.128.183/32

I can define the sites I want either as a list in the .conf file:

acl union-sites dstdomain www.ohiobwc.com .gov .edu .state.oh.us
acl ok-plant-sites dstdomain .microsoft.com .windowsupdate.com

... or as a simple text file:

acl porn-sites-1 dstdomain "/etc/squid/porn-sites-1"
acl porn-sites-2 url_regex "/etc/squid/porn-sites-2"

(these are plain text files that look like this:

.allnicegirls.com
.elephantlist.com
.4pigs.com
.consumptionjunction.com

etc.)

Then, I just tell squid what to do:

http_access deny office porn-sites-1
http_access deny plant porn-sites-1
http_access deny office porn-sites-2
http_access deny plant porn-sites-2

# Put denys first...

http_access deny union !union-sites
http_access deny security !ok-plant-sites

http_access allow office
http_access allow plant
 
  


Reply

Tags
squid


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to block people from accessing my site if they came from a certin url? abefroman Linux - Security 5 02-13-2006 11:16 PM
Block URL request in server spiffytech Linux - Security 2 02-08-2006 09:16 PM
excluding url cached by squid ilnli Linux - Software 1 11-02-2005 04:03 AM
Squid URL list linuxeagle Linux - Networking 2 05-12-2004 02:25 PM
url filtering using Squid RajaRC Red Hat 1 11-07-2003 07:21 AM


All times are GMT -5. The time now is 10:11 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration