0

Here is the scenario:

We are using Linux, Tomcat stack and we deploy our webapp using war files. Basically the deployment process is as follows:

  • git pull latest
  • ant build
  • create war file
  • upload the war file to the server

Now everytime we have to update the code (lets assume that only front end code needs to be deployed) ... we repeat the same steps above ... however we do one additinal thing mentioned below:

There are three directories under

--webapps
   -- myapp
       -- logs
       -- upload
       -- other stuff

Before redeploying the war file we always take a backup of anything under logs and upload (these files are mission critical)

I was wondering if this step is necessary ... in other words:

  • will the content in upload and logs be overwritten by whatever is there in the war file (there is nothing since this is a fresh build)
  • or it will keep the files as it is and do a merge between the existing webapp and stuff coming from the war file

I am hoping that it is the latter

However I have never tried it, I wanted to know if someone already know the answer to this ... I can then test and verify the claim

--Jatin

1 Answer 1

0

You'll have to test it to be sure. But you certainly shouldn't store files in this location in the first place. Store them outside the tomcat webapps directory, because this directory is supposed to contain webapps, and nothing else.

2
  • what is the best practice ... accept how does people usually handle uploaded files via servlet ... and how do I serve them ... some apache tomcat mix magic??
    – jsshah
    Oct 4, 2011 at 18:47
  • Configure an external folder, and put your uploaded files there. Serve them using a dedicated servlet, or make it so that this external folder is in served by an Apache HTTP server.
    – JB Nizet
    Oct 5, 2011 at 6:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.