nginxpinghuazhongqi/ target=_blank class=infotextkey>nginx平滑重启和升级的方法介绍,有需要的朋友可以参考下。
一、平滑重启
二、平滑升级nginx
cd /yujialinx
wget http://nginx.org/download/nginx-1.0.6.tar.gz
tarx zxvf nginx-1.0.6.tar.gz
cdx nginx-1.0.6
/usr/local/www/nginx/sbin/nginx -Vx
nginx: nginx version: nginx/1.0.4
nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
nginx: configure arguments: --prefix=/usr/local/www/nginx --with-pcre=/yujialin/pcre-8.12 --with-http_stub_status_module --with-http_gzip_static_module
这步是要得到编译参数
./configure --prefix=/usr/local/www/nginx --with-pcre=/yujialin/pcre-8.12 --with-http_stub_status_module --with-http_gzip_static_module
用上面这段编译
然后makex,千万不要在这里make install。
make完了 在objs目录下就多了个nginx,这个就是新版本的程序了
mvx /usr/local/www/nginx/sbin/nginx /usr/local/www/nginx/sbin/nginx-20110906
cpx objs/nginx /usr/local/www/nginx/sbin/nginx
/usr/local/www/nginx/sbin/nginx -tx
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successfu
make upgrade 执行升级
执行完后