How to get httpd to forward to multiple tomcats for different urls, including / ?
Posted
by
Nick Foote
on Pro Webmasters
See other posts from Pro Webmasters
or by Nick Foote
Published on 2011-03-11T09:35:33Z
Indexed on
2011/03/11
16:19 UTC
Read the original article
Hit count: 285
Ok
So I've got multiple tomcat instances setup on several AJP ports, I also have Apache httpd listening on port 8090 (cos I've got another app already using 8080 at the moment).
I've successfully mapped urls such as mydomain.com:8090/demo and mydomain.com:8090/preprod to their respective tomcat instances using Jk Mount and the following vhosts config;
<VirtualHost *:8090>
JkMount /preprod* preprod
JkMount /demo* demo
</VirtualHost>
But I also want the "root" address to map to another tomcat instance, what will become live/production, ie I want mydomain.com:8090/ to map a 3rd tomcat instance.
At the moment nothing happens or changes if I just add to the above config a line;
JkMount /* rootwar
if I browse to mydomain.com:8090 I just get the same boring apache httpd landing page letting me know its running (ie index.html in httpd/htdocs)
Is it possible to use JkMount to redirect the "root" address stuff to a tomcat instance?
I can see that a rule like /* will also match URLs like mydomain.com/preprod but I was hoping the rules are applied in order so if /* appears at the end it effectively would be a "if its not one of the other environments, then direct to root/production"
Just to be clear I'm trying to setup the following;
mydomain.com:8090/preprod --> myApp running in tomcat1
mydomain.com:8090/demo --> myApp running in tomcat2
mydomain.com:8090 --> myApp running in tomcat3
© Pro Webmasters or respective owner