天天看點

Nginx 平滑更新不影響業務

檢視目前版本

nginx -V

nginx新版本

unzip pcre-8.10.zip

cd pcre-8.10

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

make 

make install

tar zxvf  nginx-xxx.tar.gz

cd  nginx-xxx

./configure --with-pcre=/usr/pcre-8.10 http安裝

yum -y install openssl openssl-devel

./configure --with-pcre=/usr/pcre-8.10 --with-http_stub_status_module --with-http_ssl_module https安裝

make

備份老版本的可執行檔案

cd /usr/local/nginx/sbin   

cp nginx nginx.old

拷貝新的可執行檔案

cp /root/nginx-xxxx/objs/nginx  /usr/local/nginx/sbin/

更新

cd /root/nginx-xxxx 

make upgrade

清理多餘檔案

rm -rf /root/nginx-xxxx

繼續閱讀