How to deploy multiple applications in tomcat with the same port and change in context?

允我心安 提交于 2020-07-10 07:36:41

问题


I want to deploy multiple web applications in my tomcat 8.5 server with the same port and different application context. So far by putting all the war in the Webapps directory, I am able to achieve that. Now the use case is one of those application needs to be deployed on 80 port while others will be on 8080 port.

So the set looks like:

http://x.x.x.x:8080/xyz

http://x.x.x.x:8080/abc

http://x.x.x.x:8080/foo

http://x.x.x.x/bar

Now there is a link in /xyz application which redirects to /bar application and these two should share the session between them, otherwise, the link in /xyz application is redirecting to login page.

My query is whether I need to configure anything at tomcat level in order to achieve that. Note that my applications are built on top of Spring MVC


回答1:


Use context docbase as mentioned below

<Context docBase="/your/path/app1" 
      path="/app1" reloadable="true" />


<Context docBase="/your/path/app2" 
      path="/app2" reloadable="true" />


来源:https://stackoverflow.com/questions/47089198/how-to-deploy-multiple-applications-in-tomcat-with-the-same-port-and-change-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!