Mantis - Quercus
Viewing Issue Advanced Details
2699 feature always 05-26-08 17:19 05-28-08 15:52
perololo  
ferg  
normal  
closed 3.2.0  
fixed  
none    
none 3.2.0  
0002699: [PATCH] added _SERVER['SERVER_ADDR'] and _SERVER['PATH_AUTH_USER']
see attached a patch to add values for _SERVER['SERVER_ADDR'] and _SERVER['PATH_AUTH_USER'].

Since servlet request does not provide a server IP address, it is derived from the request server name.
1) a DNS lookup is done on the server name in the request
2) the first IP address matching an interface address is used
3) in case no address matches, the IP address of the first non-loopback active interface is used
4) if no such interface exist, the IP address of the first active loopback interface is used.

There may be occasions where resolving the name to an IP address may fail. eg: if the server has more than one IP, the web server listens on the secondary interface and the hostname does not resolve to an IP address via DNS because it is a private test-name. In this case the IP of the primary interface would be used but no web service is listening on this IP.
To avoid this situation, you may add your hostname to /etc/hosts or c:\Windows\System32\drivers\etc\hosts
 G:\Kundenumsetzungen\Online\quercus-3.2-svn_server-array.2008-05-27.02-00.diff [^] (6,993 bytes) 05-26-08 17:19

Notes
(0003106)
ferg   
05-28-08 15:52   
php/082{a,b}