2

Problem: I have a working webapp on a FreeBSD 8.1 Tomcat 6 test server that I need to move to a production system. The developer who last touched it (and had root on that server) has moved on and isn't helpful. The running app seems to have been deployed from a CVS server that is now unavailable.

My thinking is that I would like to find a way to wrap the working webapp into a proper .war so that I can deploy it on a pristine host and (after testing) send the existing system to a very deep bitbucket. But I'm not having luck finding a way to do that.

I'm a sysadmin not a developer and don't work much with Tomcat systems so I may be (likely am) overlooking something blindingly simple. I gather that I may be able to just tar up the deployed directory and untar it on the new machine, but I have a nagging feeling that there are pitfalls in that.

Bill Cole
  • 385
  • 1
  • 8

1 Answers1

2

You can use the jar utility that comes with java.

cd into the webapp folder and run the following:

jar cvf ../mywebapp.war *

Jason Floyd
  • 1,672
  • 1
  • 13
  • 17
  • Also: I'm still standing up the new host so I can't say "this worked," but it is very helpful to know that a warfile (warball?) is a jarfile of the webapp with no top-level directory. – Bill Cole Nov 15 '12 at 14:51
  • 2
    Worked like a dream. Dropped the .war in the webapps directory on a new system and Tomcat unpacked it without complaint. – Bill Cole Nov 15 '12 at 21:18