Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Start/Shutdown Tomcat Remotely?

 
K Riaz
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Thanks,
Kashif.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could do it with a WSF. Windows Script Host allows remote procedure calls. Check out MSDN and the WSHController object.
 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic