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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access_Log Error

Status
Not open for further replies.

tandrews1

IS-IT--Management
Feb 17, 2005
17
US
OSX server running Apache 1.3 ... I first noticed the problem when running a cgi that was set to return the client ip address. I kept getting the address of the server returned no matter which client I connected from.

I took a look at the access_log today and see that every log entry begins with the FQDN of the server, not the ip address of the host. I looked back at some logs from October and see that things were working correctly then, but I am baffled as to what I would have changed in the config to cause this.

Any suggestions are appreciated



fermat.bemidji.k12.mn.us - - [24/Feb/2005:14:24:07 -0600] "GET /images/21_century.jpg HTTP/1.1" 200 33440
fermat.bemidji.k12.mn.us - - [24/Feb/2005:14:24:18 -0600] "GET /images/content_maintop.gif HTTP/1.1" 304 -
fermat.bemidji.k12.mn.us - - [24/Feb/2005:14:24:20 -0600] "GET /images/copyright.gif HTTP/1.1" 304 -
fermat.bemidji.k12.mn.us - - [24/Feb/2005:14:25:53 -0600] "GET /Schools/schools_jwsmith.html HTTP/1.1" 304 -
fermat.bemidji.k12.mn.us - - [24/Feb/2005:14:25:54 -0600] "GET /isd31.css HTTP/1.1" 304 -
fermat.bemidji.k12.mn.us - - [24/Feb/2005:14:25:55 -0600] "GET /mm_menu.js HTTP/1.1" 304 -
fermat.bemidji.k12.mn.us - - [24/Feb/2005:14:25:57 -0600] "GET /images/content_jw.gif HTTP/1.1" 304 -
 
After checking the log a bit further and shutting off HostnameLookups I do see that the ip address of the client is getting logged properly, but my initial problem continues and I still wonder if it is something with my Apache config.

I am running a cgi (not of my creation) that has the following line in one of its related perl scripts:

my $ip = $ENV{"REMOTE_ADDR"};

Which is supposed to grab the client ip address. The problem, however, is that it grabs the server's ip address every time.

A look at the access_log:

10.2.0.255 - - [25/Feb/2005:12:59:23 -0600] "GET /cgi-bin/vote/index.cgi HTTP/1.1" 200 1601

Shows that the client address is logged properly, but when the script writes the my $ip variable to a log file it writes 10.2.0.19, which is the address of the server.

Is there a possibility that Apache is passing the wrong address?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top