在Tomcat上部署war而不用URL中的war名称 [英] Deploy war on Tomcat without the war name in the URL

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

问题描述

我建立一个名为myapp.war的战争文件,并将其部署在Tomcat上。我将端口从8080改为80,所以我可以在example.com/myapp(其中example.com是我的主机)。如何配置应用程序,所以当我去example.com,它显示我的应用程序?我不想只是从example.com重定向到example.com/myapp - 我不想在URL中使用myapp。我必须设置Apache来为这些页面提供服务,还是可以在Tomcat配置中使用虚拟主机?

解决方案

所有你需要做的是命名你的战争 ROOT.war


I build a war file called myapp.war and deploy 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). How can I get configure the application so 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 the 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?

解决方案

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

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

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