1.上传nginx包

nginx-1.16.1.tar.gz

 

2. 解压

tar zxvf nginx-1.16.1.tar.gz

 

3.yum安装依赖

yum -y install gcc gcc-c++ autoconf automake make

yum install pcre

yum install pcre-devel

yum install -y zlib

yum install -y zlib-devel

 

 

./configure --prefix=/usr/local/nginx

make && make install

 

 

 

4. 启动nginx

/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

 

5.重启nginx

/usr/local/nginx/sbin/nginx -s reload