[Tfug] Squid help?

Harry McGregor micros at osef.org
Sat Dec 5 23:49:22 MST 2009


Jude Nelson wrote:
> Hey all,
>
> I'm trying to use Squid as a file caching mechanism to fill the
> following role:
>
> (0) the application starts an HTTP server (Python's default one) on
> localhost
> (1) the application needs to get a file
> (2) the application asks local Squid daemon for the file
> (3a) if Squid has it, it gives the application the file and the
> application processes it
> (3b) if Squid does not have it, the application will:
> (3b(a)) download the file
> (3b(a)) put the file into Squid by issuing an HTTP GET request to
> localhost; Squid, being a proxy between the application and the HTTP
> server set up in (0) reads the file into its cache
>
> Basically, I'm trying to use Squid as a local file cache.  It will not
> be accessible from any host except localhost.  However, I can't ever
> establish a connection with Squid--any HTTP GETs I try to pass through
> Squid, either to a file on localhost or to file on a remote host,
> always result in HTTP 400.  Each line in my
> /var/cache/squid3/access.log file looks like this:
>
> 1259687247.985      0 127.0.0.1 NONE/400 1989 GET
> /home/jude/Desktop/finals.txt - NONE/- text/html
>
> (the aforementioned line was generated via a GET to
> "http://localhost:3128/home/jude/Desktop/finals.txt").  My firewall
> settings allow Squid; in fact, turning off the firewall has no effect.

I presume you are talking to squid on it's default port of 3128...

Squid does not have access to the file system, it only has access to
either http hosts or other protocols you configure it for.

I don't know the syntax to pass an http request through squid manually,
but you should be able to "export http_proxy="http://localhost:3128" and
use it to reach a web servr locally.

what OS platform are you on / distro, etc

What port is your python webserver listening on?

>
> I am not very familiar with Squid's default settings, and Google has
> yet to reveal anything useful.  Is there something I need to
> add/remove to the config?  My ACL already allows requests from
> localhost, and I haven't changed the default HTTP port.  Is Squid even
> capable of fulfilling the roll I want it to fulfill?
>

                         Harry


> Thanks,
> Jude
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>   





More information about the tfug mailing list