在 Tomcat 上部署战争,URL 中没有战争名称 [英] Deploy war on Tomcat without the war name in the URL

查看:23
本文介绍了在 Tomcat 上部署战争,URL 中没有战争名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建了一个名为 myapp.war 的 war 文件并将其部署在 Tomcat 上.我已将端口从 8080 更改为 80,因此我可以在 example.com/myapp(其中 example.com 是我的主机).

I built a war file called myapp.war and deployed it on Tomcat. I've changed the port from 8080 to 80 so I can then get to it at example.com/myapp (where example.com is my host).

如何配置应用程序,以便在我转到 example.com 时显示我的应用程序?我不想只是从 example.com 重定向到 example.com/myapp - 我不想在网址.
我是否必须设置 Apache 来为这样的页面提供服务,还是可以在 Tomcat 配置中使用虚拟主机来完成?

How can I get configure the application so that when I go to example.com, it shows my app? I don't want to just redirect from example.com to example.com/myapp - I don't want to have myapp in the URL.
Do I have to set up Apache to serve the pages like this, or can I do it with a virtual host in the Tomcat configuration?

推荐答案

您所需要做的就是为您的战争命名 ROOT.war.

All you need to do is name your war ROOT.war.

这篇关于在 Tomcat 上部署战争,URL 中没有战争名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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