tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Kewl" <>
Subject Re: Tomcat - Apache: IP replacement
Date Tue, 03 Jul 2007 14:46:20 GMT

----- Original Message ----- 
From: "Nino Ulsamer" <>
To: "Tomcat Users List" <>
Sent: Tuesday, July 03, 2007 2:25 PM
Subject: AW: Tomcat - Apache: IP replacement

thanks for your help!

I now tried the following: I set up the configuration as you told me on my 
local machine (running Windows XP) and everything works like expected 
(getting some IP-address), like you described.

If, however, I move to one of our servers (I tried two different servers 
now), both running a Windows 2000 Server operating system, I get the 
IP, using exactly the same configuration as on my local machine.

Dont know.... if those are established servers, settings are probably OK, 
only thing I can think of is that JK MOD and Apache.... are a mismatched 
pair has no versioning info in the file, so its not possible to check 
Right click on each httpd.exe file (apache/bin) and check the version.
Then go to
get the MOD_JK file with the closest number to that Apache version.Replace the with
the matching version, and restart apache...--------Any ideas????Thanks,Nino-----Urspr√ľngliche
Nachricht-----Von: Johnny Kewl []Gesendet: Dienstag, 3. Juli 2007
13:14An: Tomcat Users ListBetreff: Re: Tomcat - Apache: IP replacementHi Nino,Just to make
sure my memory served me correctly, I setup a test case forApache -> JK -> TC.... on
a machine (XP SP2) with IPV6 enabled.Apache, Browser and TC... are all on same machine to
simulate your test.Apache is not IPv6 enabledThe machines name is Animal.... ipv4
IPv6 2001:918:0:12:1::2I have a simple webapp that returns the getRemoteAddrTurns out I was
close, but my memory is actually crap ;)This is what happens...==== Direct to TC  Local Browser===http://localhost:8080/TestRemoteIp/
  gives  Remote IP is 0:0:0:0:0:
 0:0:1http://animal:8080/TestRemoteIp/   gives  Remote IP is 0:0:0:0:0:0:0:1(See my memory
sucks.... I remembered that as is different from IPv4.... normally that will
return ifI remember correctly ;)So IPv6 seems to map it all to the loop back
addresshttp://   gives Remote IP is goodness ;)http://[2001:918:0:12:1::2]:8080/TestRemoteIp/
 gives Remote IP is2001:918:0:12:1:0:0:2=== Thru Apache Local Browser===http://localhost/TestRemoteIp/
 gives Remote IP is actually fixes it ;)http://animal/TestRemoteIp/  gives Remote
IP is with IPv6 the machine name is now mapping to loop back... on IPv4 itwould
be  gives Remote IP is[2001:918:0:12:1::2]/TestRemoteIp/
  FAILS expected because thisapache is not IPv6 enabled=== Thru Apache REMOTE machine Browser===When
Calling "Animal", or "".... always gives the correct IPV4address of remot
 e machine (which is not IPv6 enabled)So as you can see.... a few things are different on
IPV6..... which I nowbelieve you not on ;).... the you getting is just very strangeEven
though the little differences will make developers pull their hair out;).... its definitely
is working, even on IPv6 and the differences are onlywhen testing from a local browser.Just
to make sure.... I downloaded Apache and Mod_JK again for the test....Used Apache apache_2.2.4-win32-x86-no_ssl.msiand
mod_jk-apache-2.2.4.soNOTICE THAT even though JK is now at version JK-1.2.23.... the binary
fileyou download must match the version of you can see from the notes on this page
MOD_JK.conf ========<IfModule !mod_jk.c>  LoadModule jk_module "D:/DEV/Apache2.2.4/modules/"</IfModule>JkWorkersFile
conf/jk/workers.propertiesJkLogFile conf/jk/mod_jk.logJkLogLevel info#JkLogLevel debugJkLogStampF
 ormat "[%a %b %d %H:%M:%S %Y]"JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectoriesJkRequestLogFormat
"%w %V %T"JkMount /TestRemoteIp/*  worker1========== WORKERS.Properties ========worker.list=worker1#
Test JSP =================<%@page contentType="text/html"%><%@page pageEncoding="UTF-8"%><html>
   <head>        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       <title>TEST getRemoteAddr</title>    </head>    <body>    <h1>TEST
getRemoteAddr</h1><%String callerIP = request.getRemoteAddr();%>    <p>Remote
IP is <%=callerIP%></p>    </body></html>I couldnt simulate what you
getting.... can only suggest you download thestuff again... the above definitely works, and
I'm guessing you got a bumfile, or a mismatch between Apache and JK module......Good Luck-----
Original Message -----From: "Nino Ulsamer" <>To: "Tomcat
 sers List" <>Sent: Monday, July 02, 2007 5:43 PMSubject: AW:
Tomcat - Apache: IP replacementHey,thanks for your support so far.I just played around with
the settings some more and could find out moreinteresting stuff...First of all, about our
configuration: we have an Apache and Tomcat runningon 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), theIP is correct. But if I go through JK, the address gets changed to checked
the JK log file, and it logs the following before forwarding toTomcat:[Mon Jul 02 17:28:36
2007] [0848:1240] [debug] mod_jk.c (604): Serviceprotocol=HTTP/1.1 method=GET host=(null)
addr= auth=(null) user=(null) raddr=
even here, this strange is coming up.One more intersting to notice. From the logfiles
I saw that this wholeproblem started when we switched from JK 
 2 to JK 1.2 (which is supposed tobe the newer version).But we are using very basic settings
of JK, according to the howto of thewebsite. A single loadbalancer-worker, so nothing special.Any
hints???Nino---------------------------------------------------------------------To start
a new topic, e-mail: users@tomcat.apache.orgTo unsubscribe, e-mail: users-unsubscribe@tomcat.apache.orgFor
additional commands, e-mail:
start a new topic, e-mail: users@tomcat.apache.orgTo unsubscribe, e-mail: users-unsubscribe@tomcat.apache.orgFor
additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message