You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by wl...@powersystems.rockwell.com on 2005/06/15 21:50:52 UTC

Shell command to stop and start a webapp without using the manager?

Hi all,

I'd like to know if there's a shell command to stop and start separate web 
applications. With our configuration, we are unable to use the manager.

* We are running Tomcat 5.5 and Apache 2 with the JK Connector (mod_jk) on 
RedHat Linux.
* We have several virtual hosts. When we used 1 service with multiple 
hosts, we had the problem that our different webapps were sharing the same 
memory space and they kept stepping on each other. So we split things up. 
Each host is using a separate service on a different port (see example 
below).

Example of our current configuration (server.xml) :

<Server port="8005" shutdown="SHUTDOWN" debug="0">
  <GlobalNamingResources>
    ...
  </GlobalNamingResources>

  <Service name="TEST-1">
    <Connector port="8009" redirectPort="8443" protocol="AJP/1.3" 
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" />

    <Engine name="Catalina-TEST-1" debug="0" defaultHost="localhost">
      <Logger ... />

      <Host name="www.test-1.com" appBase="webapps" ... >
         <Context path="" docBase="test-1" debug="0" reloadable="true" />
      </Host>
    </Engine>
  </Service>
 
  <Service name="TEST-2">
    <Connector port="8010" redirectPort="8443" protocol="AJP/1.3" 
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" />

    <Engine name="Catalina-TEST-2" debug="0" defaultHost="localhost">
      <Logger ... />

      <Host name="www.test-2.com" appBase="webapps" ... >
         <Context path="" docBase="test-2" debug="0" reloadable="true" />
      </Host>
    </Engine>
  </Service>

  <Service name="TEST-3">
    ...
  </Service>

</Server>


Now, when we try to use the Tomcat Manager, we see the list of web apps, 
but we cannot shut down or reload a web application. The managers says it 
is stopped, but in real life, the web application is still running.

Could it be that the manager does not support web apps on different ports? 
 If not, will it be support in the next version of Tomcat?

Thank you very much !
Wout

Re: Shell command to stop and start a webapp without using the manager?

Posted by Andre Van Klaveren <ny...@gmail.com>.
He should be able to use the manager but he'll have to run a copy of
it in each Host instance for it to work.

On 6/16/05, Marius Scurtescu <ma...@sxip.com> wrote:
> Nikola Milutinovic wrote:
> > wlbettens@powersystems.rockwell.com wrote:
> >
> >> Hi all,
> >>
> >> I'd like to know if there's a shell command to stop and start separate
> >> web applications. With our configuration, we are unable to use the
> >> manager.
> >>
> >> * We are running Tomcat 5.5 and Apache 2 with the JK Connector
> >> (mod_jk) on RedHat Linux.
> >> * We have several virtual hosts. When we used 1 service with multiple
> >> hosts, we had the problem that our different webapps were sharing the
> >> same memory space and they kept stepping on each other. So we split
> >> things up. Each host is using a separate service on a different port
> >> (see example below).
> >>
> >>
> >
> > Take a look at Ant Tomcat task. It is used to deploy new webapp from Ant
> > and Ant works from command line. I think this is your best bet. Not to
> > mention that Ant has such a wide variety of other tasks, it is a great
> > boost to your work. You might need to do some other tasks at that time
> > and Ant can help a lot. Of course, if something *is* a job for a shell
> > script, it might be better to do it a s shell script job :-)
> 
> Ant is also using the manager and Nikola says that they cannot use it
> for some reason.
> 
> Nikola, you cannot use the web interface of the manager or you cannot
> use the manager at all?
> 
> You can easily write scripts that use wget for example to remotely
> control Tomcat through the manager (no need to use the web interface in
> a browser but it has to be accessible). Have a look at:
> http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html#Supported%20Manager%20Commands
> 
> Marius
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


-- 
Virtually,
Andre Van Klaveren
Architect III, SCP
Enterprise Transformation Services
Unisys Corporation

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Shell command to stop and start a webapp without using the manager?

Posted by Marius Scurtescu <ma...@sxip.com>.
Nikola Milutinovic wrote:
> wlbettens@powersystems.rockwell.com wrote:
> 
>> Hi all,
>>
>> I'd like to know if there's a shell command to stop and start separate 
>> web applications. With our configuration, we are unable to use the 
>> manager.
>>
>> * We are running Tomcat 5.5 and Apache 2 with the JK Connector 
>> (mod_jk) on RedHat Linux.
>> * We have several virtual hosts. When we used 1 service with multiple 
>> hosts, we had the problem that our different webapps were sharing the 
>> same memory space and they kept stepping on each other. So we split 
>> things up. Each host is using a separate service on a different port 
>> (see example below).
>>  
>>
> 
> Take a look at Ant Tomcat task. It is used to deploy new webapp from Ant 
> and Ant works from command line. I think this is your best bet. Not to 
> mention that Ant has such a wide variety of other tasks, it is a great 
> boost to your work. You might need to do some other tasks at that time 
> and Ant can help a lot. Of course, if something *is* a job for a shell 
> script, it might be better to do it a s shell script job :-)

Ant is also using the manager and Nikola says that they cannot use it 
for some reason.

Nikola, you cannot use the web interface of the manager or you cannot 
use the manager at all?

You can easily write scripts that use wget for example to remotely 
control Tomcat through the manager (no need to use the web interface in 
a browser but it has to be accessible). Have a look at:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html#Supported%20Manager%20Commands

Marius


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Shell command to stop and start a webapp without using the manager?

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
wlbettens@powersystems.rockwell.com wrote:

>Hi all,
>
>I'd like to know if there's a shell command to stop and start separate web 
>applications. With our configuration, we are unable to use the manager.
>
>* We are running Tomcat 5.5 and Apache 2 with the JK Connector (mod_jk) on 
>RedHat Linux.
>* We have several virtual hosts. When we used 1 service with multiple 
>hosts, we had the problem that our different webapps were sharing the same 
>memory space and they kept stepping on each other. So we split things up. 
>Each host is using a separate service on a different port (see example 
>below).
>  
>

Take a look at Ant Tomcat task. It is used to deploy new webapp from Ant 
and Ant works from command line. I think this is your best bet. Not to 
mention that Ant has such a wide variety of other tasks, it is a great 
boost to your work. You might need to do some other tasks at that time 
and Ant can help a lot. Of course, if something *is* a job for a shell 
script, it might be better to do it a s shell script job :-)

Nix.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org