How Do You Find the Default Directory for Tomcat when It Acts as a Web Server?

Problem scenario
Your Tomcat server is has been configured to serve as a web server. You have access to the back-end Linux server. But you do not know what directory corresponds with the URL of the host. How do you find what the default directory is for files that are presented on the web?

From the back-end, run this: sudo find / -name index.html | grep tomcat

Look for a WEB-INF or webapps directory. See if there are subdirectories after one of these directories until the index.html file (e.g., /var/lib/tomcat9/webapps/foo/index.html ).

Leave a comment

Your email address will not be published. Required fields are marked *