You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Ward <cw...@horizon-asset.co.uk> on 2004/09/29 19:27:13 UTC

WAR file deployment snag - any suggestions?

Hi,

I've just started to use ANT to build my webapp and then deploy
it to Tomcat as a WAR file (using the catalina-ant.jar stuff).

Only having to "release" one file is great, but I've hit a problem
of my own making.  My webapp writes various XML files to datestamped
dir within the webapp <context>. When I deploy the WAR file I purge
all these generated files.

Anyone out there have any suggestions?

Should I use a different <context> to hold my data?  

Would it be better to be running Apache as well as Tomcat?

Best regards
Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: WAR file deployment snag - any suggestions?

Posted by QM <qm...@brandxdev.net>.
On Wed, Sep 29, 2004 at 06:27:13PM +0100, Chris Ward wrote:
: Only having to "release" one file is great, but I've hit a problem
: of my own making.  My webapp writes various XML files to datestamped
: dir within the webapp <context>. When I deploy the WAR file I purge
: all these generated files.
:  [snip]
: Should I use a different <context> to hold my data?

That's one option; but another (likely more scalable) idea would be to
put files in a filesystem, where they belong.

The idea is to setup a directory outside of the Tomcat context path --
specify it in a properties file, or in a context param, whatever -- and
write the data there.

As the system grows to support multiple Tomcat instances spread across
different machines, you could share the filesystem via NFS (not pretty,
but it works), stuff the docs in a database (not pretty, but it works),
or have the mid-tier Tomcat instances push the data to another, internal
Tomcat setup that writes the files to a clustered/RAID'd fs.

.... etc, etc, depending on how valuable these docs are and how much
this app grows.

By not writing to your context, you can wrap everything up in a WAR file
and, better still, gain (a little) more security by making the WAR file
owned and served by two different user accounts.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org