Tomcat在同一端口下运行两个Web模块 [英] Tomcat running two web modules under same port
问题描述
我是网络应用程序的新手。我已经在tomcat7中运行了web应用程序。我想在同一个端口上运行其他Web应用程序,但可能是不同的URL。
例如。
I am newbie to web application. I already have web application running in tomcat7. I want to run other web app on same port but probably different URLs. For eg.
http:// localhost:8080 / - >默认情况下转到app1
http:// localhost:8080 / app2
http://localhost:8080/ --> goes to app1 by default http://localhost:8080/app2
我怎么能在tomcat7中做到这一点?
How can I do that in tomcat7?
推荐答案
如果你将app1的战争重命名为ROOT.war和app2的战争作为app2.war,Tomcat会将theese部署到你想要的地方。
你也可以在server.xml文件中配置它。
If you rename your app1's war as ROOT.war and app2's war as app2.war, Tomcat will deploy theese exactly where you want. You can also configure it in the server.xml file.
查看这篇文章了解详情:如何在Tomcat 7.0中设置Web应用程序的上下文路径
Check out this post for details: How to set the context path of a web application in Tomcat 7.0
这篇关于Tomcat在同一端口下运行两个Web模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!