1、下载nginx
https://nginx.org/download/
如:nginx-1.9.9.tar.gz
2、安装依赖
yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
3、解压安装nginx-1.9.9.tar.gz
解压
tar -zxvf nginx-1.9.9.tar.gz
进入nginx目录
cd nginx-1.9.9
配置
./configure --prefix=/usr/local/nginx
进入nginx目录
make
make install
检查是否安装成功
./sbin/nginx -t
4、启动
cd /usr/local/nginx/sbin
./nginx //启动nginx
5、配置开机启动
vim /etc/rc.d/rc.local
6、参考文章