Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

[bug] Tracking User IP /w proxy + Solution

Quote Reply
[bug] Tracking User IP /w proxy + Solution
I'm running my mod_perl server (apache 1.3.24 .. the work horse) behind my front end server (apache 2.0.36) using mod_proxy and noticed that it does not track the end users ip address properly in this case. I solved the problem by adding this as the first line of gforum.cgi:

if ($ENV{HTTP_X_FORWARDED_FOR}) { $ENV{REMOTE_ADDR} = $ENV{HTTP_X_FORWARDED_FOR} }

This works fine but there might be a better way to handle this in the long run. Just an FYI for future releases.
Quote Reply
Re: [onetimeposter] [bug] Tracking User IP /w proxy + Solution In reply to
Hi,

We recommend using a mod_perl handler to fix the ip address. This will make REMOTE_ADDR contain the real ip for all programs, not just Gossamer Forum. See:

http://perl.apache.org/...Remote_Server_IP_in_

which shows the mod_perl handler you should use.

Cheers,

Alex
--
Gossamer Threads Inc.

Last edited by:

Alex: May 20, 2002, 1:42 PM