Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between the Apache HTTP Server and Apache Tomcat? [closed]

What is the difference in terms of functionality between the Apache HTTP Server and Apache Tomcat?

I know that Tomcat is written in Java and the HTTP Server is in C, but other than that I do not really know how they are distinguished. Do they have different functionality?

like image 813
kaybenleroll Avatar asked Aug 27 '08 16:08

kaybenleroll


People also ask

Does Apache Tomcat use Apache HTTP Server?

Tomcat is primarily an application server, which serves requests to custom-built Java servlets or JSP files on your server. It is usually used in conjunction with the Apache HTTP server (at least in my experience).

What is the difference between Tomcat Apache Web server and IIS server?

IIS (Internet Information Services) is a web server developed by Microsoft and a good choice for most people who are already comfortable with using Windows. Tomcat is another server, but it isn't meant to process HTML documents, it is intended to run Java and JSP applications.

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.


2 Answers

Apache Tomcat is used to deploy your Java Servlets and JSPs. So in your Java project you can build your WAR (short for Web ARchive) file, and just drop it in the deploy directory in Tomcat.

So basically Apache is an HTTP Server, serving HTTP. Tomcat is a Servlet and JSP Server serving Java technologies.

Tomcat includes Catalina, which is a servlet container. A servlet, at the end, is a Java class. JSP files (which are similar to PHP, and older ASP files) are generated into Java code (HttpServlet), which is then compiled to .class files by the server and executed by the Java virtual machine.

like image 126
Bernie Perez Avatar answered Sep 20 '22 09:09

Bernie Perez


In addition to the fine answers above, I think it should be said that Tomcat has it's own HTTP server built into it, and is fully functional at serving static content too. Depending on your java virtual machine configuration it can actually outperform going through traditional connectors in apache such as mod_proxy and mod_jk.

That said a fully optimized Tomcat server should serve static files fast and if you have Java servlets, JSPs and ColdFusion files in addition to static content you may find tomcat does an excellent job by itself.

like image 21
ethyreal Avatar answered Sep 21 '22 09:09

ethyreal