1. Introduction to the server
1、apache
Apache is the number one server in the world. According to statistics, more than 50% of web servers in the world are using apache.
Features of apache:
1) Can run on almost all computer platforms.
2) Support the latest http/1.1 protocol
3) Simple and powerful file-based configuration (httpd.conf).
4) Support Common Gateway Interface (cgi)
5) Support virtual host.
6) Support http authentication.
7) Integrate perl.
8) Integrated proxy server
9) The status of the server can be monitored through a web browser, and the log can be customized.
10) Support server-side include commands (ssi).
11) Support secure socket layer (ssl).
12) It has the ability to track user session process.
13) Support fastcgi
14) Support java servlets
2、nginx
1. Nginx is a very lightweight HTTP server written by Russians. Nginx, its pronunciation is "engineX", is a high-performance HTTP and reverse proxy server, as well as an IMAP/POP3/SMTP proxy server. Nginx was developed by Russian Igor Sysoev for the second most visited Rambler.ru site in Russia.
2. As an HTTP server, nginx has the following basic features:
Process static files, index files, and automatic indexing; open file descriptor buffering.
Cacheless reverse proxy acceleration, simple load balancing and fault tolerance.
FastCGI, simple load balancing and fault tolerance.
Modular structure.
Nginx has high stability.
Nginx supports hot deployment
轻量级,同样web 服务,比apache 占用更少的内存及资源 ;
高度模块化的设计,编写模块相对简单 ;
社区活跃,各种高性能模块出品迅速啊 ;
Nginx本身就是一个反向代理服务器 ,Nginx支持7层负载均衡;Nginx可能会比apache支持更高的并发,
nginx配置文件写的很简洁,正则配置让很多事情变得简单运行效率高,占用资源少,代理功能强大,很适合做前端响应服务器 !
模块超多,基本想到的都可以找到 ;
少bug ,nginx 的bug 相对较多 ;
超稳定 ,Aapche依然是大部分公司的首先,因为其成熟的技术和开发社区已经 也是非常不错的性能。
Nginx 配置简洁, Apache 复杂 , Nginx 静态处理性能比 Apache 高 3倍以上 , Apache 对 PHP 支持比较简单,Nginx 需要配合其他后端用, Apache 的组件比 Nginx 多 。