LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 02-13-2008, 12:58 AM   #1
shahz
Member
 
Registered: Sep 2006
Location: Quetta, Pakistan
Distribution: RHEL, Ubuntu, Fedora
Posts: 368

Rep: Reputation: 29
Configuring squid for limited sites


I want to configure my squid to give access for limited sites. what is required to do this.

thanks
 
Old 02-13-2008, 02:26 AM   #2
garyalex
Member
 
Registered: Jun 2006
Location: Johannesburg, South Africa
Distribution: Ubuntu, CentOS, Debian
Posts: 47

Rep: Reputation: 15
http://www.squid-cache.org/Doc/

That is the link for full squid documentation.

You would need a few simple acls and http_access statements in your squid.conf:

Code:
acl mysite1 dstdomain .example.com
acl mysite2 dstdomain .someother.com
acl all src 0.0.0.0/0.0.0.0

http_access allow mysite1
http_access allow mysite2
http_access deny all
 
Old 02-14-2008, 09:11 AM   #3
shahz
Member
 
Registered: Sep 2006
Location: Quetta, Pakistan
Distribution: RHEL, Ubuntu, Fedora
Posts: 368

Original Poster
Rep: Reputation: 29
well can I writte down all the sites within a text file and then how acl will look like.
 
Old 02-15-2008, 01:25 AM   #4
garyalex
Member
 
Registered: Jun 2006
Location: Johannesburg, South Africa
Distribution: Ubuntu, CentOS, Debian
Posts: 47

Rep: Reputation: 15
You would do the following then:

Code:
acl mysites dstdomain "/etc/squid/mysites.txt"
acl all src 0.0.0.0/0.0.0.0

http_access allow mysites
http_access deny all
Then edit /etc/squid/mysites.txt

Code:
.example.com
.somewhere.com
And so on...
 
Old 02-16-2008, 01:11 AM   #5
shahz
Member
 
Registered: Sep 2006
Location: Quetta, Pakistan
Distribution: RHEL, Ubuntu, Fedora
Posts: 368

Original Poster
Rep: Reputation: 29
thanks for the quick response, just one more thing and I will be finish with this issue, and the issue that if I hav two networks one 192.168.0 and 192.168.1 I want to allow the full access for the webs to 192.168.0 but want to restrict the other network just to limited sites, then how acl will look like.

thanks in advance

shahz
 
Old 02-17-2008, 10:21 PM   #6
garyalex
Member
 
Registered: Jun 2006
Location: Johannesburg, South Africa
Distribution: Ubuntu, CentOS, Debian
Posts: 47

Rep: Reputation: 15
You would modify like this:

Code:
acl mysites dstdomain "/etc/squid/mysites.txt"
acl all src 0.0.0.0/0.0.0.0
acl net1 src 192.168.0.0/255.255.255.0

http_access allow mysites
http_access allow net1
http_access deny all
 
Old 02-19-2008, 09:24 AM   #7
shahz
Member
 
Registered: Sep 2006
Location: Quetta, Pakistan
Distribution: RHEL, Ubuntu, Fedora
Posts: 368

Original Poster
Rep: Reputation: 29
If I apply the above acls then my second network can not browse any thing because I am denying http access to all and just allowing net1 which is my first network am I right.

thanks
 
  


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 Off
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 and https sites 2buck56 Linux - Security 6 06-14-2007 03:06 AM
Squid block sites linuxnirmal Linux - Security 5 11-15-2006 10:59 AM
Squid, Limited Service sarmadys Linux - Networking 4 11-06-2006 06:22 AM
Squid limited to 3 concurrent downloads lukebeales Linux - Software 0 06-14-2004 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 05:00 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