Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

REMOTE_ADDR Returns address of server

Status
Not open for further replies.

tandrews1

IS-IT--Management
Joined
Feb 17, 2005
Messages
17
Location
US
I'm just starting to dig into some Perl scripting and have run across the following issue with a script:

Using the environment variable REMOTE_ADDR is returning the address of the server, not the client.

I'm running this on an OS X server running Apache 1.2.27 and the host is a virtual host.

Any ideas?
 
Is the webserver also a network gateway? What's the network topology look like?
--Paul

cigless ...
 
Nope... just a server. One NIC, one ip address.

The server sits at 10.2.0.19, I'm connecting from a workstation on the same network at 10.2.0.255. Using RETURN_ADDR Perl writes 10.2.0.19 to the log file.

I'm beginning to wonder if this isn't an apache thing?
 
RETURN_ADDR or REMOTE_ADDR?
--Paul

cigless ...
 
Duh... my bad. REMOTE_ADDR
 
Are you now sorted, or not

if not post some code, but it could be down to your network configuration

--Paul

cigless ...
 
No... not working. The variable is typed correctly in the script (RETURN_ADDR was just a typo here). REMOTE_ADDR returns the address of the server.

Even the ssi directive in a little java script designed to display the client ip address:

<!--#echo var="REMOTE_ADDR"-->

returns the server ip address. I must be missing something with Apache.
 
a bit of code might help

--Paul

cigless ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top