Contact
1) Apache and Tomcat are Web network servers
2) Apache is an ordinary server, natively support HTML is a normal Web page, can be supported via plug-in PHP can also be connected with Tomcat (Apache one-way connection tomcat, which means that Apache can access tomcat resources, Tomcat cannot access Apache resources)
3) Apache only supports static Web pages, but dynamic Web pages like asp,jsp,php,cgi need Tomcat to handle
4) Apache and Tomcat are independent of each other and can be integrated on the same server
5) Apache and Tomcat can be integrated using
If the client requests a static Web page, only the Apache server response is required;
If the client requests a dynamic page, the Tomcat server responds to the request, parses the page code such as the JSP, and then passes it back to the Apache server, which is returned to the browser by Apache.
This is because the JSP is the server-side interpretation code, tomcat only do dynamic code parsing, Apache callback parsing good static code, apache+tomcat such integration can reduce the service cost of Tomcat. Difference
Apache is a C language implementation, supporting a variety of features and modules to extend the core functions, Tomcat is written in Java, better support servlet and JSP.
1, Apache is a Web server, Web server delivery (serves) page allows the browser to browse, the Web server specifically handles HTTP requests (request), but the application server is through a number of protocols to provide (serves) business logic to the application ( 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 also translated into a servlet) container that can be considered an Apache extension, but can be run independently of Apache.
2, Apache is a normal server, itself only support HTML static ordinary Web page. However, you can support PHP via plugins, and you can connect with Tomcat (one-way Apache connection Tomcat, which means that Tomcat resources can be accessed via Apache, or vice versa), and Tomcat is a jsp/servlet container, and also supports HTML, JSP, ASP, PHP, CGI, and so on, where CGI requires some manual debugging, but very easy.
3, Apache focuses on the HTTP Server,tomcat focus on the servlet engine, if run in standalone (standalone) mode, the function of Tomcat and Apache equivalent support JSP, but the static Web page is not ideal.
4, Apache can run a year without restarting, stability is very good, and Tomcat is not necessarily.
5, the preferred Web server is Apache, but Apache can not parse the JSP, servlet only with Tomcat.
6, Apache is the very beginning of the page parsing services, Tomcat is developed after, in essence, the function of Tomcat can completely replace Apache, but Apache is the predecessor of Tomcat, and there are many people in the market are still using Apache, So Apache will continue to exist, will not be replaced, Apache can not parse Java things, but parsing HTML fast.
Reference website
Apache and Tomcat