Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What are the primary benefits of running apache httpd in front of tomcat? Are the benefits worth the extra setup and complexity?

share|improve this question

migrated from stackoverflow.com May 25 '11 at 20:42

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers 3

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.

share|improve this answer
    
Thanks, it seems for my use I may want to start with just tomcat, and then add httpd down the road if needed. From what I've read tomcat 6 actually is faster than tomcat 6 + apache httpd for serving even static files. –  Anonymous May 25 '11 at 19:52
add comment

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.

share|improve this answer
1  
Is it faster even if the images are stored within the java web app? –  Anonymous May 25 '11 at 19:45
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.