Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We would like to configure Tomcat in the following way (where X -SL-> Y represents a symlink named X pointing to a path Y):

  • CATALINA_HOME/webapps -SL-> /var/data/nas/deploymentconfiguration_a
  • /var/data/nas/deploymentconfiguration_a/myapp.war -SL-> /var/data/nas/wars/app1.war

The idea is to be able to configure which applications are deployed on a particular Tomcat instance by having a series of symlinks to WARs in a deployment configuration folder, and having anoher symlink named webapps from CATALINA_HOME to a particular deployment configuration folder.

Many Tomcat instances would point to the same deployment configuration folder.

I hope that's clear :S

The whole /var/data/nas tree would be read-only.

In trials, the main problem we are running up against is that Tomcat is obviously trying to explode the war into the deployment configuration folder (which it considers to be appBase), which is read only.

Is there a way to get Tomcat to unpack its wars into some kind of local work folder (I don't think there is, based upon a quick scan through the source code), or is the only way to proceed to stop Tomcat from exploding the war files in the first place?

We are using Tomcat 6.


We are going to be running multiple Tomcat instances against the same configuration. So there could be 10 Tomcats running against deploymentconfiguration_a and 10 against deploymentconfiguration_b, but there could be some commonality between the actual WAR files in each deployment configuration (ie deploymentconfiguration_a could have WARs 1, 2 and 5 while deploymentconfiguration_b could have WARs 1, 5 and 7).

The reason it is RO is to avoid accidental modification of a particular configuration, and also to avoid one instance of Tomcat treading on the toes of another.

share|improve this question
Can you describe a bit more your Tomcat "instances"? Are you running multiple Tomcats against a given set of files? Or are there multiple Tomcats running multiple different apps on from your NAS? And why does it have to be R/O? – Corey S. Nov 22 '10 at 15:40
Would having multiple <Host> declarations with different appBase attributes help alleviate the problem? – Corey S. Nov 22 '10 at 15:51
Also, is there a reason you are running multiple Tomcat instead of having one Tomcat with multiple <Service> entries? – Corey S. Nov 22 '10 at 15:52
re: the question about running multiple Tomcat vs multiple <Service> entries, not all Tomcat instances are on the same hardware. – Rich Nov 22 '10 at 16:05
re: multiple <Host> declarations, we are trying to standardise the configuration of the Tomcat instances so that we only have to create the correct symlink in order to correctly deploy a new Tomcat instance. Perhaps we could symlink to the correct configuration file? – Rich Nov 22 '10 at 16:07
up vote 1 down vote accepted

Based on what you've given me (and thanks for batting back and forth with me). I think these are your options:

  1. Insert a unpackWars="false" into the Host directive within your server.xml file and run the apps directly from the war files.
  2. Manually expand the wars on your nas into the proper deployment directories.

I give either of those recommendations only based on the fact that the file system where these deployments are going would be read only for the Tomcats involved.

I would personally go with option #1. Unless you need to see the individual files for some reason, there's no good reason to run with the files expanded. (Unless of course you've got a bad application that needs to reference files within the war...)

I might also go so far as to also put autoDeploy="off". Unless you think you are going to be changing the war files underneath these groups of Tomcats on the spot?

share|improve this answer

Your Answer


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.