Glad to be of some help.
Regarding my issue, I posted this last week, I you have any points I'd appreciate it!: Hi all, We use tomcat's formbased authentication (post to /j_security_check), the bases of which is a HTTP 302 redirect on success. We have a problem because tomcat/mod jk is issuing a full URL to the client that points at an internal ( private) IP/server - as opposed to the public IP/domain name that the user has in their browser. E.g. ________________HTTP Request _______________ POST /topup/j_security_check HTTP/1.1 Host: samplepublicdomain.com .... _______________HTTP Response _______________ HTTP/1.1 302 Moved Temporarily Date: Fri, 06 Oct 2006 09:39:38 GMT Server: Apache/2.0.46 (Red Hat) Location: http://192.168.50.110/test/ ..... __________________________________________ We need the redirect url to be http://samplepublicdomain.com/test/ Our configuration is: 2 apache httpd servers connected with mod jk (in loadbalance mode with stick sessions) to 2 tomcat servers. 1. I've tried apache httpd.conf "ServerName samplepublicdomain.com:80" 2. I've tried tomcat server.xml setting <Host name="samplepublicdomain.com"....> For those who think they can help please find more details below. Any suggestion would be much appreciated, Kind regards, Ashley Server network schematic ( I hope this comes out ok) __ Apache/2.0.46 ----------------> Tomcat5.5.9 / (private IP1 \ /> (private IP1 ) / HTTP port 80)\ / mod-jk port 8009 Loadbalancer / \/ (public IP - \ /\ on port 80) \ / \> \__ Apache/2.0.46 ---------------> Tomcat5.5.9 (private IP2 (private IP2 HTTP port 80) mod-jk port 8009) Note - to simulate a hardware load balancer that will be used in production, I have configured a separate apache on a machine with a public IP that uses mod_proxy_balancer, but I do not think this is the issue. The configuration all works except for redirects, gggrrrrrr.... -----Original Message----- From: Daniel Eckstein [mailto:[EMAIL PROTECTED] Sent: 12 October 2006 10:18 To: Tomcat Users List Subject: Re: tomat5 / sticky sessions / missing route? Hi, thanks for the reply. Ive tested with jvmRoute and it does work now! Thanks alot! It seems that the string you configure for jvmRoute is appended to the sessionid by tomcat once he sends it back to apache. >I have an outstanding problem with tomcat redirects using the full URL of >the internal server IP rather than the domainname in the URL. I'd be >interested in hearing what configuration you have for this. Could you please provide some more detail for what is getting redirected to where? Regards, Daniel Ashley Hayes schrieb: > Hi Daniel, > I recently setup some similar architecture and documentation for > tomcat mod-jk integration with proper sticky sessions is very poor. I am not > that familiar with the jk logs but do know I had to do the following to get > sticky sessions to work: > > Think your problem may be with only one "jvmRoute" configured correctly? > i.e. > > On your host 172.26.19.16 edit tomcats server.xml, add/update the jvmRoute > attribute to be the name of the worker pointing at this tomcat, e.g. > > <Engine name="Catalina" .... jvmRoute="tomcatlb1"> > > On host 172.26.19.17, set it as : > <Engine name="Catalina" .... jvmRoute="tomcatlb2"> > > > From what I have tested so far the user will get directed to the correct > tomcat regardless of apache they use (as long as the same cookie is send to > both apache's, hardware loadbalancer, dns loadbalaning etc...) > > > Thanks > A > > > > -----Original Message----- > From: Daniel Eckstein [mailto:[EMAIL PROTECTED] > Sent: 12 October 2006 09:38 > To: users@tomcat.apache.org > Subject: tomat5 / sticky sessions / missing route? > > > Dear listmember, > > Ive searched the docs and the web and couldnt find an answer to the > following: > > The setup is like 2 apaches are connecting to 2 tomcats crosswise, > apache1 to tomcat1/tomcat2 and > apache2 to tomcat1/tomcat2 by using > > workers.java_home=/usr/bin/java > ps=/ > worker.list=lb,jkstatus > worker.lb.type=lb > worker.lb.sticky_session=true > worker.jkstatus.type=status > worker.tomcatlb1.type=ajp13 > worker.tomcatlb1.host=172.26.19.16 > worker.tomcatlb1.port=8009 > worker.tomcatlb1.lbfactor=10 > worker.tomcatlb1.socket_timeout=120 > worker.tomcatlb1.connection_pool_size=50 > worker.tomcatlb1.type=ajp13 > worker.tomcatlb2.type=ajp13 > worker.tomcatlb2.host=172.26.19.17 > worker.tomcatlb2.port=8009 > worker.tomcatlb2.lbfactor=10 > worker.tomcatlb2.socket_timeout=120 > worker.tomcatlb2.connection_pool_size=50 > worker.lb.balance_workers=tomcatlb1,tomcatlb2 > > which is working so far. Sticky connection is absolutely neccessary due > to application "design". > (not able to take any influence here) > > This setup exists twice. One environment keeps directing the user within > one session to one tomcat like it > should, the other one does not. > > Looking at mod_jk debug output at the not working one, I can see, that > for every request mod_jk generates > a new session id: > > [Thu Oct 12 09:59:11 2006] [11822:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (514): total sessionid is > DA9D99BE9ECB77C69A3B799FC122F670 > [Thu Oct 12 09:59:11 2006] [11822:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (524): searching worker for partial > sessionid DA9D99BE9ECB77C69A3B799FC122F670 > [Thu Oct 12 09:59:11 2006] [11822:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (564): found best worker > (tomcatlb1) using by request method > [Thu Oct 12 09:59:15 2006] [11820:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (514): total sessionid is > DFAFEE609A2DFEF179D5D6B1CCF030A3 > [Thu Oct 12 09:59:15 2006] [11820:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (524): searching worker for partial > sessionid DFAFEE609A2DFEF179D5D6B1CCF030A3 > [Thu Oct 12 09:59:15 2006] [11820:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (564): found best worker > (tomcatlb2) using by request method > > These are simple reloads within one session. > > I noticed one more thing: > > This is debug output from the working environment: > > [Thu Oct 12 10:11:50 2006] [0517:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (514): total sessionid is > 0EC77EB2BBA412F4C40F6033B9AD16C4.tomcatlb1 > [Thu Oct 12 10:11:50 2006] [0517:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (524): searching worker for partial > sessionid 0EC77EB2BBA412F4C40F6033B9AD16C4.tomcatlb1 > [Thu Oct 12 10:11:50 2006] [0517:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (532): searching worker for session > route tomcatlb1 > [Thu Oct 12 10:11:50 2006] [0517:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (541): found worker tomcatlb1 for > route tomcatlb1 and partial sessionid > 0EC77EB2BBA412F4C40F6033B9AD16C4.tomcatlb1 > > This from the not working one: > > [Thu Oct 12 10:16:26 2006] [12189:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (514): total sessionid is > ADE09C3AD588F82F34E0B7C23E5F01D7 > [Thu Oct 12 10:16:26 2006] [12189:42688] [debug] > get_most_suitable_worker::jk_lb_worker.c (524): searching worker for partial > sessionid ADE09C3AD588F82F34E0B7C23E5F01D7 > > Note the difference in the generated session ids: > > > DFAFEE609A2DFEF179D5D6B1CCF030A3 > > vs. > > 0EC77EB2BBA412F4C40F6033B9AD16C4.tomcatlb1 > > ie. on the not working environment theres the ".<worker>" missing. > > But why? The two environments are identical in terms of tomcat/mod_jk > version. > > Thanks alot in advance!! > > Regards, > Daniel > > > --------------------------------------------------------------------- > 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]