0

We have an internet app called X which is being replaced by a new app called Y.

We use Tomcat instances fronted by Apache to serve X and Y, with communications through mod_jk. There is one Tomcat hosting X and another hosting Y.

X and Y have been installed on our production servers - X is being used by our clients, while Y is going through final testing:

JkMount /x loadbalancer-x
JkMount /x/* loadbalancer-x
JkMount /y loadbalancer-y
JkMount /y/* loadbalancer-y

(let's ignore the security-through-obscurity aspect of this!)

When the time comes for Y to go into production, is there a way to map the old URL to the new application, so that www.mysite.com/x would point to the new application instead of the old one.

Rich
  • 1,343
  • 7
  • 28
  • 39

3 Answers3

1

It would work if there was an application called x deployed on loadbalancer-y. That's the problem - the new app as a different name, but the bosses want the URL to stay the same. I'm trying to find a way to tell JKMount to request application Y when the URL X us requested.

This is the reason why the Context element exist.

  1. Pointing /x URL prefix to the new worker loadbalancer-y:

    JkMount /x loadbalancer-y
    
  2. Assuming that the new app's name is newname, create a Context in your <Host> element, something like this:

    <Host name="your.domain.name"  appBase="webapps"
                unpackWARs="true" autoDeploy="true"
                xmlValidation="false" xmlNamespaceAware="false">
        <Context path="/x" docBase="newname"/>
    </Host>
    
quanta
  • 51,413
  • 19
  • 159
  • 217
0

Just pointing JkMount /x loadbalancer-y wouldn't work?

mahnsc
  • 1,796
  • 13
  • 11
  • It would work if there was an application called x deployed on loadbalancer-y. That's the problem - the new app as a different name, but the bosses want the URL to stay the same. I'm trying to find a way to tell JKMount to request application Y when the URL X us requested. – Rich Sep 02 '11 at 13:36
0

Rather than globally JkMount'ing it, why not create a /x directory entry in httpd and just JkMount loadbalancer-y, then point loadbalancer-y at the actual application rather than the tomcat root.

Decado
  • 1,949
  • 11
  • 17