Solved

Let Tomcat Serve Static HTML

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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