You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Aryeh Friedman <ar...@gmail.com> on 2017/09/12 01:00:41 UTC
How to prevent tomcat from deleting a webapp on restart
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
Re: How to prevent tomcat from deleting a webapp on restart
Posted by "James H. H. Lampert" <ja...@touchtonecorp.com>.
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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: How to prevent tomcat from deleting a webapp on restart
Posted by Olaf Kock <to...@olafkock.de>.
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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org