Nginx無縫、平滑升級

wget http://sysoev.ru/nginx/nginx-0.8.7.tar.gz
tar zxvf nginx-0.8.7.tar.gz
cd nginx-0.8.7/
./configure
make
cd ../

搬動、變更舊的nginx檔,變成nginx.old
( 注意路徑,你的和我的不一定相同,改成你自己的路徑 )
mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old

複製新產生的 Nginx 到 sbin 文件夾下
( 注意路徑,你的和我的不一定相同,改成你自己的路徑 )
cp /lnmp/nginx-0.8.7/objs/nginx /usr/local/nginx/sbin/nginx

輸入下方命令,確認有沒有錯誤訊息
/usr/local/nginx/sbin/nginx -t

如果有錯誤訊息請 vi /usr/local/nginx/conf/nginx.conf 針對錯誤的地方修改 nginx.conf

沒有錯誤訊息時,接著查詢你自己的pid
輸入以下命令
ps -ef | grep “nginx: master process” | grep -v “grep” | awk -F ‘ ‘ ‘{print $2}’

再輸入以下 3 個命令 ( 數字部份請填入你自己的pid )
kill -USR2 11796
kill -WINCH 11796
kill -QUIT 11796

升級完成辣

感谢Bluesky

Tags:


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply