Linux ---------- nginx smooth upgrade

First, add new features

// Check compiling parameters and copy parameter
nginx -V

// Download the new echo module
https://github.com/chendao2015/echo-nginx-module download
https://github.com/openresty/echo-nginx-module/archive/v0.61.tar.gz

// compiler parameters
./configure - copy parameters --add
generate a objs / nginx

// file copy command
cp /usr/local/nginx/sbin/nginx{,.old}
\ cp objs / nginx / usr / local / nginx / sbin / nginx

//安装
make
make install

// restart nginx
pkill nginx
nginx

Second, upgrade nginx

// Check compiling parameters and copy parameter
nginx -V

// compile and install
./configure --prefix / usr / local / nginx -1.15 - copying the parameters
the make
the make install

// copy the configuration file
cp /usr/local/nginx/conf/nginx.conf{,.old}
cp /usr/local/nginx/conf/nginx.conf /usr/local/nginx-1.15/conf/nginx.conf

// kill the original nginx process, to launch a new version of nginx
pkill nginx
/usr/local/nginx-1.15/sbin/nginx

Guess you like

Origin www.cnblogs.com/wangchengshi/p/11002260.html