recently feel the company's Nginx version is too low and we have to add new Nginx module so can only think of is a smooth upgrade this way. NginxThe update is really fast, the latest Nginx 0.8.55 and Nginx 0.7.69 old stable version has been released. I prefer to use the new version of the software, so the original nginx-1.0.2 Smooth Upgradeto nginx-1.0.5 stable version. And record this process, hope to have a friend in need a little help.
1. Check the version you are currently using before you start.
#/usr/local/nginx/sbin/nginx-vnginx:nginx Version:nginx/1.0.5nginx:built by GCC4.1.2 20080704 ( Red Hat4.1.2-50) Nginx:tls SNI support disablednginx:configure arguments: --user=www--group=www--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module-- With-http_flv_module--with-cc-opt=-o3--with-cpu-opt=opteron--with-http_gzip_static_module ※Attention RedZone, which is a previously compiled parameter. It is necessary to edit the new version right away.
2. Download the new version: Http://nginx.org/en/download.html
Then: Unzip > Pre-prepare > Compile
# TarZXVF nginx-1.0.5.tar.gz# CDnginx-1.0.5#./configure--user=www--group=www--prefix=/usr/local/nginx--with-http_stub_status_module--with-http _ssl_module--with-http_flv_module--with-cc-opt= '-o3 '--with-cpu-opt=opteron--with-http_gzip_static_module# Make 3. After execution, there is no need to install in make, the next name/sbin/nginx for Nginx.old
# MV/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.old 4. Copy the Nginx file under the compiled Objs directory to the Nginx installation directory sbin/
# CPobjs/nginx/usr/local/nginx/sbin/ 5. Test the new copy of the document in effect:
#/usr/local/nginx/sbin/nginx-t nginx:the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx:configuration file/usr/ local/nginx/conf/nginx.conf Test is successful 6. Let nginx change the Nginx.pid file to Nginx.pid.oldbin, then start Nginx, realize uninterrupted service operation
# Kill-USR2 ' Cat/usr/local/nginx/nginx.pid ' (send a smooth upgrade signal to add the old nginx.pid file suffix nginx.pid.oldbin) #kill-winch (gentle stop worker process) ' cat/usr/local/nginx/nginx.pid.oldbin# kill- QUIT ' Cat/usr/local/nginx/nginx.pid.oldbin ' 7. Upgrade finished, and finally look at the upgraded version
#/usr/local/nginx/sbin/nginx-v Nginx:nginx version:nginx/1.0.5
Above describes the smooth upgrade of nginx, including the contents of the content, I hope that the PHP tutorial interested in a friend helpful.