Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You can use the jar utility that comes with java.

cd into the webapp folder and run the following:

jar cvf ../mywebapp.war *

share|improve this answer
    
I assume that backslash needs to be a slash, as it's very much not Windows. –  Bill Cole Nov 15 '12 at 14:44
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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