Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help: apache work with tomcat

 
Zoe Peng
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to get remote user information using request.getRemoteAddr(),
things working great on Tomcat alone, however, if I try to use Apache proxy
support have some problems. Here is the situation:

1) Client 192.168.1.1----------->tomcat server
http://192.168.1.2:8080/myservlet , and servlet return remoteAddr
192.168.1.1, works great.
2) Client 192.168.1.1-----------> apache server http://192.168.1.2/myservlet
(through Apache proxy support redirect to
http://192.168.1.2:8080/myservlet), servlet return remoteAddr is
192.168.1.2, which is server's address

I guess 2) mistake request come from server itself instead of client machine
because request get forwarded.
Anyone knows if there is work around or other method that I can use to get
client information from tomcat servlet?
 
David Peterson
author
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does switching UseCanonicalName Off (or On) make any difference?
David
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic