You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If my project name is 'test', when I deploy the web project to Tomcat, it can only be accessed via http://localhost:8080/test. How can I change the 'test' context to the root path '/'?
Remove the out-of-the-box ROOT/ directory from tomcat and rename your war file to ROOT.war before deploying it.
Deploy your war as (from your example) war_name.war and configure the [context root](https://tomcat.apache.org/tomcat-8.0-doc/config/context.html) in conf/server.xml to use your war file :
<Context path="" docBase="war_name" debug="0" reloadable="true"></Context>
The first one is easier, but a little more kludgy. The second one is probably the more elegant way to do it.
Activity
jjaychen1e commentedon Jan 23, 2025
Same question here
heliusjing commentedon Apr 11, 2025
I would like to know too
robstryker commentedon Apr 17, 2025
You have a couple of options:
The first one is easier, but a little more kludgy. The second one is probably the more elegant way to do it.
https://stackoverflow.com/questions/5328518/deploying-my-application-at-the-root-in-tomcat