Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 668
Genadinik Avatar asked Mar 19 '11 06:03

Genadinik


People also ask

What is difference between Apache Tomcat and Apache?

Key difference between Tomcat and the Apache HTTP Server the Apache HTTP Server, but the fundamental difference is that Tomcat provides dynamic content by employing Java-based logic, while the Apache web server's primary purpose is to simply serve up static content such as HTML, images, audio and text.

Do I need both Apache and Tomcat?

Yes, you need both apache and tomcat installed, but you can configure apache to redirect (transparently for the user) all JSP requests to tomcat using AJP protocol.

What is Apache and Tomcat used for?

Apache Tomcat, also known as Tomcat Server, proves to be a popular choice for web developers building and maintaining dynamic websites and applications based on the Java software platform. It's reportedly called 'Tomcat' web server because the founder saw it as an animal that could take care of and fend for itself.

Is Tomcat part of Apache?

Apache Tomcat server: Apache Tomcat is a web container. It allows the users to run Servlet and JAVA Server Pages that are based on the web-applications. It can be used as the HTTP server. The performance of the Tomcat server is not as good as the designated web server.


2 Answers

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.

like image 120
BalusC Avatar answered Sep 21 '22 16:09

BalusC


Maybe too late to answer.

"Apache" is the name of a foundation that write open-source software. Apache HTTPD is a web server written in portable C (when people say "Apache", they usually mean Apache HTTPD.) It mostly serves static content by itself, but there are many add-on modules (some of which come with Apache itself) that let it modify the content and also serve dynamic content written in Perl, PHP, Python, Ruby, or other languages.

Tomcat is primarily a servlet/JSP container. It's written in Java. It can serve static content, too, but its main purpose is to host servlets and JSPs. Although it's possible to get Tomcat to run Perl scripts and the like, you wouldn't use Tomcat unless most of your content was Java.

It's actually possible to use both Apache and Tomcat together, so that Apache serves the static content, and Tomcat the Servlets and JSPs. Depending on various factors, this may or may not be a good idea.

like image 36
Lokesh Agrawal Avatar answered Sep 19 '22 16:09

Lokesh Agrawal