OSX10.3 webserver: User ip adress is server's local ip

pixeline

Registered
hello mates,

check my website: http://www.pixeline.be
It tracks your ip address and should display it in the title bar, as well as in the flash file on the right. It used to work, but since i moved the website to this mac os X 10.3 server, instead of the user's ip address, it displays the server local ip address. This is made through php and i tried several methods, i'm sure of the code so i wonder which setting in the webserver is incorrect.

any idea where i should look for a solution ?

thanks,
 
This is because Mac OS X Server handles every request though the "performance cache". Instead of handling requests directly, the server loads the requested pages into cache RAM and redirects to port 16080. Therefore, every request on port 16080 was originally a local request to port 80 on the server, and the server's IP will show up as client IP.

Although the performance cache may make your server faster and save hard disk activity, it's mostly a troublemaker because it messes up http headers and operates on an unregistered port (16080). It also causes trouble for dynamic sites, i.e. php.

This link should give you some info on performance cache and how to disable it:

http://search.info.apple.com/?search=Go&lr=lang_en&kword=&q=disable performance cache
 
Interesting... even for those of us with OS X client.

BTW, following ksv's link I found pixeline's exact answer:
http://docs.info.apple.com/article.html?artnum=107017 said:
... when the performance chace is enabled, as it is by default, the "%h" item would extract the local computer's IP address. To extract the remote client's IP address, the log format string needs to be modified:

%{PC-Remote-Addr}i %l %u %t "%r" %>s %b
 
hello ksv, thanks a lot for the linking and the resources.

i turned it off, but it seems that it didn't solve the problem.

maybe it is because i access it from the local network. How about you, could you test it again and tell me if it still displays 192.0.1.20 ?

thanks a lot for all your help,


pxln
 
Back
Top