Nginx1.11.1 升级到 1.16.1

PS :用户和主目录默认是 /isearch ,具体以现场实际情况为准,这里以 /isearch 为例

  • 本文档适的 Nginx 版本:1.11.1

1. 准备

附件:nginx1.16.1.zip

1、上传附件中三个压缩包到tmp目录:/tmp

2. 升级

## nginx停止服务
/isearcb/bin/nginx.sh stop
## 创建目录
mkdir -p /isearch/tmp_build

tar -zxvf /tmp/pcre-8.38.tar.gz -C /isearch/tmp_build/ 

cd /isearch//tmp_build/pcre-8.38

chmod +x configure

sh configure --prefix=/isearch//pcre-8.38  

make 

tar -zxvf /tmp/zlib-1.2.8.tar.gz -C /isearch/tmp_build/  

cd /isearch//tmp_build/zlib-1.2.8

chmod +x configure

sh configure --prefix=/isearch//zlib-1.2.8       

make  

tar -zxvf /tmp/nginx-1.16.1.tar.gz -C /isearch/tmp_build/ 

cd /isearch//tmp_build/nginx-1.16.1

chmod +x configure

sh configure --prefix=/isearch//nginx-1.16.1 --with-pcre=/isearch//tmp_build/pcre-8.38 --with-zlib=/isearch//tmp_build/zlib-1.2.8 --conf-path=/isearch/isa/conf/nginx/nginx.conf --pid-path=/isearch/isa/conf/nginx/nginx.pid          

make 

make install    

cd /isearch
## 修改软连接
ln -snf nginx-1.16.1 nginx

## 启动nginx(isearch用户操作)
./bin/nginx.sh start

3. 还原

## nginx停止服务
/isearch/bin/nginx.sh stop

cd /isearch
## 修改软连接(这里是还原成之前的版本)
ln -snf nginx-1.11.1 nginx

##启动nginx
./bin/nginx.sh start