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 ?

asked 10 Aug '11, 05:59

kaysa's gravatar image

kaysa ♦♦
3.0k51024
accept rate: 22%

edited 10 Aug '11, 05:59


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.

link

answered 10 Aug '11, 06:19

kaysa's gravatar image

kaysa ♦♦
3.0k51024
accept rate: 22%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×30
×29

Asked: 10 Aug '11, 05:59

Seen: 2,501 times

Last updated: 10 Aug '11, 06:19

powered by BitNami OSQA