Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a welcome page from Tomcat root, rather than webapp context?

In Tomcat 7, I want my welcome page (index.html) to load when I access localhost:8080/. Right now, I have to go to the webapp context, localhost:8080/MyWebApp.

Is there a folder in Tomcat to place pages that are not part of a webapp? I'm confused how this works...

EDIT: I notice that the web.xml for the Server in Eclipse has a servlet called "default" which is mapped to "/"... I wonder if I have to change something here?

EDIT2: I found this: http://wiki.apache.org/tomcat/HowTo#How_do_I_override_the_default_home_page_loaded_by_Tomcat.3F

But, I already have an index.html in my ROOT folder, and still getting 404 from the root URL. If I start the server without using Eclipse, it works. What's going on here? What exactly does Eclipse do when you start the server through it? Obviously it's not reproducing the ROOT folder of my installation.

like image 206
Tony R Avatar asked Nov 14 '22 03:11

Tony R


1 Answers

You are missing ROOT folder from 'webapps' - maybe it was deleted during installation of the other app. ROOT folder has config files for 'Welcome' page for tomcat. You can copy it from the other tar file into ../webapps folder and you'll be good.

like image 60
efg Avatar answered Jan 01 '23 11:01

efg