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

27,620

Solution 1

Solved! http://wiki.eclipse.org/WTP_Tomcat_FAQ#If_I_start_my_Tomcat_server_and_try_to_display_Tomcat.27s_default_page.2C_why_do_I_see_a_directory_listing_or_404_error_page.3F

Solution 2

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.

Share:
27,620
Tony R
Author by

Tony R

Updated on July 09, 2022

Comments

  • Tony R
    Tony R almost 2 years

    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.

  • evandrix
    evandrix over 13 years
    Yes, forgot to add, about the default tomcat index page.
  • Tony R
    Tony R over 13 years
    Maybe I should've mentioned I'm using Eclipse, so I don't have an explicit webapps folder - I have a dynamic web project and a Servers project.
  • evandrix
    evandrix over 13 years
    Oh I see, well you still have to somehow link Eclipse to your Tomcat folder right, to run the server and view your webapp and all, cause after all Eclipse is just a Java IDE (really amazing and powerful one though but yes)
  • Tony R
    Tony R over 13 years
    I tried putting an index.html in my Tomcat installation webapps folder, but it didn't work. This is problematic anyway, since my Eclipse project is on SVN and I would have to add the pages in Tomcat's webapps folder to my repo - not very elegant.
  • Mike Shultz
    Mike Shultz about 9 years
    Symlinking ROOT to your webapp's folder does a great job and adds a little bit more flexibility.