What are the primary benefits of running apache httpd in front of tomcat? Are the benefits worth the extra setup and complexity?
|
feedback
|
migrated from stackoverflow.com May 25 '11 at 20:42
This question came from our site for professional and enthusiast programmers.
|
Apache offers a full and extensive suite of modules, which support URL rewiting, accessing other tools (SVN, PLSQL, etc, etc) and hosts of other good stuff. Apache offers easy proxying, supports load balancing, etc. Tomcat is a light, easy to use environment in which to run Java based apps. I make use of Tomcat with Apache to make use of the Apache toolset and configurablity while running indiviual apps in Tomcat behind Apache. This make it easy to do things like URL aliases (I never release an app with the server name in the URL, but always use an alias, then when moving servers the URL remains the same and bookmarks, etc don't break. This is very helpful, for example 3-4 years after go-live when during server migrations). Each Tomcat instance than be bounced individually of the full set of sites/apps supported minimising downtime and disruption. | |||
feedback
|
|
Apache is ridiculously better at serving static assets (like images, stylesheets, javascripts, etc.) than tomcat. Most people have apache be the main service provider while passing the processing of the dynamic pages down to tomcat to do. | |||
feedback
|
|
Other than service static file another primary reason why people deploy Apache in from of Tomcats is to have a load balance of web traffic. Please check: http://tomcat.apache.org/tomcat-6.0-doc/balancer-howto.html#Using_Apache_HTTP_Server_2.x_with_mod_proxy | |||
|
feedback
|