0

I am trying to serve my website www.mywebsite.com using tomcat.

I am not using apache and using tomcat as my webserver only. I have defaulted port to 80 and currently I have mywebsite.war lying in webapps folder. When I start tomcat, mywebsite unzips and gets deployed to a folder named mywebsite in webapps only.

The problem I am facing is that when I try to access my site as www.mywebsite.com , it opens tomcat welcome page not my website [which is understandable s some issue in my configuration].

To access my website, I have to type the sub-folder name as well. That means, I use www.mywebsite.com/mywebsite/welcome.html to access my web site.

Could some one please guide me about how can I serve my website from www.mywebsite.com only ?

What extra configuration will I have to do here?

3

2 Answers 2

2

When tomcat receive a request, it tries to understand what webapps is responsible for it. The way it assign request to webapp is checking the context, i.e., the first part of the url path. Since your webapps have a context of mywebsite, then it only gets requests that start with path /mywebsite/. When tomcat does not find a suitable web apps, it defaults to the ROOT context.

So, in order to catch all such requests, you should name your webapp as ROOT (or probably just change its context to ROOT), or install a different webapps on the ROOT context that redirect to your current URL.

0

What you are trying to do, is to load your application as "ROOT context". To do that you have two easy choices :

  1. Put your files directly in place of Tomcat defaults files (/webapps/ROOT/here), replacing webapps/ROOT/WEB-INF/web.xml, etc.
  2. Renaming your war to ROOT.war and putting it inside /webapps/ROOT.war

I also recommand removing all default Tomcat files in this directory.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .