You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yusuf <yu...@gmail.com> on 2006/09/06 10:17:02 UTC

Tomcat Manager Commands via HTTP

Hi

I have a Tomcat server running on one machine with one webapp loaded. The
webapp itself is empty,
but there's a web service deployed to its context (ie. I have Axis running
inside the webapp!).
I need to restart either the webapp or Tomcat, and my question is how do I
do that?

I'm trying to execute Tomcat manager commands via HTTP.
How would I work around the login dialog? Is it possible to specify the
username and password as well?

If it's not possible, how else could I reload a webapp from a remote
machine?
(I'm trying the above method, but I don't want the login dialog)

If that's not possible, how would I restart a Tomcat service remotely?

Thanks
-- 
View this message in context: http://www.nabble.com/Tomcat-Manager-Commands-via-HTTP-tf2225390.html#a6166739
Sent from the Tomcat - User forum 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: Tomcat Manager Commands via HTTP

Posted by David Smith <dn...@cornell.edu>.
There are a lot of command line tools that can send the basic auth
headers expected by the manager.  Curl and wget come to mind.  You could
also use a java program with the commons httpclient project easily enough.

You could send the url in a browser address bar easily enough as well,
although you'll be promted for credentials.

See http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html for
details on sending commands to the manager webapp.

--David

Yusuf wrote:

>Thanks for your reply Mark
>
>Would that be possible by entering a url in a browser address bar?
>
>Or should I use something like Jakarta's HTTPClient or some such API?
>
>Thanks
>
>
>Mark Thomas-11 wrote:
>  
>
>>Yusuf wrote:
>>    
>>
>>>Hi
>>>
>>>I have a Tomcat server running on one machine with one webapp loaded. The
>>>webapp itself is empty,
>>>but there's a web service deployed to its context (ie. I have Axis
>>>running
>>>inside the webapp!).
>>>I need to restart either the webapp or Tomcat, and my question is how do
>>>I
>>>do that?
>>>      
>>>
>>You need to send an appropriately formatted authorization header along
>>with your request.
>>
>>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
>>
>>
>>
>>    
>>
>
>  
>


-- 
=======================================
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture & Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


---------------------------------------------------------------------
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: Tomcat Manager Commands via HTTP

Posted by Yusuf <yu...@gmail.com>.
Thanks for your reply Mark

Would that be possible by entering a url in a browser address bar?

Or should I use something like Jakarta's HTTPClient or some such API?

Thanks


Mark Thomas-11 wrote:
> 
> Yusuf wrote:
>> Hi
>> 
>> I have a Tomcat server running on one machine with one webapp loaded. The
>> webapp itself is empty,
>> but there's a web service deployed to its context (ie. I have Axis
>> running
>> inside the webapp!).
>> I need to restart either the webapp or Tomcat, and my question is how do
>> I
>> do that?
> 
> You need to send an appropriately formatted authorization header along
> with your request.
> 
> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-Manager-Commands-via-HTTP-tf2225390.html#a6169795
Sent from the Tomcat - User forum 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: Tomcat Manager Commands via HTTP

Posted by Mark Thomas <ma...@apache.org>.
Yusuf wrote:
> Hi
> 
> I have a Tomcat server running on one machine with one webapp loaded. The
> webapp itself is empty,
> but there's a web service deployed to its context (ie. I have Axis running
> inside the webapp!).
> I need to restart either the webapp or Tomcat, and my question is how do I
> do that?

You need to send an appropriately formatted authorization header along
with your request.

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: Tomcat Manager Commands via HTTP

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
Yusuf wrote:
> I have a Tomcat server running on one machine with one webapp loaded. The
> webapp itself is empty,
> but there's a web service deployed to its context (ie. I have Axis running
> inside the webapp!).
> I need to restart either the webapp or Tomcat, and my question is how do I
> do that?
>   
To make specific HTTP request you can use any command line tool (i.e. 
wget, curl) or using API (jakarta-httpclient).

You can use ant task (tomcat-deployer).

And also, after enabling JMX you can directly talk to target tomcat's 
mbeans and restart the app.

-- 
Mikolaj Rydzewski      <mi...@ceti.pl>        http://ceti.pl/~miki/
                    PGP KeyID: 8b12ab02
There are three kinds of people: men, women and unix.