Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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)?

share|improve this question
2  
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

1 Answer 1

up vote 25 down vote accepted

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.

share|improve this answer
    
a really good, thorough, answer. thanks. –  JW01 Jan 8 '11 at 18:24
    
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 2 days ago

Your Answer

 
discard

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.