1

Is there a recommended method of sharing static content such as PDF documents among two Tomcat instances running on the same server?

Background: I want to migrate our app server from a single instance of Tomcat to two instances, using mod_jk, so we can update WAR files on one while the other continues to serve users (note: this is a single server and not a true cluster).

The issue we're encountering is how to ensure the ROOT webapp in both instances is pointing users to the same static content such as PDF files. We've looked at using 'allowLinking' along with a symlink pointing both ROOT webapps to a shared content directory.

But some folks advise against using allowLinking for security reasons. In addition, I've read that deleting/updating the WAR file will also delete the content on the symlink, which defeats the purpose of a having a single repository of static content outside the scope of the webapp/Tomcat instance.

  • Do you have to serve the static content via tomcat or can you have a subdomain such as static.example.com which holds and serves the static content? – Robb Feb 15 '11 at 16:07
  • @Robb Apologies for the delay; I'm not getting emails from StackOverflow so I didn't realize a reply had been posted. The static content doesn't need to be delivered by Tomcat, although it would be uploaded by Tomcat and put into the shared static subdomain folder. I think I see how your suggestion would work (and not require allowLinking to be turned on). Thanks,Steve – Steve Lopez Apr 07 '11 at 20:01

0 Answers0