Solved

Let Tomcat Serve Static HTML

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can I backup my incomplete website from hostgator? 3 73
Internal DNS Alias (CNAME) - two domain names to one IP address 4 85
DNS, website, godaddy 6 101
Linux Hosting 16 107
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
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…

751 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