I currently have Apache httpd running on a production Ubuntu VPS server. I write php scripts.

I'm interested in learning Java and I was wondering how I would go about writing some server-side Java to work on my current set-up.

How are Apache Tomcat and Apache HTTP Server related to each other?

Can Tomcat be a module of httpd?

Or are they simply just two very different projects that happen to be steered by the same organisation (Apache Software Foundation)?

  • 5
    Or are they simply just two very different projects that happen to be steered by the same organisation? - They are – Mchl Jan 8 '11 at 17:48
  • @Mchl, They are very similar too. – Pacerier Jan 19 '15 at 6:47

In general, the Apache HTTP server is just a plain old web server designed to serve static web pages. There are plenty of modules which can be installed to enhance Apache's abilities so that it can serve dynamic webpages using various technologies such as PHP, CGI or whatever, but the core of Apache is just a plain old HTTP server.

Tomcat, on the other hand, is specifically designed from the ground-up to serve as a Java Servlet engine. It's primary purpose is to implement the Java Servlet API and execute Java servlets for the purpose of building dynamic websites. Tomcat can also be used as a regular HTTP server that serves static pages, but that is not its primary purpose. (Also, Tomcat is allegedly slower than Apache httpd when it comes to serving static pages.)

The two technologies can be used together through a connector module called mod_jk. This will allow you to use the Apache HTTP server to serve regular static webpages, and the Tomcat Servlet engine to execute servlets.

  • Can we say that when one downloads Tomcat s/he downloads a Web Server like Apache Httpd (but not exactly this) AND a Servlet Container which is simply a java application? – Koray Tugay Nov 25 '14 at 18:22
  • @Charles, Why is Tomcat slower than Apache? – Pacerier Jan 19 '15 at 6:48
  • @Pacerier - he said "allegedly", because while people widely believe this, in reality it isn't true. – Jules May 2 '16 at 7:07
  • @KorayTugay not exactly, no. Tomcat is just a servlet container. It happens to come supplied with a default servlet that implements a static web server. You couldn't separate out the web server component without the servlet container. – Jules May 2 '16 at 7:15

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