You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2007/09/04 09:36:06 UTC

an easier way to deploy war file?

Hi,

I use Tomcat 5.5, I installed it in an ubuntu, I have to start it as root
with startup.sh. to deplay a war file during development I have to do
following:

1. ftp to my home directory
2. ssh to the host as root, shutdown.sh
3. delete the program directory under webapps
4. copy war file from my home directory to webapps/
5. start again tomcat server.

any easy way to do this? Thanks.

A.C.
-- 
View this message in context: http://www.nabble.com/an-easier-way-to-deploy-war-file--tf4376062.html#a12473298
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by Juha Laiho <Ju...@iki.fi>.
Angelo Chen wrote:
> I use Tomcat 5.5, I installed it in an ubuntu, I have to start it as root
> with startup.sh. to deplay a war file during development I have to do
> following:
> 
> 1. ftp to my home directory
> 2. ssh to the host as root, shutdown.sh
> 3. delete the program directory under webapps
> 4. copy war file from my home directory to webapps/
> 5. start again tomcat server.
> 
> any easy way to do this? Thanks.


The Tomcat manager app simplifies this significantly.

Take a look, and check whether you can use it:
http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html

-- 
..Juha

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Gregor,

Thanks, i tried this, it works, sometimes I can see the updated program
immediately, but sometimes I got all those 404 errors, I have to wait for a
few minutes before I can see the updates reflected, any idea? how to reflect
changes asap? Thanks.



Gregor Schneider wrote:
> 
> - *never* start tomcat as root: create a user "tomcat" if not already
> existing and run tomcat with that user-id
> 
> - if it's not a production-server with very high security, grant
> ftp-access to user "tomcat"
> 
> - from your local pc, ftp to your ubuntu, login as user "tomcat"
> 
> - change to directory "www/webapps"
> 
> - put your web-app.war
> 
> that's it
> 
> be sure that autodeploy is set to true. having done so, there's no
> need to delete any directories on your ubuntu-server
> 
> cheers
> 
> gregor
> 
> ps: before starting tomcat as user tomcat, you might have to issue
> 
> chown -R tomcat:tomcat * in $CATALINA_HOME
> -- 
> w
> 

-- 
View this message in context: http://www.nabble.com/an-easier-way-to-deploy-war-file--tf4376062.html#a12490683
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by Lionel Crine <lc...@linagora.com>.


