Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

Is this possible with Apache

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


export at hope

Oct 10, 2008, 2:52 AM

Post #1 of 3 (97 views)
Permalink
Is this possible with Apache

This problem:

Client with IPaddress 1 opens a webpage( starts CGI script
on Apache1.)
(Here on Apache1 is running an application/CGI script)
That script will fetch a page from Apache2.

So far so easy but I need the Client's IPaddress 1 to be recorded in log of Apache 2 NOT
Apache1's address.

Something like this


Client's IPaddress 1 Client's IPaddress 1

Client ------------------>Apache1 ------------>Apache2

Apache1's addreess


Is this possible? Or must I use another proxy?

Thank you for your reply.
Lad.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


aw at ice-sa

Oct 10, 2008, 5:27 AM

Post #2 of 3 (93 views)
Permalink
Re: Is this possible with Apache [In reply to]

export[at]hope.cz wrote:
> This problem:
>
> Client with IPaddress 1 opens a webpage( starts CGI script
> on Apache1.)
> (Here on Apache1 is running an application/CGI script)
> That script will fetch a page from Apache2.

How does it fetch it ?

>
> So far so easy but I need the Client's IPaddress 1 to be recorded in log of Apache 2 NOT
> Apache1's address.
>
> Something like this
>
>
> Client's IPaddress 1 Client's IPaddress 1
>
> Client ------------------>Apache1 ------------>Apache2
>
> Apache1's addreess
>
>
> Is this possible? Or must I use another proxy?
>
I guess the evident answer is "no", unless you give some more details of
what you are trying to do, and maybe why.

For Apache2, the call comes from Apache1, so that is the address it will
record. How would it know from which IP address Apache1 was called ?
Unless you Apache1 cgi-bin script passes the original IP address somehow
in its call to Apache2, and on Apache2 something picks up that
argument/header and records it in the log.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe[at]httpd.apache.org
" from the digest: users-digest-unsubscribe[at]httpd.apache.org
For additional commands, e-mail: users-help[at]httpd.apache.org


tevans.uk at googlemail

Oct 10, 2008, 8:53 AM

Post #3 of 3 (83 views)
Permalink
Re: Is this possible with Apache [In reply to]

On Fri, 2008-10-10 at 11:52 +0200, export[at]hope.cz wrote:
> This problem:
>
> Client with IPaddress 1 opens a webpage( starts CGI script
> on Apache1.)
> (Here on Apache1 is running an application/CGI script)
> That script will fetch a page from Apache2.
>
> So far so easy but I need the Client's IPaddress 1 to be recorded in log of Apache 2 NOT
> Apache1's address.
>
> Something like this
>
>
> Client's IPaddress 1 Client's IPaddress 1
>
> Client ------------------>Apache1 ------------>Apache2
>
> Apache1's addreess
>
>
> Is this possible? Or must I use another proxy?
>
> Thank you for your reply.
> Lad.

Add an appropriate 'X-Forwarded-For'[1] header with the client's IP
address to the request headers when the CGI script requests the resource
from apache2, and then use mod_rpaf[2] to fixup the request inside
apache2, so that it appears to come from the client, and is logged as
such.

If you are already behind a reverse proxy, you should append to the XFF
header in the request headers from apache1. If you are not, you should
construct a new one (do not trust XFF headers received from clients).

[1] http://en.wikipedia.org/wiki/X-Forwarded-For
[2] http://stderr.net/apache/rpaf/

Cheers

Tom
Attachments: signature.asc (0.19 KB)

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.