: This article describes how to smoothly upgrade nginx. if you are interested in the PHP Tutorial, refer to it. Recently, I feel that the company's nginx version is too low and we have to add a new nginx module. so we can only think of a smooth upgrade method. Nginx is updated very quickly. The latest stable versions of nginx 0.8.55 and nginx 0.7.69 have been released. I prefer a new version of the software, so I smoothly upgraded the original nginx-1.0.2 to the nginx-1.0.5 stable version. Record the process and hope to be helpful to friends in need.
1. check the current version before you start.
#/Usr/local/nginx/sbin/nginx-Vnginx: nginx version: nginx/1.0.5nginx: built by gcc 4.1.2 20080704 (Red Hat 4.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 ※Note the red area. this is a previously compiled parameter. You need to edit the new version immediately.
2. Download New version: http://nginx.org/en/download.html
Then: decompress the package, prepare the package, and compile the package.
# Tar zxvf nginx-1.0.5.tar.gz # D nginx-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 the execution is complete, you do not need to make install here. Next, name/sbin/nginx as nginx. old.
# Mv/usr/local/nginx/sbin/nginx. old 4. copy the nginx file under the objs directory after compilation to the nginx installation directory sbin /.
# Cp objs/nginx/usr/local/nginx/sbin/ 5. test the effectiveness of the newly copied file:
#/Usr/local/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 successful 6. let nginx change the nginx. pid file to nginx. pid. oldbin, and then start nginx for uninterrupted service operation.
# Kill-USR2 'cat/usr/local/nginx. Pi' (send a smooth upgrade signal and add the suffix nginx. pid. oldbin to the old nginx. pid file) # Kill-WINCH (stop worker process gently) 'cat/usr/local/nginx. pid. oldbin # kill-QUIT 'cat/usr/local/nginx. pid. oldbin' 7. the upgrade is complete. check the upgraded version.
#/Usr/local/nginx/sbin/nginx-vnginx: nginx version: nginx/1.0.5
The above describes how to smoothly upgrade nginx, including some content, and hopes to help those who are interested in the PHP Tutorial.