Solved

Let Tomcat Serve Static HTML

Posted on 2007-04-11
4
943 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
  • 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

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Join & Write a Comment

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now