Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

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>
    
share|improve this answer

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

share|improve this answer
    
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 2 '11 at 13:36

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.