LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-04-2009, 07:36 PM   #1
rcbandit
LQ Newbie
 
Registered: May 2009
Posts: 15

Rep: Reputation: 0
Squid - help


Hi,
I would like to ask you is there a way to configure squid to redirect IPs. I want squid to read IP's from file saved in .TXT format saved on HDD or server on internet. And when user's IP matches with the IP from the TXT file squid redirects it to external URL hosted on remote server.
Second question - is there a way to configure squid to read the external TXT file every 10 minutes for example so when I manually enter new IP or remove old one squid reads it and reconfigure itself.

Regards
 
Old 05-04-2009, 08:30 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: pclinuxos slackware64 tails kali
Posts: 3,382
Blog Entries: 33

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi, Welcome to LQ.

LQ has a fantastic new search function,
with over 3 million posts, it is possible that your question my have been answered before.

This may save you valuable time waiting for a reply... :-)

Here are 2 web pages that have helped me, although I have not done what you require doing,

http://www.linuxhomenetworking.com/w...ess_with_Squid

http://www.visolve.com/squid/squid30/contents.php

http://www.deckle.co.za/squid-users-...trol_Operators

cheers Glenn
 
Old 05-05-2009, 06:01 AM   #3
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
Quote:
And when user's IP matches with the IP from the TXT file squid redirects it to external URL hosted on remote server.
You can use redirectors like squidguard.
Quote:
is there a way to configure squid to read the external TXT file every 10 minutes for example so when I manually enter new IP or remove old one squid reads it and reconfigure its
Every connection will force squid to read the config file(acls) so if the TXT file is linked to a certain acl, then it will be read everytime a coonnection is attempted, so you dont need to manually force squid to read it any other time.
 
Old 05-05-2009, 08:03 AM   #4
rcbandit
LQ Newbie
 
Registered: May 2009
Posts: 15

Original Poster
Rep: Reputation: 0
I thought that squid reads squid.conf only when it starts and it keeps a copy from that squid.conf file to the RAM memory. I think that reading from HDD every time when packet passes the squid server is too slow process and will be a bottleneck.

So if I do this


acl acl_allow src "192.168.2.2/squid/client_allow.txt"
acl acl_deny src "192.168.2.2/squid/client_deny.txt"

http_access deny acl_deny
http_access allow acl_allow

(keeping the .TXT file on another server) eventually will be a too slow process because for every packet squid must connect to the server where its hosted the .txt file.

Am I right?

Last edited by rcbandit; 05-05-2009 at 08:05 AM.
 
Old 05-05-2009, 10:16 AM   #5
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
not for every packet, but for every client's initial connection to the squid server.
What you intend to de is usually all handled by a redirector like squidguard. you can then configure in squidguard, the time filter, which will be checked on every connection

Last edited by chitambira; 05-06-2009 at 06:52 AM.
 
Old 05-06-2009, 06:10 AM   #6
rcbandit
LQ Newbie
 
Registered: May 2009
Posts: 15

Original Poster
Rep: Reputation: 0
I know that PHP can pass IPs with .TXT file. Is there other more efficient way to pass IPs from the PHP program to the squid server?
 
Old 05-06-2009, 06:29 AM   #7
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: pclinuxos slackware64 tails kali
Posts: 3,382
Blog Entries: 33

Rep: Reputation: 217Reputation: 217Reputation: 217
rcbandit, you may search (and read) the manual and or wiki, (the links above, hint, hint)

it will/should answer these questions,

if you have problems with the setup we may be able to help you further.

as far as I know, these files will be cached for each instance,

if they're not too large (how large are the files?) they should not cause concern.

Squid is meant to speed up web access by caching the parts of pages that don't change too often.

If the filter files are really large then there may be a better application to do the filtering on a server.

As mentioned above, squidguard and calimaris comes to mind (foss)

squid can do basic filtering and more, but you may find other tools that enable you to manage it easier(gui, search...)

I have been using squid for about 5 years and rarely have trouble. (ver3)

But I don't use a filter, all adults here on my gigantic 2 pc network (lol).

Cheers, please let us know how you go and how you got it to work.

regards Glenn
 
Old 05-07-2009, 02:42 PM   #8
rcbandit
LQ Newbie
 
Registered: May 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Hi,
I have news - my friend advice me to use LDAP - PHP writes the IPs to LDAP and squid reads them. Is it possible to do it?
 
Old 05-07-2009, 08:31 PM   #9
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: pclinuxos slackware64 tails kali
Posts: 3,382
Blog Entries: 33

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi, I'm sorry But I don't know about ldap and php.

regards, Glenn
 
Old 05-08-2009, 05:04 AM   #10
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
Its quite possible, you can use squid_ldap_auth module/helper and then you filter your users according to ips, but neads extra care on filtering.
 
  


Reply


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
[SOLVED] Squid+DansGuardian not working properly. squid blocking sites that should be linuxlover.chaitanya Linux - Server 13 11-10-2014 11:34 AM
squid conf: squid failed when I type insert redirect_program /usr/bin/squidguard laxmantsharma Linux - Software 1 02-24-2009 07:02 AM
Squid 2.6 Reverse Proxy from Squid(3128) to OrginServer(80) Not working rraj Linux - Server 0 06-06-2008 03:29 PM
LDAP authentication for squid squid 2.6.STABLE16 release 2.fc8 farrukhndm Linux - Security 2 04-03-2008 02:57 AM
squid conf: squid failed when I type insert redirect_program /usr/bin/squidguard Niceman2005 Linux - Software 1 11-24-2004 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:25 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration