如何实现nginx平滑重启与平滑升级?
平滑重启 kill -HUP `cat /usr/local/www/nginx/logs/nginx.pid`平滑升级nginx:cd /yujialinwget http://nginx.org/download/nginx-1.0.6.tar.gztar zxvf nginx-1.0.6.tar.gzcd nginx-1.0.6/usr/local/www/nginx/sbin/nginx -Vnginx: nginx version: nginx/1.0.4nginx: 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用上面这段编译然后make,千万别make installmake完了 在objs目录下就多了个nginx,这个就是新版本的程序了mv /usr/local/www/nginx/sbin/nginx /usr/local/www/nginx/sbin/nginx-20110906cp objs/nginx /usr/local/www/nginx/sbin/nginx/usr/local/www/nginx/sbin/nginx -tnginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx: configuration file /usr/local/nginx/conf/nginx.conf test is successfumake upgrade 执行升级执行完后 /usr/local/nginx/sbin/nginx -Vnginx: nginx version: nginx/1.0.6nginx: 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新闻热点
疑难解答