Original: http://www.jb51.net/article/79878.htm
First look at the current environment Nginx version of 1.8.0 compiled parameters only specify the installation path;
Copy CodeThe code is as follows:
[Email protected] sbin]#./nginx-v
Nginx version:nginx/1.8.0
Built by GCC 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
Configure arguments:--prefix=/usr/local/nginx
The smooth upgrade steps are as follows:
Download the nginx1.9.7 version, unzip and enter the extracted directory
Copy CodeThe code is as follows:
[Email protected] ~]# wget-p/usr/local/src/http://nginx.org/download/nginx-1.9.7.tar.gz
[Email protected] ~]# cd/usr/local/src/
[Email protected] src]# TAR-ZXVF nginx-1.9.7.tar.gz
[Email protected] src]# CD nginx-1.9.7
To view Nginx process ID information before compiling the installation:
Copy CodeThe code is as follows:
[Email protected] nginx-1.9.7]# Ps-ef |grep nginx
Root 894 1 0 16:06? 00:00:00 Nginx:master process/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
Nobody 896 894 0 16:06? 00:00:00 Nginx:worker Process
Nobody 897 894 0 16:06? 00:00:00 Nginx:worker Process
Compile and install: Specify user WWW support SSL support PCRE support state query support static compression module;
Copy CodeThe code is as follows:
[Email protected] nginx-1.9.7]#/configure--user=www--group=www--prefix=/usr/local/nginx/--with-pcre--with-http _stub_status_module--with-http_ssl_module--with-http_gzip_static_module
After compiling the installation can echo $? To see if it was successful, just make it after success, and do not need to install;
Copy CodeThe code is as follows:
[[email protected] nginx-1.9.7]# make
Smooth upgrade, first remove existing nginx binaries
Copy CodeThe code is as follows:
[Email protected] nginx-1.9.7]# Mv/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.old
Copy the newly generated nginx binary file to the specified directory
Copy CodeThe code is as follows:
[email protected] nginx-1.9.7]# CP objs/nginx/usr/local/nginx/sbin/
To perform an upgrade command
Copy CodeThe code is as follows:
[email protected] nginx-1.9.7]# 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 version, found already is 1.9.7 version, compile parameters also exist;
Copy CodeThe code is as follows:
[Email protected] nginx-1.9.7]#/usr/local/nginx/sbin/nginx-v
Nginx version:nginx/1.9.7
Built by GCC 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
Built with OpenSSL 1.0.1e-fips 2013
TLS SNI Support Enabled
Configure arguments:--user=www--group=www--prefix=/usr/local/nginx/--with-pcre--with-http_stub_status_module-- With-http_ssl_module--with-http_gzip_static_module
Create WWW user
Copy CodeThe code is as follows:
[Email protected] nginx-1.9.7]# useradd-s/sbin/nologin-m www
View Nginx process PID has changed
Copy CodeThe code is as follows:
[Email protected] sbin]# Ps-ef |grep nginx
Root 3814 1 0 16:23? 00:00:00 Nginx:master process/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
Nobody 3815 3814 0 16:23? 00:00:00 Nginx:worker Process
Nobody 3816 3814 0 16:23? 00:00:00 Nginx:worker Process
Modify the nginx.conf configuration file, change user and user group for WWW user, save exit, restart Nginx service;
Copy CodeThe code is as follows:
[Email protected] conf]# Ps-ef |grep nginx
Root 3814 1 0 16:23? 00:00:00 Nginx:master process/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
WWW 4200 3814 0 16:48? 00:00:00 Nginx:worker Process
www 4201 3814 0 16:48? 00:00:00 Nginx:worker Process
Nginx1.8.0 version of the smooth upgrade of the new version 1.9.7 to introduce to you here, I hope to help you!
Nginx1.8.0 version Smooth upgrade new version 1.9.7