How to prevent tomcat from deleting a webapp on restart

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to prevent tomcat from deleting a webapp on restart

Aryeh Friedman
I have setup a webapp (main app) that is uploaded with a war file and
second one ("images") that is just a dir in the webapp dir, no war file.
Sometimes (not always) on tomcat restart/system reboot images gets
deleted.   How can I prevent this.

--
Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
Reply | Threaded
Open this post in threaded view
|

Re: How to prevent tomcat from deleting a webapp on restart

Olaf Kock
On 12.09.2017 03:00, Aryeh Friedman wrote:
> I have setup a webapp (main app) that is uploaded with a war file and
> second one ("images") that is just a dir in the webapp dir, no war file.
> Sometimes (not always) on tomcat restart/system reboot images gets
> deleted.   How can I prevent this.
That's easy: You just don't assume that you're patching your WAR file:
Anything that you're deploying as web application comes from one source.
If you need an extra image directory, have it outside of your website.
This also gives you a clue that you'll have to cater for a backup of
anything outside of your webapps directory - assuming that you can
rebuild your webapps any time from source.

You might want to provide a DownloadServlet in order to access those
files. This also saves you from the attack vector of someone uploading
files ending in ".jsp", that might be used for
server-side-code-execution attacks if you're having them handled the
same way any files in your webapp directory are handled by tomcat.

Olaf

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to prevent tomcat from deleting a webapp on restart

James H. H. Lampert
In reply to this post by Aryeh Friedman
On 9/11/17, 6:00 PM, Aryeh Friedman wrote:
> I have setup a webapp (main app) that is uploaded with a war file and
> second one ("images") that is just a dir in the webapp dir, no war file.
> Sometimes (not always) on tomcat restart/system reboot images gets
> deleted.   How can I prevent this.
>
Disable auto-deploy.

We learned that a long time ago, as our webapp product communicates with
a proprietary server running -- like the Tomcat server -- on a
customer-owned box (which may or may not be the same one running
Tomcat), and may or may not be listening on the port the webapp expects
it to be listening on, thus requiring post-deployment settings changes.

--
JHHL

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]