Hey,
thanks for your support so far.
I just played around with the settings some more and could find out more 
interesting stuff...

First of all, about our configuration: we have an Apache and Tomcat running on 
the same machine, with JK 1.2 in between. If I log requests in Apache, the IP 
address is correct. If I go directly to Tomcat (via port 8080), the IP is 
correct. But if I go through JK, the address gets changed to 0.0.0.0. I checked 
the JK log file, and it logs the following before forwarding to Tomcat:

[Mon Jul 02 17:28:36 2007] [0848:1240] [debug] mod_jk.c (604): Service 
protocol=HTTP/1.1 method=GET host=(null) addr=0.0.0.0 name=xxx.xxx.xxx.xxx 
port=80 auth=(null) user=(null) laddr=xxx.xxx.xxx.xxx raddr=0.0.0.0

So even here, this strange 0.0.0.0 is coming up.

One more intersting to notice. From the logfiles I saw that this whole problem 
started when we switched from JK 2 to JK 1.2 (which is supposed to be the newer 
version).

But we are using very basic settings of JK, according to the howto of the 
website. A single loadbalancer-worker, so nothing special.

Any hints???

Nino


-----Ursprüngliche Nachricht-----
Von: Johnny Kewl [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 2. Juli 2007 14:59
An: Tomcat Users List
Betreff: Re: Tomcat - Apache: IP replacement


----- Original Message ----- 
From: "Nino Ulsamer" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Monday, July 02, 2007 1:43 PM
Subject: AW: Tomcat - Apache: IP replacement


John,
keep cool ;-)
So that might be interesting. We indeed have a MS Box running here, so where 
exactly could we come across IPv6?
---
Its just that I noted that when I only had ipv4 installed, and called it 
from local browser
getRemoteAddr would return 127.0.0.1..... but when I had IPv6 installed, it 
would return 0.0.0.0

So... I'm guessing that IPv6 is installed on that machine...
I dont have VISTA, but there I think its a default, on XP you have to make 
it happen, and its tricky.

And I'm thinking that if Apache is not on the same machine as TC.... getting 
0.0.0.0 is actually impossible, even if it was picking up on the Apache 
server.
I dont think a loop back address can call anything but the machine.
Perhaps if Apache and JK and all the rest are on the same machine, and setup 
on localhost.... that result could in fact be right.
Anyway.... this is all wild guesses

I think if you explain the configuration a little more, and maybe show the 
snippets of configuration files, a guru may spot it.
For example if you calling the Apache box, but the browser is on the same 
machine as TC, then I would guess, its not actually going thru Apache, and 
its getting in thru another connecter.... something like that.

If u interested in IPv6.... heres an article from when the TC guys where 
messing around with it... http://www.junlu.com/msg/354211.html
---




Thanks,
Nino


-----Ursprüngliche Nachricht-----
Von: Johnny Kewl [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 2. Juli 2007 13:21
An: Tomcat Users List
Betreff: Re: Tomcat - Apache: IP replacement

Ha ha.... you made me panic, no my load sharing stuff behind JK, is not
doing that, ie getRemoteAddr is working.
You know if you on a MS box, (guessing wildly here), the first time I ever
saw 0.0.0.0 as a local address is when I was playing with IPv6.....
and only on the "local" IPV6 addresses, maybe?
Anyway if its any concillation.... I dont think JK->TC, does that normally.

----- Original Message ----- 
From: "Nino Ulsamer" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Monday, July 02, 2007 12:01 PM
Subject: Tomcat - Apache: IP replacement


Hello,

I have a problem with finding out the IP address of requests in Tomcat.
I'm using the HttpServletRequest.getRemoteAddr() function, but it
returns "0.0.0.0". My server configuration is as follows: Apache
receives all requests and forwards them to Tomcat via mod_jk. Probably
in this step it replaces the address of the original request by its own
address. I've read a lot about this topic already, but I always found
the solution being "you should use mod_jk". I'm using JK 1.2, is it
possible to configure it so that it does not replace the IP address?

Thanks a lot,

Nino Ulsamer



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to