Solved

Let Tomcat Serve Static HTML

Posted on 2007-04-11
4
959 Views
Last Modified: 2009-07-29
I have a web server and it is running a Tomcat servlet application (the terminology escapes me, lol!)

So I don't want to mess around and break Tomcat, because that will break my email.
But I want to be able to serve up static webpages directly through Tomcat.  I have tried the HOWTO on the Apache site about letting Apache serve up HTML and Tomcat serve Servlet stuff, but I don't think I've ever been so lost!!  lol!

So, I don't care that Tomcat is a little slower serving HTML, it's only a few users.  How do I get Tomcat to serve static HTML pages?  And what config files do I need to edit and where does the static content go?

Thank you!
0
Comment
Question by:dougp23
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 13

Expert Comment

by:R7AF
ID: 18892323
Just shut down Apache HTTPD, edit server.xml in the conf-directory of tomcat and search for 8080. Change that to 80, restart Tomcat, and Tomcat serves HTML pages as well. We do this all the time!
0
 
LVL 13

Expert Comment

by:R7AF
ID: 18892515
Or, you don't even have to change the port number. You can probably let your firewall forward traffic for port 80 to port 8080 on your webserver.
0
 
LVL 1

Author Comment

by:dougp23
ID: 18897270
And where would my document root be?
This Tomcat install is feeding a web based email to people, so I don't want to break that.
Thanks.
0
 
LVL 13

Accepted Solution

by:
R7AF earned 500 total points
ID: 18900383
You can put html, css, js, images, flash, etc in the same directory as the jsp files.

Just be careful when using index.html next to index.jsp files. In WEB-INF/web.xml you can set which one has preference. So if you have a file /website/home/index.html next to /website/home/index.jsp, and the user browses to /website/home/, then it's not certain which file is served.
0

Featured Post

Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question