如何连接到远程服务器,并启动/停止的使用Ant特定的服务器上运行的Tomcat? [英] How to connect to remote server and start/stop the Tomcat that's running on that particular server using Ant?

查看:258
本文介绍了如何连接到远程服务器,并启动/停止的使用Ant特定的服务器上运行的Tomcat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的目的是:

  1:通过主机连接可能到远程服务器:IP,端口:8181
2:停止的服务器上运行的Tomcat
3:部署.war文件
4:重新启动Tomcat


解决方案

我相信 Tomcat文档 和管理Tomcat的提供了关于如何停止给定应用的一些信息,但不服务器完全是:

 < JMX:调用
    NAME =卡塔利娜:类型=经理,PATH = /的servlet-例子,主机=本地主机
    操作=停止/>

如果你有服务器的SSH访问权限,那么你可能要考虑,你可以结合使用 JSch库 SSHExec Ant任务的启动和停止服务器:

 < sshexec主机=,某
    用户名=花花公子
    密码=哟
    命令=/等/ init.d下/ tomcat的重启/>

The purpose is to:

1: connect to a remote server maybe via host: ip , port: 8181
2: stop Tomcat that's running on that server 
3: deploy a .war file 
4: restart tomcat 

解决方案

I believe Tomcat Documentation under Monitoring and Managing Tomcat offers some information on how to stop a given application, but not the server entirely:

<jmx:invoke
    name="Catalina:type=Manager,path=/servlets-examples,host=localhost" 
    operation="stop"/>

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:

<sshexec host="somehost"
    username="dude"
    password="yo"
    command="/etc/init.d/tomcat restart"/>

这篇关于如何连接到远程服务器,并启动/停止的使用Ant特定的服务器上运行的Tomcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