Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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.

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

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
Is it faster even if the images are stored within the java web app? – Anonymous May 25 '11 at 19:45

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:

share|improve this answer

Your Answer


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.