The difference between Apache, Tomcat, and Nginx

Source: Internet
Author: User
Tags url forwarding

A. Definition:

Apache

Apache HTTP Server is a modular server that can run on almost any widely used computer platform. It belongs to the application server. Apache supports many modules, stable performance, Apache itself is static parsing, suitable for static HTML, pictures, etc., but can be extended scripts, modules and other support dynamic pages.

(Apche can support Phpcgiperl, but to use Java, you need Tomcat to support Apache in the background, and Java requests are forwarded to Tomcat for processing by Apache.) )

Cons: The configuration is relatively complex and does not support dynamic pages on its own.

Tomcat:

Tomcat is an application (Java) server, which 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.

Nginx

Nginx is a very lightweight HTTP server written by the Russians, Nginx, which is pronounced "engine X", is a high-performance HTTP and reverse proxy server, but also a IMAP/POP3/SMTP proxy server.


Two: Comparison

Comparison of 1.Apache and Tomcat

Same point:

Both are developed by the Apache organization.

Both have the functionality of the HTTP service

Both are free.

Different points:

Apache is dedicated to providing HTTP services, as well as related configurations (such as virtual hosting, URL forwarding, etc.), while Tomcat is a JSP server developed under Java EE-compliant JSP and servlet standards.

Apache is a Web server environment program that enables him to be used as a Web server, but only supports static web pages such as Dynamic Web pages (asp,php,cgi,jsp). 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.

Apache: Focus on Httpserver, 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.

The actual use of Apache and Tomcat is often integrated using:

If the client is requesting a static page, only the Apache server is required to respond to the request.

If the client requests a dynamic page, the Tomcat server responds to the request.

Because JSP is the server-side interpretation code, this consolidation reduces the service overhead of Tomcat.

An extension of Tomcat to Apache can be understood.

Compare 2.Nginx to Apache

The advantages of nginx with respect to Apache

Lightweight, same Web service, consumes less memory and resources than Apache

Anti-concurrency, Nginx processing requests are asynchronous non-blocking, and Apache is blocking type, in high concurrency, nginx can keep low resource consumption and high performance

Highly modular design, relatively simple to write modules

Provides load balancing

Community active, a variety of high-performance modules produced quickly

The advantages of Apache versus Nginx

Apache's rewrite is stronger than nginx;

Support dynamic pages;

Support for a number of modules, the basic coverage of all applications;

Stable performance, and nginx relative bugs more.

Comparison between the pros and cons

Nginx configuration concise, Apache complex;

Nginx static processing performance than Apache 3 times times higher than;

Apache support for PHP is relatively simple, Nginx needs to cooperate with other backend;

Apache has more components than Nginx;

Apache is a synchronous multi-process model, a connection corresponding to a process; Nginx is asynchronous, multiple connections (million levels) can correspond to a process;

Nginx processing static files good, consume less memory;

Dynamic request by Apache to do, nginx only suitable for static and reverse;

Nginx is suitable for front-end server, load performance is very good;

Nginx itself is a reverse proxy server, and supports load balancing

Summarize

Nginx Advantages: Load Balancing, reverse proxy, processing static file advantage. Nginx handles static requests faster than Apache;

Apache Advantage: Handling static files is an advantage over the Tomcat server and is fast. Apache is static parsing, suitable for static HTML, pictures and so on.

Tomcat: Dynamic parsing of containers, processing dynamic requests, is compiled Jsp\servlet container, Nginx has a dynamic separation mechanism, static request can be directly through nginx processing, dynamic request to forward the request to the background by Tomcat processing.

Apache in the processing of dynamic has advantages, nginx concurrency is better, CPU memory consumption is low, if rewrite frequent, it is more suitable for Apache.


This article from the "Technology life, Simple not simple" blog, please be sure to keep this source http://willis.blog.51cto.com/11907152/1852083

The difference between Apache, Tomcat, and Nginx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.