Brief and relatively Apache, Tomcat and Nginx of

definition

Apache

Apache HTTP Server is a modular server that can run on almost any computer platform widely used. It belongs to the application server. Apache supports multi-module support, stable performance, Apache itself is static resolution, suitable for static HTML, images, etc., but can be extended to support dynamic pages through script, modules and so on. (Apche can support PHPcgiperl, but you want to use Java, you need to Apache Tomcat in the background supporting the request forwarded by the Java Apache Tomcat to handle.)

Cons: configuration is relatively complex, it does not support dynamic pages.

Tomcat

Tomcat is the application (Java) server, it is just a Servlet (JSP also translated into Servlet) vessel, Apache can be considered an extension, but can run independently of the Apache.

Nginx

Nginx Russians prepared very lightweight HTTP servers, Nginx, it's pronounced "engine X", it is a high-performance HTTP server and reverse proxy, but also a IMAP / POP3 / SMTP proxy server. )

Here Insert Picture Description

Compare

Comparison of Apache and Tomcat's

Same point:

  1. Both are developed by Apache

  2. Function both HTTP services

  3. Both are free

difference:

Apache is specifically used to provide HTTP services, and the related configurations (such as web hosting, URL forwarding, etc.), while Apache Tomcat is the organization developed under Java EE-compliant JSP, Servlet standard a JSP server.

Apache Web server environment is a program that can enable him to use as a Web server, but only supports static pages such as (ASP, PHP, CGI, JSP) and other dynamic web pages can not. If you want to run JSP in Apache environment if you need an interpreter to execute JSP page and the JSP interpreter is Tomcat.

Apache: focus on HTTPServer, Tomcat: focus on the Servlet engine, if run in Standalone mode, functionally equivalent Apache, supports JSP, but not ideal for static pages;

Apache Web server, Tomcat application (Java) server, it is just a Servlet (JSP also translated into Servlet) vessel, Apache can be considered an extension, but can run independently of the Apache.

Actual use Apache and Tomcat integration often use:

If the client requests a static page, you only need Apache server responds to the request. If the client requests a dynamic page, the Tomcat server is responding to requests. Because JSP is a server-side interpreted code, so that integration can reduce service costs Tomcat. It can be understood as an extension of Apache Tomcat.

Nginx and Apache compare

nginx advantages with respect to the apache

  1. Lightweight, also from the web service, take up less memory than apache and resources

  2. Anti concurrent, non-blocking Nginx processing request is asynchronous, and the apache is blocked type, low resource consumption Nginx high performance can be maintained under high concurrency

  3. Highly modular design, relatively simple to write a module

  4. Load balancing

  5. Community activists, quickly produced a variety of high-performance modules

apache advantages with respect to nginx

  1. apache's rewrite than nginx powerful;

  2. Support dynamic page;

  3. Support of multi-module, covering all applications;

  4. Stable performance, and relatively bug nginx more.

Both advantages and disadvantages

  1. Nginx configuration is simple, Apache complicated;

  2. Nginx static processing performance more than three times higher than the Apache;

  3. Apache support for PHP is relatively simple, Nginx need to cooperate with other back-end;

  4. Apache components than the Nginx;

  5. apache is a simultaneous multi-process model, a connection corresponds to a process; nginx is asynchronous, multiple connections (million level) may correspond to a process;

  6. Good static files nginx, consume less memory;

  7. Dynamic requested to do by the apache, nginx is only suitable for static and reverse;

  8. Nginx suitable for front-end server, good load performance;

  9. Nginx itself is a reverse proxy server, and load balancing support

Here Insert Picture Description

to sum up

Nginx advantages: load balancing, reverse proxy, static files advantage. nginx static process requests faster than Apache;

Apache advantage: Tomcat server for static files relative to its advantage fast. Apache is static resolution, suitable for static HTML, images and so on.

Tomcat: dynamic analysis container handling dynamic requests are compiled JSP \ Servlet container, Nginx dynamic separation mechanism, static requests can be directly processed by Nginx, dynamic request before forwarding the request to the background handed over to Tomcat for processing. Apache has an advantage in dealing with dynamic, Nginx better concurrency, low CPU memory footprint, if rewrite frequently, and that was more suitable for Apache.

Reverse proxy understood: reverse proxy (Reverse Proxy) mode refers to the proxy server to accept connection requests on the internet, and then forwards the request to the server on the internal network, and returns the result obtained from the server on the internet to client connection request, in which case the external proxy server on the performance of a server.

Guess you like

Origin blog.csdn.net/weixin_43958969/article/details/90300416