Re: [squid-users] Help with accelerated site

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sun, 28 Mar 2010 20:06:37 +1300

Adam_at_Gmail wrote:
> Hi Ron,
> Thanks for your reply and thanks for your time
>
> This is perhaps the 10th time I uninstalled it and reinstalled it
> And this is the very first time I could access my websites internally,
> externally nothing yet, I am still getting the error

This error:

> The following error was encountered while trying to retrieve the URL: /
>

... appearing in a reverse-proxy setup means Squid received a
reverse-proxy/accelerated request intended for a web server on a port
without "accel" flag configured.

Please read all my notes below right to the end of the email before
changing anything. I'm commenting on each fine detail and what it means...

>
> My clients can all access the internet, Yes I am sure that there's a
> misconfiguration in my config file but I followed every tutorial
>
> trying desperately to get something up, after a while you're saturated
> and very tired, bouncing from on issue to another
>

... so, we need you to stop bouncing and concentrate on one issue at a
time. When we are satisfied that you are understanding that one move on ...

> I checked and triple checked my iptables rules everything looks fine so far
>
> For instance, my backend server is listening right now on port 81, why
> did I put it on port 81 because I was getting
>
> Cannot bind to .... in the log file
>
> so I changed it to 81 and I am getting the same error, there's
> absolutely nothing else in my entire network that is using that port
>
> So why can't it bind to port 81? You see the type of things that can
> drive you through the wall
>
> at the moment I have only three machines
>
> A is Running the Proxy and the Router (IPTABLES)
>
> B is the back end server
>
> C is the DNS/DHCP servers
>
> And only the backend server that is currently listening on port 81 and
> before that it was listening on port 80
>
> no matter which port I put in my config I get the "Cannot bind to ...."
> in the log file

... from the below I'd guess you are changing both the Squid http_port
and the apache listening "Port" entries at the same time in your tests.

>
> here is a bit of my config
>
> *********************************************************************
>
> http_port 192.168.1.3:81 accel parent vhost defaultsite=www.mysite.org

The tutorial and advice so far as I've seen has been to place Squid
listening on "http_port 80 accel vhost" and apache listening on "Port 81".

Okay stop here. Check that. Make it so. Restart both software if needed.

If another "bind" error comes up during the restart let us know right now.

Continue reading...

>
> cache_peer 192.168.1.3 parent 81 0 no-query originserver name=main
>

Those two lines are (or 'were' right?) a loop.

  Squid listening on 192.168.1.3 port 81 is to fetch requests from
source server listening on 192.168.1.3 port 81.

What you should have after my suggested change above is:
   Squid listening on port 80 fetched from server on port 81.

Test this:
    fetch a request for http://192.168.1.3:81/
EXPECTED: results in the apache "it works", or your <VirtualHost *> site.

   fetch a request for http://192.168.1.3/

EXPECTED: results in the apache "it works", or your <VirtualHost*> site.
Received through Squid.

(using wget, curl, or squidclient to display the response errors the
second fetch there should contains Via: header which is not present in
the first fetch.)

IF (and only if) there was no "bind" error, and the headers check above
fails to show a Via: header properly. We work on that in next email...

> acl dstdomain our_sites dstdomain www.mysite1.org www.mysite2.com
> www.mysite3.net
>
> http_allow_access main allow our_sites
>
> http_peer_access main deny all
>
> At the moment all of these sites are running on the same server
> (virtualhost)
>
> The only thing I am not sure of is probably the cache_peer directive
>
> "cache_peer 192.168.1.3 parent 81 0 no-query originserver name=main"
>
> If it's wrong then I don't know what to put in there

The IP address and port of your Apache server.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE8 or 3.0.STABLE25
   Current Beta Squid 3.1.0.18
Received on Sun Mar 28 2010 - 07:06:50 MDT

This archive was generated by hypermail 2.2.0 : Mon Mar 29 2010 - 12:00:06 MDT