Search code examples
apachetomcatwebserver

When to Use Apache vs. Apache+Tomcat?


Since simply using Apache can be enough to run many Web applications, when and why do people also use Tomcat in addition to Apache?


Solution

  • Apache Tomcat is a webserver and Java servlet container in one, while Apache HTTPD is just a plain webserver (often with only PHP support). They use Apache Tomcat when they want be able to run Java/JSP/Servlet. It can be added to an existing Apache HTTPD / PHP setup. Or the other way round, they bring Apache HTTPD in front of Apache Tomcat to be able to have a "This site is in maintenance" page when Tomcat is been shutdown for some upgrade/maintenance.

    For communication between Apache HTTPD and Apache Tomcat, the Tomcat Connector is usually been used. It's also known as mod_jk.