Re: Accel with IP pass-through

From: Q <>
Date: Tue, 29 Sep 1998 09:24:59 +1000 (EST)

On Mon, 28 Sep 1998, Numa wrote:

> Question (I looked in the FAQ and docs):
> I'm running squid in accel mode for numerous virtual servers on one machine,
> with Apache on a different port. This works fine, however in the apache logs,
> all the requests now come from the IP address of the squid server. What I'd
> like to have happen is have the IP address/hostname of the requesting host
> passed through the squid server and logged by apache. Is there any easy way to
> do this? If not, what's the hard way? (And please tell me there is a way).

Squid includes a "referer" header in its requests. You could modify Apache
to log the refered IP/hostname address instead of the address of the
socket. I don't know how hard this would be without looking through the
code. But it is probably the "hard way" you referred to. If your
generating stats or bills from this remember that squid should get
a lot hits that won't appear in the apache logs.

It may be that Apache already has the ability to log the contents of a
request header, it's probaby worth looking through the logging doco on
Apache first.

Your other option would be to write a small perl script that takes your
squid logs and generates an apache style log file for each virtual web
server it services. Doing this on a nightly basis when you generate your
stats might be more usefull as the actual number of hits will be accurate.

Hmm.. now that I think about it, I might look into doing this myself :)


                          _____ / Quinton Dolan -
  __ __/ / / __/ / / Systems Administrator
     / __ / _/ / / Fast Access Network
  __/ __/ __/ ____/ / - / Gold Coast, QLD, Australia
                    _______ / Ph: +61 7 5574 1050
                           \_\ SAGE-AU Member
Received on Mon Sep 28 1998 - 16:26:11 MDT

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