[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: squid configuration for small office




On Jul 23, 2007, at 6:45 PM, rocky wrote:
Thank you very much for your help! Could you give me some hint on how
to automatically set up the 15 PCs using squid as HTTP proxy server
please?

I used this method:
http://wiki.squid-cache.org/SquidFaq/ ConfiguringBrowsers#head-5aa28de5e8308087a925cb7ef54ca070a16564d4

First, I created a wpad.dat file, and put it on a web server. (You can run the web server on the same machine you're running Squid on.) My wpad.dat was very simple, a stripped-down version of the example in the documentation, because I only want to cache http queries:

function FindProxyForURL(url, host)
{
        if (isPlainHostName(host))
                return "DIRECT";
        if (!isResolvable(host))
                return "DIRECT";

        if (url.substring(0, 5) == "http:")
                return "PROXY 192.168.10.1:3128; DIRECT";
        else
                return "DIRECT";
}

I put this on my webserver (which, to my local clients, is http:// 192.168.10.1/) and then tested it in Firefox by choosing "automatic proxy configuration URL" and putting "http://192.168.10.1/wpad.dat"; in the box.

Once I had that working, I created a DNS entry. This needs to be of the form wpad.(domain name), where (domain name) is whatever the clients have their domain set to. For example, my clients have gull.us as their domain, so I created a DNS entry for 192.168.10.1 that was called wpad.gull.us. Since I'm using dnsmasq to serve DNS records to the clients, this was as easy as adding "192.168.10.1 wpad.gull.us" to /etc/hosts on the server and restarting dnsmasq.

After that, I checked "Auto-detect proxy settings for this network" in Firefox and verified that it worked. This should also work in IE if "Automatically detect proxy settings" is checked, which is usually the default.

Hope this helps. It sounds complicated, but if you take it one step at a time, and check that each step works before you move on, it's really not bad.



Reply to: