CGI (env "REMOTE_ADDR") question

Started by cormullion, June 05, 2008, 01:40:59 PM

Previous topic - Next topic

cormullion

Do any of you CGI wizards know why (env "REMOTE_ADDR") in a CGI environment sometimes returns two IP addresses rather than one?

Jeff

#1
Proxy servers?  I don't know.  Maybe it's an error :)
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code

Tim Johnson

#2
I've never seen such a thing. Are you able to elaborate - safely -

without leaving anything open to exploit?

tim
Programmer since 1987. Unix environment.

cormullion

#3
Well, the matching entry in the Apache log is like this:


64.27.13.129, 217.219.95.60 - - [05/Jun/2008:02:17:37 -0700] "POST /comment.cgi HTTP/1.0" 200 59498 ...

- that's a spammer caught in the act of posting some spam.  :) My code is using (env REMOTE_ADDR) and therefore picking up two IP addresses ...



Since these double IPs appear a lot in the log, I had presumed they're something well known..

newdep

#4
if you always have double IP's then the first is the Apache-Server the second the client.



If you have it randomly it could be a redirect..from source..

Like from google -> destination..



But thats all i know...
-- (define? (Cornflakes))

Jeff

#5
What's your apache log format string?
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code

cormullion

#6
It seems to be this:



clientip - username [time] "request" status bytes "referer" "useragent"



I think your 'proxy server' suggestion is right, Jeff. In that case, which one would identify that user again?

Jeff

#7
No idea.  That was a complete shot in the dark.  :)
Jeff

=====

Old programmers don\'t die. They just parse on...



http://artfulcode.net\">Artful code