在 Tomcat 的根目录部署我的应用程序 [英] Deploying my application at the root in Tomcat

查看:25
本文介绍了在 Tomcat 的根目录部署我的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的应用程序的 war 文件.我需要在根级别部署它.当前 URL 为 http://localhost:8080/war_name/application_name.

I have the war file of my application. I need to deploy this at the root level. The current URL is http://localhost:8080/war_name/application_name.

推荐答案

您有几个选择:

  1. 从 tomcat 中删除开箱即用的 ROOT/ 目录,并在部署之前将您的 war 文件重命名为 ROOT.war.

  1. Remove the out-of-the-box ROOT/ directory from tomcat and rename your war file to ROOT.war before deploying it.

将您的战争部署为(根据您的示例)war_name.war 并配置 context rootconf/server.xml 中使用你的战争文件:

Deploy your war as (from your example) war_name.war and configure the context root in conf/server.xml to use your war file :

<Context path="" docBase="war_name" debug="0" reloadable="true"></Context>

第一个更容易,但有点笨拙.第二种可能是更优雅的方式.

The first one is easier, but a little more kludgy. The second one is probably the more elegant way to do it.

这篇关于在 Tomcat 的根目录部署我的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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