http_accel, virtual hosts, and logging.

From: Greg Retkowski <greg@dont-contact.us>
Date: Tue, 28 Mar 2000 19:04:25 -0800 (PST)

Hello All,
  I scrounged the newsgroups and FAQ's but to no avail. I am using squid
2.2 as an http accelerator in front of an apache/mod_perl webserver with
several virtual hosts. My problem is that my configuration generates URL
logs like:

954291569.255 85 128.209.24.253 TCP_MISS/200 3250 GET
http://localhost/ldap/ - DIRECT/localhost text/html

However I need something like:

954291569.255 85 128.209.24.253 TCP_MISS/200 3250 GET
http://www.rage.net/ldap/ - DIRECT/localhost text/html

so that I can account for which virtual sites are recieving the traffic.
My configuration is that apache binds to 127.0.0.1 port 80, and squid
binds to the external interface port 80 contacting localhost for origin
traffic.

I tried setting 'httpd_accel_uses_host_header on', and this generates
appropriate log entries however that causes squid to generate '403 access
denied's for the connecting clients. I also tried changing
httpd_accel_host from 'localhost' to 'virtual' but that causes virtual
hosts to stop working completely (I get the same page regardless of which
Vhost I visit).

My guess is that the 'httpd_accel_uses_host_header on' setting tells squid
to attempt to directly connect to the site as resolved through DNS, rather
than connecting to localhost.

Hopefully the solution for this is straight forward and someone with more
experience with squid can tell me where I'm going wrong. I've put my
config below; any recomendations would be appreciated. Thanks!

-- Greg

Greg Retkowski Mail: greg@rage.net
Raging Network Services URL: http://www.rage.net/

--8<--squid.conf--8<--
http_port 80
tcp_incoming_address 192.216.138.109
httpd_accel_host localhost
httpd_accel_port 80
#httpd_accel_host virtual
httpd_accel_with_proxy off
#httpd_accel_uses_host_header on

# What not to cache; CGI's.
acl QUERY urlpath_regex cgi-bin \? \.cgi$ \.pl$
no_cache deny QUERY

acl manager proto cache_object
acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.1/255.255.255.255
http_access allow manager localhost
http_access allow localhost
http_access allow all
Received on Tue Mar 28 2000 - 20:11:03 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:52:27 MST