aspose file tools*
The moose likes Tomcat and the fly likes Apache/Tomcat Integration Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache/Tomcat Integration Question" Watch "Apache/Tomcat Integration Question" New topic
Author

Apache/Tomcat Integration Question

Scott Updike
Ranch Hand

Joined: Feb 16, 2006
Posts: 92
I'm fairly new to setting up web servers and integrating with web containers and have a couple of really dumb questions:

1) If I have an application that is entriely servlet/jsp based, why would I need to have Apache in addition to Tomcat? I know Tomcat is a container, but it also serves the servlets (including the compiled jsps) without Apache. What are some high level reasons for deploying a servlet based app within the apache/tomcat framework and not just tomcat? I assume there are security concerns that tomcat may not address that are taken care of in apache??
2) Assuming you have integrated apache with tomcat, if one deploys their web application within the webapp directory structure in tomcat (per the instructions), then wouldn't all the web traffic URLs be "tomcat specific" and not use the "apache specific" URLs?

Just trying to figure out what Apache gives you that Tomcat doesn't when it comes to deploying a 100% servlet-based application to the web.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

In the past, Tomcat (and Java) were slow at serving up files when compared with Apache HTTPD (which is written in C). For this reason, production apps were deployed in Apache HTTPD with a connector used to pass only servlet and JSP requests to Tomcat.

Both Tomcat and Java itself have made great strides in performance since then and it makes more sense (to me anyway) to test Tomcat as a standalone before getting mired down in connector configuration. Tomcat can also handle SSL, which was another reason for fronting with httpd in the past.

There are still cases where combining the two makes sense.
If your app includes Perl or PHP scripts, for example httpd will definitely handle those better. Also, if your app serves up large (very large) amounts of static data files you might see a significant performance boost by configuring httpd to serve them up while passing requests for dynamic data back to Tomcat.

Try working with Tomcat as a standalone first.
If you feel that your app is not performing as well as it should, look at all the options available to you; including fronting with httpd.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Also, Tomcat now gives you the option of integrating the Apache Portable Runtime component (which is at the heart of Apache HTTPD)

See:
http://tomcat.apache.org/tomcat-5.5-doc/apr.html
Scott Updike
Ranch Hand

Joined: Feb 16, 2006
Posts: 92
Great. Thanks for the quick response. That confirms my suspicions.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache/Tomcat Integration Question