Peter Stavrinides a écrit :
> 
> If you set up Tomcat correctly, and place all your jars in the correct 
> places you can hot deploy the war without a restart. This works over 
> plain http, you don't even need access to the server, all you need is a 
> password for the manager (it's better to use a database realm).
> 
> There are many ways to secure the manager in production, the simplest is 
> to remove the manager.xml and host-manager.xml files from the 
> $CATALINA_BASE/conf/Catalina/localhost/ directory, or if your 
> configuration permits allow the manager url to resolve only on the 
> internal network, this is a typical scenario if tomcat is left to run on 
> a secure port.
> 

If you do that and want to use the manager again, you should replace 
those files ?
If so, I'll be really annoying to do that.


For my part, I did a deployment shell to do all the gregor's action 
(because my servers are on DMZ).

Last thing, the less applications are deployed the faster the server is.
That is also why I don't use the manager.




> cheers
> Peter
> 
> 
> 
> is to make the manager URL resolve
> 
> Gregor Schneider wrote:
>> - *never* start tomcat as root: create a user "tomcat" if not already
>> existing and run tomcat with that user-id
>>
>> - if it's not a production-server with very high security, grant
>> ftp-access to user "tomcat"
>>
>> - from your local pc, ftp to your ubuntu, login as user "tomcat"
>>
>> - change to directory "www/webapps"
>>
>> - put your web-app.war
>>
>> that's it
>>
>> be sure that autodeploy is set to true. having done so, there's no
>> need to delete any directories on your ubuntu-server
>>
>> cheers
>>
>> gregor
>>
>> ps: before starting tomcat as user tomcat, you might have to issue
>>
>> chown -R tomcat:tomcat * in $CATALINA_HOME
>>   
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by Peter Stavrinides <p....@albourne.com>.
If you set up Tomcat correctly, and place all your jars in the correct 
places you can hot deploy the war without a restart. This works over 
plain http, you don't even need access to the server, all you need is a 
password for the manager (it's better to use a database realm).

There are many ways to secure the manager in production, the simplest is 
to remove the manager.xml and host-manager.xml files from the 
$CATALINA_BASE/conf/Catalina/localhost/ directory, or if your 
configuration permits allow the manager url to resolve only on the 
internal network, this is a typical scenario if tomcat is left to run on 
a secure port.

cheers
Peter 




 is to make the manager URL resolve

Gregor Schneider wrote:
> - *never* start tomcat as root: create a user "tomcat" if not already
> existing and run tomcat with that user-id
>
> - if it's not a production-server with very high security, grant
> ftp-access to user "tomcat"
>
> - from your local pc, ftp to your ubuntu, login as user "tomcat"
>
> - change to directory "www/webapps"
>
> - put your web-app.war
>
> that's it
>
> be sure that autodeploy is set to true. having done so, there's no
> need to delete any directories on your ubuntu-server
>
> cheers
>
> gregor
>
> ps: before starting tomcat as user tomcat, you might have to issue
>
> chown -R tomcat:tomcat * in $CATALINA_HOME
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by Gregor Schneider <rc...@googlemail.com>.
- *never* start tomcat as root: create a user "tomcat" if not already
existing and run tomcat with that user-id

- if it's not a production-server with very high security, grant
ftp-access to user "tomcat"

- from your local pc, ftp to your ubuntu, login as user "tomcat"

- change to directory "www/webapps"

- put your web-app.war

that's it

be sure that autodeploy is set to true. having done so, there's no
need to delete any directories on your ubuntu-server

cheers

gregor

ps: before starting tomcat as user tomcat, you might have to issue

chown -R tomcat:tomcat * in $CATALINA_HOME
-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by Yannick Haudry <yh...@gmail.com>.
Hi,

maybe there is a better way, but at least I guess you can use Ant to
automate all that in one task.

Yannick

On 9/4/07, Angelo Chen <an...@yahoo.com.hk> wrote:
>
> Hi,
>
> I use Tomcat 5.5, I installed it in an ubuntu, I have to start it as root
> with startup.sh. to deplay a war file during development I have to do
> following:
>
> 1. ftp to my home directory
> 2. ssh to the host as root, shutdown.sh
> 3. delete the program directory under webapps
> 4. copy war file from my home directory to webapps/
> 5. start again tomcat server.
>
> any easy way to do this? Thanks.
>
> A.C.
> --
> View this message in context: http://www.nabble.com/an-easier-way-to-deploy-war-file--tf4376062.html#a12473298
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by Mark Thomas <ma...@apache.org>.
David Smith wrote:
> But doesn't that still unpack the wars to the work directory or
> something similar?  I was under the impression it always unpacked the
> wars for performance reasons -- just not always in the webapps directory.

I'd need to check the code but AFAIR it only does that it you use one
of the anti-locking attributes.

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by David Smith <dn...@cornell.edu>.
But doesn't that still unpack the wars to the work directory or 
something similar?  I was under the impression it always unpacked the 
wars for performance reasons -- just not always in the webapps directory.

--David

Mark Thomas wrote:

>David Smith wrote:
>  
>
>>No.  Tomcat will create a directory either in webapps or in the work
>>directory depending on settings, but it will expand the war file
>>regardless.
>>    
>>
>
>Not always the case. This only happens if unpackWARs on the host is
>set to true (the default)
>
>Mark
>
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by Mark Thomas <ma...@apache.org>.
David Smith wrote:
> No.  Tomcat will create a directory either in webapps or in the work
> directory depending on settings, but it will expand the war file
> regardless.

Not always the case. This only happens if unpackWARs on the host is
set to true (the default)

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by David Smith <dn...@cornell.edu>.
No.  Tomcat will create a directory either in webapps or in the work 
directory depending on settings, but it will expand the war file 
regardless.  You wouldn't want tomcat to attempt to run your webapp 
archived anyway -- performance would suffer horribly.

--David

Angelo Chen wrote:
> Hi,
>
> Can war file be deployed without creating a directory, I meant, tomcat can
> just use the WAR file without creating a directory?
>
> Thanks,
>
> A.C.
>
>
> samk-2 wrote:
>   
>> See Thread at: http://www.techienuggets.com/Detail?tx=11882 Posted on
>> behalf of a User
>>
>> Even when you hot or auto-deploy the war file the previous version has to
>> be replaces by extracting content from the new war file. There will be a
>> pause with 404 errors if you hit the URL while the deployment is taking
>> place. As far as I know there's no instant way of doing this.
>>
>>
>> In Response To: 
>>
>>
>>     
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: an easier way to deploy war file?

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

Can war file be deployed without creating a directory, I meant, tomcat can
just use the WAR file without creating a directory?

Thanks,

A.C.


samk-2 wrote:
> 
> See Thread at: http://www.techienuggets.com/Detail?tx=11882 Posted on
> behalf of a User
> 
> Even when you hot or auto-deploy the war file the previous version has to
> be replaces by extracting content from the new war file. There will be a
> pause with 404 errors if you hit the URL while the deployment is taking
> place. As far as I know there's no instant way of doing this.
> 
> 
> In Response To: 
> 
> 

-- 
View this message in context: http://www.nabble.com/an-easier-way-to-deploy-war-file--tf4376062.html#a12491811
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org