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

I have a Tomcat server fronted by Apache with comms using AJP. The configuration uses JkMount for mapping URLs on Apache to the Tomcat node.

I am helping in the deployment of an application which is built using Maven and therefore is delivered in the form of a file named "my-war-3.0.1.war".

We can do a JkMount declaration of the following style:

JkMount /my-war-3.0.1 my-node
JkMount /my-war-3.0.1/* my-node

But obviously that requires the version number. New releases will mean updating the mounting and the users' bookmarks etc, which obviously isn't a Good Thing.

What I would like is to be able to have the JkMount declaration in the following style:

JkMount /my-war my-node
JkMount /my-war/* my-node

But I'm pretty sure that means that the .war file needs to be named in the same way.

I'm pretty sure it's possible to tell Tomcat to deploy a specified .war under another name using Context file fragments, but all I seem to get are error messages about the war being deployed inside the AppBase.

The environment I'm working in is quite locked down - it would be a lot of testing to be able to change the environment's configuration, so deploying a Context fragment file as a kind of deliverable would be a nice solution.

Is this possible, and if so what should the Context file be and where should it go?

I am using Tomcat 6.0.14, and as I said before, the environment is pretty locked down so it would be a lot of trouble to modify Tomcat configurations/folder structures.

The other solution is of course to remove the version number from the deliverable name, which is acceptable from the point of view of the development team, but I think everyone would prefer that the deliverable had the version number in its name for the sake of clarity.

share|improve this question

1 Answer 1

The first thing comes to my mind is creating a symlink for your webapp. Whenever you change the version, just re-create a symlink.

ln -s /path/to/tomcat/webapps/my-war-3.0.1 /path/to/tomcat/webapps/my-war

And then, create a context.xml file in webapps/my-war-3.0.1/WEB-INF to enable symlinks:

<?xml version="1.0" encoding="UTF-8"?>

<Context path="/my-war" allowLinking="true">

</Context>
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.