Solved

Let Tomcat Serve Static HTML

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

12 Experts available now in Live!

Get 1:1 Help Now