且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Tomcat上部署war而不用URL中的war名称

更新时间:2023-11-17 23:26:58

所有你需要做的是命名你的战争 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.