|
By default Tomcat applications run at http://example.com/application. How can I configure my application to run in the root URL http://example.com ? |
|
In a standard Tomcat installation the applications are placed under the webapps directory and served in http://example.com/application. The easier way of making you application be served in http://example.com is deleting the tomcat_home_directory/webapps/ROOT directory and rename your application.war as tomcat_home_directory>/webapps/ROOT.war. Then restart tomcat. However you can find alternative ways of getting the same result, please check Tomcat documentation. The recommendation in Tomcat 6 and later (see Context documentation) is to create a ROOT.xml file in tomcat_home_direcoty/conf/<engine name="">/<host name=""> (in a local environment it would be tomcat_home_directory/conf/Catalina/localhost). Please notice that some applications may required additional configuration but this would depend on the application itself. |