Categories
Web Serving

HTTP_PC_REMOTE_ADDR vs. REMOTE_ADDR

Mac OS X Server 10.3.9

How do I know where a “visitor” is coming from?

The most commonly found method is to look at the server setting (let’s use PHP-speak here) REMOTE_ADDR.

That’s all well and good, unless you have turned on the web performance cache for any web site being served.
When you enable the performance cache Apache now returns REMOTE_ADDR in HTTP_PC_REMOTE_ADDR.
Anything that looks at REMOTE_ADDR will get the IP address of the server itself.

SPAM blockers, poll runners, anything that wants to know about who is talking to you. WordPress, etc.

Oh, yes, as a side note: when you enable the web performance cache using ServerAdmin the httpd.conf file and all of the site conf files get re-written. Especially fun is the fact the PHP4 gets re-enabled if you have had it turned off.
Talk about scratching your head for a while.