2

What are the primary benefits of running Apache httpd in front of Tomcat?

Are the benefits worth the extra setup and complexity?

3 Answers 3

1

Apache offers a full and extensive suite of modules, which support URL rewriting, accessing other tools (SVN, PL/SQL, 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 applications.

I make use of Tomcat with Apache to make use of the Apache toolset and configurability while running individual applications in Tomcat behind Apache. This makes it easy to do things like URL aliases (I never release an application 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 can then be bounced individually of the full set of sites/applications supported, minimising downtime and disruption.

1
  • 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, 2011 at 19:52
0

Apache is ridiculously better at serving static assets (like images, stylesheets, JavaScript code, 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.

1
  • 1
    Is it faster even if the images are stored within the java web app?
    – Anonymous
    May 25, 2011 at 19:45
0

Other than servicing static files, another primary reason why people deploy Apache in from of Tomcats is to have a load balance of web traffic.

Please check: Using Apache HTTP Server 2.x with mod_proxy

1
  • The link seems to be half-broken (it is not really clear where to go after reading that one paragraph). Sep 1, 2017 at 19:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .