The purpose is to:
- connect to a remote server maybe via host: ip , port: 8181
- stop Tomcat that’s running on that server
- deploy a .war file
- restart Tomcat
Underneath are few approaches I have taken so far to achieve this task:
Approaches taken so far:
I have looked at the following solutions but none of them worked for me:
- http://www.linuxquestions.org/questions/linux-newbie-8/start-tomcat-server-remotely-824472/ –Not efficient
- http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Start_an_Existing_Application
- http://raibledesigns.com/wiki/Wiki.jsp?page=TomcatAntTasks
–only start/stop application not the actual tomcat itself - http://cargo.codehaus.org/Remote+Container
— Which does’t start/stop tomcat that’s running on that server
If you have ssh access to the server, then you might like to consider the JSch library which you can use in combination with SSHExec Ant Task to start and stop your server: