Accelerate Local HTTP + 2 servers on LAN - squid

This is a discussion on Accelerate Local HTTP + 2 servers on LAN - squid ; I want my VPN users to hit a hostname, and have squid serve up the appropriate content from the appropriate server based on what it finds in the /etc/hosts file. Now, the trick is, I still need to serve up ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Accelerate Local HTTP + 2 servers on LAN

  1. Accelerate Local HTTP + 2 servers on LAN

    I want my VPN users to hit a hostname, and have squid serve up the
    appropriate content from the appropriate server based on what it finds
    in the /etc/hosts file.

    Now, the trick is, I still need to serve up data via Apache HTTP from
    the machine that is running squid. I have two servers on the local
    network that are proxied up just fine according to the config below
    (cls00009-rt and cls00009-m2; see /etc/hosts for details - below).

    I found some docs on this, and I setup Apache to BindAddress 127.0.0.1
    and to listen on port 80
    (http://www.squid-cache.org/Doc/FAQ/FAQ-20.html). I even set Listen
    127.0.0.1:80, but I am still getting Forwarding Loop errors.

    Any ideas? Thanks!


    I have the following Squid.conf
    -----------------------------------------
    http_port 80
    visible_hostname cls9proxy
    cache_effective_user squid

    #cache_peer cls00009-rt.domain.net parent 80 3130 proxy-only
    #cache_peer cls00009-m2.domain.net parent 80 3130 proxy-only

    acl all src 0.0.0.0/0.0.0.0
    acl manager proto cache_object
    acl localhost src 127.0.0.1/255.255.255.255
    acl SSL_ports port 443
    acl Safe_ports port 21 80 443
    acl CONNECT method CONNECT
    acl local_users src 10.8.0.0/255.255.0.0

    http_access allow manager localhost
    http_access deny manager
    http_access deny !Safe_ports
    http_access deny CONNECT !SSL_ports
    http_access allow localhost
    http_access allow local_users
    http_access deny all

    #httpd_accel_host 192.168.100.1 # Only if single_host
    httpd_accel_host virtual
    httpd_accel_port 80
    httpd_accel_single_host off
    httpd_accel_with_proxy off
    httpd_accel_uses_host_header on
    ------------------------------------------

    Contents of /etc/hosts:
    ------------------------------------------
    127.0.0.1 cls00009.domain.net cls00009 localhost
    192.168.100.1 cls00009-rt.domain.net
    192.168.100.20 cls00009-m2.domain.net


  2. Re: Accelerate Local HTTP + 2 servers on LAN

    Ok, I have figured out how to do this.

    In apache, there are several directives I worked with / tried using:

    Port 80
    Listen 127.0.0.1:80
    BindAddress 127.0.0.1

    The idea was, that apache would only answer requests on the local
    loopback interface on port 80, whereas squid would handle all incoming
    requests from external sources on port 80. In order to do this, the
    proper binding has to be applied to apache.

    I found the way to do this by modifying the Listen directive within the
    If statement for HAVE_SSL.

    So, I didn't use the Listen or BindAddress directives, but I did leave
    the Port set to 80, and my HAVE_SSL section looks like this:


    Listen 127.0.0.1:80
    Listen 443



    Now, in the squid.conf - I set the http_port to bind squid to the
    external listening IPort
    http_port 10.8.0.19:80

    once i did this, and restarted each service, they bind themselves to a
    separate interface, using the same port, and all worked perfectly.

    keep in mind - you have to have your /etc/hosts file setup to resolve
    the addresses you are accelerating.


+ Reply to Thread