tomcat - 在 Tomcat 虚拟主机上使用 `ant install`

标签 tomcat ant installation manager-app

我想使用 ant install 在本地虚拟主机上部署(以及重新部署和重新部署)我的 webapp。

它在默认主机上工作正常,但虚拟主机没有 manager webapp。我想在实时环境中使用类似的设置(给定主机上没有管理器)。

我找到了一个promisiong属性:

webapp.virtual.host=...

在某些示例中 build.properties,但它似乎无法完成工作。这甚至可能吗?如何实现?

最佳答案

在我的answer对于一篇 SO 帖子,Christian Semrau 评论道:

In standard configuration, Tomcat monitors its webapps folder and deploys any webapp for which you copy a .war file into the webapps folder, and undeploys it if you remove the .war file, and re-deploys it when you change the .war file. But when doing that, you don't get automatic feedback about the success of a deployment, which you do get from the Tomcat Manager.

也就是说,您的任务变得像 copying or removing the file on the remote server 一样简单.

然而,我仍然不明白为什么拥有管理器应用程序是个问题。例如,您可以只将它部署在不同的主机/端口上:

<Connector port="8080" address="main.ip.add.ress">
  ...
  <Context path="/your_main_context">
  ...
  </Context>
</Connector>

<Connector port="18080" address="another.ip.add.ress">
  ...
  <Context path="/manager">
  ...
  </Context>
</Connector>

并设置相关的防火墙限制。或者,您也可以放置

<Valve className="org.apache.catalina.valves.RemoteHostValve"
     allow=".*\.mycompany\.com|www\.yourcompany\.com"/>      

Context 中并获得类似的结果。

关于tomcat - 在 Tomcat 虚拟主机上使用 `ant install`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5746057/

相关文章:

android - 在 Windows 上手动安装 Android SDK 4.1 时,我应该在哪里提取 armeabi-v7a 存档?

maven 安装错误,无法对特定的 maven 项目/模块执行任何 maven 操作

python - 安装 Anaconda3 时的问题

java - tomcat 7 无法从 eclipse 中启动

java - 如何在我的 Java 代码中使用 Apache Ant 的任务

ant - Gradle failOnError用于默认ant任务

java - 如何在 checkstyle 中编写自定义检查?

在 Windows 7 64 位上使用 Java 32 位的 Eclipse 32 位

java - Apache 客户端缓存 jar

java - 为什么在每个 session 可能有并发请求的情况下不应该使用 Tomcat 的 PersistentValve?