The Apache HTTP server is a modular server that runs on almost any widely used computer platform. It belongs to the application server. Apache support module support, stable performance, Apache itself is static analysis, suitable for static HTML, pictures, but can support dynamic pages through extended scripts, modules and so on. (Apche can support PHPcgiperl, but to use Java, you need Tomcat behind the scenes at Apache, which forwards Java requests to Tomcat.) Disadvantages: The configuration is complex and does not support dynamic pages. 2. Tomcat: Tomcat is an application (Java) server, which is just a Servlet container that can be considered an extension of Apache, but can run independently of Apache. Nginx is a very lightweight HTTP server written by the Russians. Nginx, pronounced “Engine X”, is a high-performance HTTP and reverse proxy server as well as an IMAP/POP3/SMTP proxy server. Apache and Tomcat are similar in comparison: l both are developed by Apache organization l both have HTTP service functions L Both are free differences: L Apache is specifically used to provide HTTP services and related configuration (such as virtual hosting, URL forwarding, etc.), Tomcat is Apache organization in accordance with Java EE JSP, Servlet standards under the development of a JSP server Apache is a Web server environment program, enable he can be used as a Web server, but only support static Web pages such as (ASP,PHP,CGI,JSP) dynamic Web pages are not. To run JSP pages in an Apache environment, you need an interpreter to execute JSP pages, and that JSP interpreter is Tomcat. Apache: focuses on HTTPServer, Tomcat: focuses on Servlet engine. If run in a Standalone manner, it is functionally equivalent to Apache and supports JSP, but is not ideal for static web pages. Apache is a Web server, Tomcat is an application (Java) server, it is just a Servlet container, can be considered as an extension of Apache, but can run independently of Apache. In practice, Apache and Tomcat are often used together: l If the client requests a static page, only the Apache server needs to respond to the request. L If the client requests a dynamic page, the Tomcat server responds to the request. Because JSP interprets the code on the server side, consolidation can reduce Tomcat’s service overhead. You can understand that Tomcat is an extension of Apache. 1) The advantages of Nginx compared to Apache l lightweight, also a Web service, less memory and resources than Apache L anti-concurrency, Nginx processing requests is asynchronous non-blocking, while Apache is blocking, Under high concurrency, nginx can maintain low resource consumption and high performance. L Highly modular design, relatively simple to write modules. L Provides load balancing. 2) Apache vs. Nginx (rewrite vs. Nginx) L Support dynamic pages; L Support many modules, basically covering all applications; L Stable performance, while nginx is relatively buggy. 3) The advantages and disadvantages of Nginx configuration is simple, Apache complex; L Nginx static processing performance is more than 3 times higher than Apache; L Apache support for PHP is relatively simple, Nginx needs to work with other backend; Apache has more components than Nginx; L Apache is a synchronous multi-process model, one connection for one process; Nginx is asynchronous and multiple connections (ten thousand levels) can correspond to one process; L Nginx handles static files well and consumes less memory; Dynamic requests are done by Apache, nginx is only suitable for static and reverse; L Nginx is suitable for front-end server, load performance is very good; L Nginx itself is a reverse proxy server and supports load balancing 3. Summary l Nginx advantages: load balancing, reverse proxy, static file processing advantages. Nginx handles static requests faster than Apache; Apache advantage: Processing static files is its advantage over Tomcat server, it is fast. Apache is static parsing, suitable for static HTML, images, etc. L Tomcat: dynamic parsing container, processing dynamic requests, is a container for compiling JSP\Servlet, Nginx has dynamic separation mechanism, static requests can be directly processed by Nginx, dynamic requests are forwarded to the background by Tomcat for processing. Apache has an advantage when it comes to handling dynamics, Nginx concurrency, low CPU footprint, and if rewrite is a lot, Apache is better for it. Reverse proxy: In Reverse Proxy mode, a Proxy server receives Internet connection requests, forwards the requests to the Intranet server, and returns the results to the Internet client. In this case, the Proxy server acts as a server externally. Copyright notice: This article is the blogger’s original article, shall not be reproduced without the permission of the blogger. Blog.csdn.net/zzjstudent/…