[squid-users] Reverse Proxy and Apache logging

2007-01-02 Thread Odhiambo WASHINGTON
Hello and Happy New Year!

I have one question which I need some clues about.

I am running Squid-2.6 in accelerator mode. The site being accelerated 
is being served by apache which is residing on the same box as Squid.

Squid is listening on the public IP of the box while Apache listens on
the loopback interface (127.0.0.1).

Now, for the purpose of getting access statitics for the websites being
accelerated

My Squid config for acceleration is as follows:

# Since apache is on the same host, we make apache bind to 127.0.0.1 and
# Squid listens on the public IP
http_port a.b.c.d:80 defaultsite=www.domain.tld vhost
cache_peer 127.0.0.1 parent 80 0 no-query originserver


Now, when I check the Apache logs, there are no details of the actual
hosts accessing the website:

127.0.0.1 - - [02/Jan/2007:13:08:53 +0300] "POST /searchmyresults.php HTTP/1.0" 
302 18844
127.0.0.1 - - [02/Jan/2007:13:08:52 +0300] "GET /kcperesults.php HTTP/1.0" 200 
33729
127.0.0.1 - - [02/Jan/2007:13:08:52 +0300] "GET /kcperesults.php?start=21 
HTTP/1.0" 200 33789
127.0.0.1 - - [02/Jan/2007:13:08:54 +0300] "GET 
/kcpe2006res.php?id=1477429&cenno=603030 HTTP/1.0" 200 19026
127.0.0.1 - - [02/Jan/2007:13:08:53 +0300] "GET /kcperesults.php HTTP/1.0" 200 
33714
127.0.0.1 - - [02/Jan/2007:13:08:55 +0300] "POST /juan1.php HTTP/1.0" 302 -
127.0.0.1 - - [02/Jan/2007:13:08:55 +0300] "GET 
/kcpe2006res.php?id=1917448&cenno=401116 HTTP/1.0" 200 19026
127.0.0.1 - - [02/Jan/2007:13:08:55 +0300] "GET /searchmyresults.php HTTP/1.0" 
200 18844
127.0.0.1 - - [02/Jan/2007:13:08:56 +0300] "GET /kcpe.php HTTP/1.0" 200 18083
127.0.0.1 - - [02/Jan/2007:13:08:56 +0300] "GET / HTTP/1.0" 200 20460

Is there something that I need to put in squid.conf so that it can
"forward" to apache the actual details (IP, name) of the connecting
host for logging?

I'd like to be able generate access stats for the websites using
apache logs.

Thank you in advance..



-Wash

http://www.netmeister.org/news/learn2quote.html

DISCLAIMER: See http://www.wananchi.com/bms/terms.php

--
+==+
|\  _,,,---,,_ | Odhiambo Washington<[EMAIL PROTECTED]>
Zzz /,`.-'`'-.  ;-;;,_ | Wananchi Online Ltd.   www.wananchi.com
   |,4-  ) )-,_. ,\ (  `'-'| Tel: +254 20 313985-9  +254 20 313922
  '---''(_/--'  `-'\_) | GSM: +254 722 743223   +254 733 744121
+==+

Honk if you hate bumper stickers that say "Honk if ..."


Re: [squid-users] Reverse Proxy and Apache logging

2007-01-02 Thread Adrian Chadd
On Tue, Jan 02, 2007, Odhiambo WASHINGTON wrote:

> Is there something that I need to put in squid.conf so that it can
> "forward" to apache the actual details (IP, name) of the connecting
> host for logging?
> 
> I'd like to be able generate access stats for the websites using
> apache logs.

It will be; Squid will be setting X-Forwarded-For with the details of the
origin host.

I believe there's a way to log the contents of that particular header
in apache.log but I don't have it on hand at the moment.



Adrian

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -


Re: [squid-users] Reverse Proxy and Apache logging

2007-01-04 Thread Henrik Nordstrom
tis 2007-01-02 klockan 13:12 +0300 skrev Odhiambo WASHINGTON:
> Now, for the purpose of getting access statitics for the websites being
> accelerated
[...]
> Now, when I check the Apache logs, there are no details of the actual
> hosts accessing the website:

Shouldn't you base such statistics on the Squid logs instead?

> Is there something that I need to put in squid.conf so that it can
> "forward" to apache the actual details (IP, name) of the connecting
> host for logging?

As Adrian said it's already done and more a matter of adjusting your
Apache configuration to actually log the correct details.

If you want to have Apache access rules based on the source IP then it's
a little tricker, but there is patches to Apache for doing that.

> I'd like to be able generate access stats for the websites using
> apache logs.

Which will not be very representative access stats as you have the Squid
as accelerator in front skewing the access pattern on the Apache
noticeably..

Regards
Henrik


signature.asc
Description: Detta är en digitalt signerad	meddelandedel


Re: [squid-users] Reverse Proxy and Apache logging

2007-01-04 Thread Heikki Lampén

On 1/4/07, Henrik Nordstrom <[EMAIL PROTECTED]> wrote:

If you want to have Apache access rules based on the source IP then it's
a little tricker, but there is patches to Apache for doing that.


I had this problem a while ago and I thought of using the
X-Forwarded-For header in apache's confs in this manner:

SetEnvIf X-Forwarded-For 10.1.1.1 TRUSTED_USER

Allow from env=TRUSTED_USER

which can be fine-grained into a usable version by able Apachemen. I think. :-)

Heikki
--
Heikki Lampen
[EMAIL PROTECTED]