Tomcat Web App Deployment Danger

I'm still on the Tomcat learning curve and I'm trying to figure out the best way of deploying my apps. I just recently learned about the separation between CATALINA_HOME and CATALINA_BASE which I think is pretty great, as I currently am working on both my personal weblog projects and the stuff at work as well. By having two separate directories for that stuff, I can simply change the environment variable and I'm good to go.

But I'm a bit torn about how to deploy my web apps: as .war files, or uploaded individual files. If you define a webapp directory and throw a .war file in there along with a context.xml file, the container will automagically expand and install that .war . That's pretty cool and convenient - especially if you want to automate the process in the future. However, if you replace the .war file, it doesn't update the web app, it *replaces* it. Oof. That scares the crap out of me.

On my personal site (this one) I have a bunch of crud that I'm constantly throwing up online. Photos, zip files, other download stuff, etc. Also, I do quick tweaks as well - to the .jsp pages or to the web.xml or global.properties or the CSS or something. Maybe this is *baaaaad* from an uptight control-freak code-monkey point of view, but I know from doing this for a few years that it's usually the most practical and inevitable form of changing stuff in a jam. And honestly, I'm confused about where to put all those static files if they're not within the web app directory. It's not like I'm going to add 650MB of photos that's currently in my photo album to my .war archive...

So, again, I'm looking to move to using .wars, yet I'm not comfortable at all with auto-deploy and confused about how to manage static files. I think you can turn off auto-deploy in the webapp (it's an option in the XML I've seen), but then I'm not sure what benefit even creating a .war is? Do I upload and unpack manually after that? What about the static files? How do professional deployments manage all this?

Any thoughts would be great,

-Russ

< Previous         Next >