Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

really stupid question about tomcat

Status
Not open for further replies.

jms137

Programmer
Oct 6, 2002
18
0
0
GB
hello,

boy am i gonna get flamed for this but...

I have been told (by managers) our corporate java solution is "tomcat ON apache".

So I download Tomcat 5.5.9. I install it, drop in a web app, start it up and can access my app just fine over
So Am I running tomcat on "Apache" (which I presume to mean Apache HTTP server) or am I just running the servlet container, Tomcat? If all i'm running is Tomcat then what is handling the http requests? Is there a built in web server?

d'oh.....

john
 
I expect that in this context, "Apache" does indeed mean "Apache HTTP server".

You are just running Tomcat.

Tomcat is a "servlet container that handles HTTP requests" - so basically it speaks HTTP just like "Apache" does - but can also run JSP/Servlets in order to generate dynamic content (ie create HTML on the fly) - unlike Apache which can only serve up static content (.html, .css, .js etc) files.

Tomcat can also serve up static content like Apache.

For my own website, I just run Tomcat because I can't be bothered to have Apache as the front end, and I don't have that much static content. But on heavy load sites that have lots of css, static html, images, pdfs and so on, it makes sense to run Apache as a front end to Tomcat because it is quicker at serving static content than Tomcat is.

Apache and Tomcat talk to each other (by default) on port 8009, usually via a protocol called JK, or JK2 (the infamous mod_jk and mod_jk2 Apache modules). You basically tell Apache that for certain types of files, or certain web contexts, it should pass the request on to Tomcat for processing. Once Tomcat has generated the HTML, it sends it back to Apache, which in turn sends it on to the client browser.

HTH :)

--------------------------------------------------
Free Database Connection Pooling Software
 
Thanks sedj!

That has cleared things up.

My site is not serving out *any* static content like CGI, images, HTML. It is a single servlet which does various stuff like contacting databases, running java classes to generate some HTML then return this to the requester.

The app is a corporate solution which may get hundreds of hits per second (unlikely but possible). In your opinion *should* Tomcat run via Apache? I have no idea what kind of traffic Tomcat alone can cope with, nor if Apache+Tomcat is more secure than Tomcat alone.

thanks
john
 
I persoanlly do not think that Apache is any more *secure* than Tomcat.

If you have no static content, then there is little point in running Apache - it would just slow things down.

--------------------------------------------------
Free Database Connection Pooling Software
 
yes, there seems little point in complicating things when Tomcat alone will suffice.

thanks again!

(that must surely be the fastest reply i have ever received.. 2 minutes!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top