tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Crowther <>
Subject RE: Why we need two servers (httpd and tomcat)
Date Mon, 27 Apr 2009 15:29:38 GMT
> From: Vinay Nagrik []
> Can someone explain to me the basic difference between httpd
> and tomacat serer.  What one can do so the other can not do.

Apache httpd can serve static content over HTTP.  It can have modules plugged in (CGI, perl,
PHP) to serve various kinds of dynamic content.  It has many modules, and very flexible configuration
options.  It is written in C and needs to be compiled for each platform.  It cannot serve
Java servlet content; for that you need a Java servlet container, which you can connect to
it in various ways.

Apache Tomcat is a Java servlet specification-compliant servlet container.  It can serve static
content over HTTP.  It has built-in facilities for serving Java servlets, and requires no
modules to do this.  It has relatively few modules, and some configuration has to be done
in code where Apache httpd allows configuration through files.  It is written in Java, and
portable to any platform able to run a (sensible) Java virtual machine.  It can be connected
to Apache httpd in various ways so that httpd can appear to serve servlet content.

> And why do we need these two servers in the first place.

Because httpd doesn't serve Java servlets (and Tomcat doesn't serve perl and PHP efficiently,
though it's pretty good at static content).  Even if httpd did everything, someone would write
a "pure Java" web server and servlet container, because Java developers are like that :-).

                - Peter

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message