Nginx的特性:
高性能的静态web服务器
作为smtp,httpd,tomcat,pop3等反向代理服务器
10000个并发,仅消耗1M内存
基于libevent库,支持event的epoll的边缘触发机制。
异步IO,内存映射
负载均衡、缓存
支持ssl,https,fastcgi协议
支持不停机升级,日志滚动,配置更新
安装方式:
编译安装
rpm安装(epel)
编译安装nginx的步骤:
开发环境:
CentOS 6: yum groupinstall "Development Tools" "Server Platform Development"
CentOS 7: yum groupinstall "Development Tools"
依赖的包
yum install -y pcre-devel openssl-devel
获取源码包: nginx.org
编译安装:
1、添加nginx用户
useradd -r -g nginx
2、编译
tar xf nginx-1.12.1.tar.gz
./configure --with-debug --with-pcre --http-client-body-temp-path=/var/tmp/nginx/client-body --http-proxy-temp-path=/var/tmp/nginx/proxy --http-uwsgi-temp-path=/var/tmp