This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.
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.