This article describes how to seamlessly and smoothly upgrade Nginx from 1.6.0 to Nginx 1.6.1.
# Download the latest software
[Root @ idoseek ~] # Cd/usr/local/src /&&
Wget http://nginx.org/download/nginx-1.6.1.tar.gz &&
Tar-zxvf nginx-1.6.1.tar.gz
# Decompress the package and compile it based on the original parameters
[Root @ idoseek nginx-1.6.1] # cd nginx-1.6.1 &&
. /Configure -- prefix =/usr/local/nginx -- without-http_memcached_module -- user = www -- group = www -- with-http_stub_status_module -- with-http_ssl_module -- with-http_gzip_static_module -- with-openssl =/usr/local/src/openssl-1.0.1h -- with-zlib =/usr/local/src/zlib-1.2.8 -- with-pcre =/usr/local/src/pcre-8.35 &&
Make
# Back up nginx applications
[Root @ idoseek nginx-1.6.1] # mv/usr/local/nginx/sbin/nginx. bak
# Copy the compiled nginx executable application to the nginx root directory
# Cp objs/nginx/usr/local/nginx/sbin/nginx
# Test whether the nginx configuration is correct
[Root @ idoseek nginx-1.6.1] #/usr/local/nginx/sbin/nginx-t
Nginx: the configuration file/usr/local/nginx/conf/nginx. conf syntax is OK
Nginx: configuration file/usr/local/nginx/conf/nginx. conf test is successful
# Smoothly upgrade nginx
[Root @ idoseek nginx-1.6.1] # make upgrade
/Usr/local/nginx/sbin/nginx-t
Nginx: the configuration file/usr/local/nginx/conf/nginx. conf syntax is OK
Nginx: configuration file/usr/local/nginx/conf/nginx. conf test is successful
Kill-USR2 'cat/usr/local/nginx/logs/nginx. Pid'
Sleep 1
Test-f/usr/local/nginx/logs/nginx. pid. oldbin
Kill-QUIT 'cat/usr/local/nginx/logs/nginx. pid. Oldbin'
# View the updated nginx version
[Root @ idoseek nginx-1.6.1] #/usr/local/nginx/sbin/nginx-V
Nginx version: nginx/1.6.1
Built by gcc 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC)
Tls sni support enabled
Configure arguments: -- prefix =/usr/local/nginx -- without-http_memcached_module -- user = www -- group = www -- with-http_stub_status_module -- with-http_ssl_module -- with-http_gzip_static_module -- with-openssl =/usr/local/src/openssl-1.0.1h -- -zlib =/usr/local/src/zlib-1.2.8 -- with-pcre =/usr/local/src/pcre-8.35
The upgrade process is simple, so we will not introduce it much.