Java EE Development of various types of resources download list, the history of the most complete IT resources, click to enter.
Apache and Tomcat are Web servers, both linked and different, in the HTML, PHP, JSP, Perl and other development process, need to grasp their respective characteristics, choose the best server configuration.
Apache is a Web server (static parsing, such as HTML), Tomcat is a Java application server (dynamic parsing, such as JSP, PHP)
Tomcat is just a servlet (JSP translates into a servlet) container that can be considered an Apache extension, but can be run independently of Apache
The two can be compared from the following points:
1, both are developed by the Apache organization
2, both have the function of HTTP service
3, both are open source for free
Contact
1 Apache is a common server, itself only support HTML is ordinary Web page, you can support PHP through Plug-ins, but also with Tomcat connectivity (Apache one-way connection tomcat, that is, through Apache can access Tomcat resources, otherwise).
2 Apache only supports static Web pages, but dynamic Web pages like ASP, JSP, PHP, CGI and so on need Tomcat to handle.
3 Apache and Tomcat consolidation use: If the client is requesting a static page, only the Apache server responds to the request;
If the client requests a dynamic page, it is the Tomcat server response request, will parse the JSP and so on the page code parse back to the Apache server, and then return to the Apache browser end
This is because the JSP is the server-side interpretation code, tomcat only do dynamic code parsing, Apache return parse good static code, apache+tomcat such integration can reduce Tomcat service overhead.
4 Apache and Tomcat are independent and can be integrated on the same server.
difference between
Apache is implemented in C language, supporting a variety of features and modules to extend core functionality; Tomcat is written in Java and better supports servlet and JSP.
1, Apache is a Web server, the Web server Transfer (serves) page allows browsers to browse, Web servers specialize in HTTP requests, but the application server provides (serves) business logic for the application through many protocols ( Business logic).
Tomcat is an application server running on Apache, and the application server provides a method (methods) that the client application can invoke (call). It is just a servlet (JSP translates into a servlet) container that can be considered an Apache extension, but can be run independently of Apache.
2, Apache is a normal server, and it only supports HTML static plain Web pages. However, you can support PHP through Plug-ins, but also with Tomcat connectivity (one-way Apache connection Tomcat, that is, through Apache can access Tomcat resources, otherwise), Tomcat is the Jsp/servlet container, but also support HTML, JSP, ASP, PHP, CGI, and so on, CGI requires some manual debugging, but it's easy.
3, Apache focuses on the HTTP Server,tomcat focus on the servlet engine, which, if run in standalone mode, is functionally tomcat-equivalent in support of Apache, but not ideal for static web pages.
4, Apache can run for a year without reboot, stability is very good, and Tomcat is not necessarily.
5, the preferred Web server is Apache, but Apache can not resolve the JSP, servlet only with Tomcat.
6, Apache is very much the beginning of the page parsing service, Tomcat is developed after, in essence, Tomcat function can completely replace Apache, but Apache is Tomcat after all, and many people are still in the market with Apache, So Apache will continue to exist, will not be replaced, Apache can not parse Java things, but parsing html faster.
Two examples:
Apache is a car, which can be loaded with some things such as HTML, but not the water, to fill the water must have a container (bucket), and this bucket can not be placed on the truck, the bucket is tomcat.
Integration of the two:
Apache is a Web server environment program that enables it to be used as a Web server but only static Web pages are supported, and dynamic Web pages are not supported, such as ASP, JSP, PHP, CGI
If you want to run the JSP in the Apache environment, you need an interpreter to execute the JSP Web page, and the JSP interpreter is Tomcat
Then why do we need the JDK? Because the JSP needs to connect the database to the JDK to provide the drive to connect the database, so to run the JSP Web server platform requires APACHE+TOMCAT+JDK
Benefits of Consolidation:
If the client requests a static page, only the Apache server responds to the request
If the client requests a dynamic page, the Tomcat server responds to the request
Because the JSP is the server-side interpreter, this consolidation can reduce Tomcat's service overhead
Reference recommendation:
Tomcat vs Apache
The difference between Apache and Tomcat
Apache and Tomcat Differences
Ubuntu Configuration Apache
Ubuntu Configuration Tomcat
Tomcat and Apache Consolidated Configuration Guide