Re: alias address in REMOTE_ADDR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday, May 12, 2012, Tóth Csaba wrote:

> Hi Everyone,
>
> I've run into a curious problem, not even really sure it's PHP, but that's
> where
> I caught it, so here it is:
>
> I have two servers hanging on the net, without proxies. Let's call them
> Server1
> and Server2. Server1 has multiple IP addresses, configured as aliases. My
> problem:
> When I do a wget --spider from 1 to 2, I get the eth0 (not alias) address
> in
> Apache's accesslog on Server2. But when I do a file_get_contents(
> http://server2.tld),
> and observe the $_SERVER['REMOTE_ADDR'] on Server2, I get one of the alias
> IP addresses
> back. What can cause this? I really need the eth0 IP address back in
> REMOTE_ADDR.
>
>

On server2 make sure the metric of both interface in the routing table is
not same. Same metric can cause this behavior. Change the metric of eth0 to
a lower value than the other. Then try again.


> Regards,
> Csaba
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux