LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-29-2012, 12:56 AM   #1
Iyyappan
Member
 
Registered: Dec 2008
Location: Chennai, India
Distribution: CentOS 5, SLES 11
Posts: 245

Rep: Reputation: 4
Interview Question: How to block thousands of sites at one go in squid.


In an interview, they asked me how to block thousands of sites at one go. I mean i have all the urls with me, how will i block them all. I said, we need to update the urls manually or block by any unique name. Can anyone how this is possible
 
Old 02-29-2012, 01:51 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

If you have the URLs or domains in a file then it would be as simple as adding an ACL, pointing to that file, to the configuration, apply it in a rule and reload Squid. Is that what you mean or do you need the entire 'how to'?

Kind regards,

Eric
 
1 members found this post helpful.
Old 02-29-2012, 02:33 AM   #3
Iyyappan
Member
 
Registered: Dec 2008
Location: Chennai, India
Distribution: CentOS 5, SLES 11
Posts: 245

Original Poster
Rep: Reputation: 4
It u would be really helpful if u provide 'How To'
 
Old 02-29-2012, 03:33 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Quote:
Originally Posted by Iyyappan View Post
It u would be really helpful if u provide 'How To'
Hi,

For example add this ACL to the Squid configuration file:
Code:
acl blockedsites url_regex -i "/etc/squid/blocked.txt"
and add this to the access rules:
Code:
http_access deny blockedsites
Put the URL/domains or even part of them (they're treated as regular expressions so any instance that coincides will be denied) in the file /etc/squid/blocked.txt and reload Squid:
Code:
service squid reload
Kind regards,

Eric
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid to block all the sites except 1 or 2 sites winxandlinx Linux - Networking 8 10-27-2010 02:53 AM
Squid: I like block different users different sites iseymur Linux - Security 1 02-06-2010 11:36 PM
squid 2.6 not blocking sites even i entered ACL to block sites mohantorvalds Linux - Server 1 01-08-2009 04:17 AM
Squid block sites linuxnirmal Linux - Security 5 11-15-2006 10:59 AM
how to block sites with squid.conf boakiba Linux - Networking 1 08-11-2003 05:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:58 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration