一、nginx的优势
支持高并发
资源消耗少
可以做http反向代理和负载均衡
支持异步网络i/o事件模型epoll
二、安装nginx的依赖包
yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel openssl openssl-devel -y
三、下载nginx
# 下载最新的稳定版 wget https://nginx.org/download/nginx-1.14.2.tar.gz
四、解压缩
tar -zxf nginx-1.14.2.tar.gz
五、释放编译文件,生成Makefile
cd nginx-1.14.2
./configure --prefix=/opt/nginx/
六、编译安装
make && make install
七、启动
/opt/nginx/sbin/nginx