Note: Transfer from http://blog.csdn.net/longzs/article/details/10959945
Often in Apache and Tomcat and so on these servers, but the total feeling still do not know what the relationship between them, when using Tomcat always appear Apache, always confused, who is the Lord who is the time, so deliberately on the Internet to check some of this information, summed up: a
Apache supports static pages, and Tomcat supports dynamic, such as Servlets,
For general use of Apache+tomcat, Apache is just a forwarding, and the processing of JSPs is handled by Tomcat.
Apache can support Php\cgi\perl, but to use Java, you need Tomcat to support Apache in the background and transfer Java requests from Apache to Tomcat processing.
Apache is a Web server, Tomcat is an application (Java) server, it is just a servlet (JSP also translated into a servlet) container, can be considered an Apache extension, but can be run independently of Apache.
These two can be compared in the following points: 1, both are the Apache organization developed 2, both have the HTTP service function 3, both are free
Different points:
Apache is dedicated to providing HTTP services, and related configuration (such as virtual host, URL forwarding, etc.)
Tomcat is a JSP server developed by Apache in accordance with the Java EE JSP and servlet standards.
Two:
Apache is a Web server environment program enabled he can use as a Web server but only support static web pages such as (asp,php,cgi,jsp) Dynamic Web page is not
If you want to run the JSP in the Apache environment, you need an interpreter to execute the JSP Web page and this JSP interpreter is Tomcat, why do you want the JDK? Because the JSP needs to connect to the database.
The JDK is required to provide the drive to connect to the database, so the Web server platform to run the JSP needs to APACHE+TOMCAT+JDK
The benefits of consolidation are:
If the client requests a static page, only the Apache server responds to the request if the client requests a dynamic page, then the Tomcat server responds to the request
Because JSP is a server-side interpretation code, consolidation can reduce the service overhead of Tomcat
Three:
Apache: Focus on HTTP Server
Tomcat: Focus on the servlet engine, if run in standalone mode, functionally equivalent to Apache, support JSP, but not ideal for static web pages;
Apache is a Web server, Tomcat is an application (Java) server, it is just a servlet (JSP also translated into a servlet) container, can be considered an Apache extension, but can be run independently of Apache. In other words, Apache is a truck that can be loaded with something like HTML. But you can't put water, you have to have a container (a bucket) to fill it, and this bucket is not on the truck.
What is the relationship and difference between Apache and Tomcat?