It's not a secret anymore!
The moose likes Tomcat and the fly likes Start/Shutdown Tomcat Remotely? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Start/Shutdown Tomcat Remotely?" Watch "Start/Shutdown Tomcat Remotely?" New topic

Start/Shutdown Tomcat Remotely?

K Riaz
Ranch Hand

Joined: Jan 08, 2005
Posts: 375
Is it possible to execute the start and shutdown batch files remotely from a local machine (Client: Win2k, Server: Windows Server 2003)? It seems like a simple thing to do, but I cannot find a way to do it in Windows.

Or will I need to build a little socket-based client-server application so a client can send the server a message to execute certain batch files?

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

You could do it with a WSF. Windows Script Host allows remote procedure calls. Check out MSDN and the WSHController object.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
I have found another useful way to accomplish this. If you have installed Tomcat as a Windows service, then you can easily call that service from a remote pc. This way you will not have to run startup.bat and shutdown.bat. If you did not install Tomcat as a service, uninstall it and then go download it from the Apache site again. Then you can choose the option to install it as a service (you will have to download the .exe version from the Apache site).

Once it is installed as a Windows service, then you can access that service by following these steps:
1. On the remote pc, open up the 'Administrative Tools' and then navigate to 'Services'.
2. In the left hand pane, right click on 'Services'. Choose 'Connect to another computer ...'. Enter in the host pc's ip address.
3. Once you have connected you will see the list of services on the host pc. To start and stop (or restart at once), just right click on the Apache Tomcat service.

Note: You may have to enable remote service sharing on the host pc.

Let me know if you have any more questions!
I agree. Here's the link:
subject: Start/Shutdown Tomcat Remotely?
It's not a secret anymore!