First look at the current environment Nginx version of 1.8.0 compiled parameters only specify the installation path;
[Email protected] sbin]#/nginx-vnginx version:nginx/1.8.0built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) Configur E arguments:--prefix=/usr/local/nginx
The smooth upgrade steps are as follows:
Download the nginx1.9.7 version, unzip and enter the extracted directory
[Email protected] ~]# wget-p/usr/local/src/http://nginx.org/download/nginx-1.9.7.tar.gz[[email protected] ~]# cd/us r/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:
[[email protected] nginx-1.9.7]# ps -ef |grep nginxroot 894 1 0 16:06 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.confnobody 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;
[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;
[[email protected] nginx-1.9.7]# make
Smooth upgrade, first remove existing nginx binaries
[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
[email protected] nginx-1.9.7]# CP objs/nginx/usr/local/nginx/sbin/
To perform an upgrade command
[email protected] nginx-1.9.7]# make upgrade/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 Successfulkill- USR2 ' cat/usr/local/nginx//logs/nginx.pid ' sleep 1test-f/usr/local/nginx//logs/nginx.pid.oldbinkill-quit ' cat/usr/ Local/nginx//logs/nginx.pid.oldbin '
View version, found already is 1.9.7 version, compile parameters also exist;
[Email protected] nginx-1.9.7]#/usr/local/nginx/sbin/nginx-vnginx version:nginx/1.9.7built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) built with OpenSSL 1.0.1e-fips each Feb 2013TLS SNI support enabledconfigure arguments:--user=www--gro Up=www--prefix=/usr/local/nginx/--with-pcre--with-http_stub_status_module--with-http_ssl_module--with-http_ Gzip_static_module
Create WWW user
[Email protected] nginx-1.9.7]# useradd-s/sbin/nologin-m www
view Nginx process PID has changed
[[email protected] sbin]# ps -ef |grep nginxroot 3814 1 0 16:23 ? 00:00:00 nginx: master process /usr/local /nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.confnobody 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;
[[email protected] conf]# ps -ef |grep nginxroot 3814 1 0 16:23 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/ Local/nginx/conf/nginx.confwww 4200 3814 0 16:48 ? 00:00:00 nginx: worker process www 4201 3814 0 16:48 ? 00:00:00 nginx: Worker process
Nginx version smooth upgrade end;
This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://mofansheng.blog.51cto.com/8792265/1744062
nginx1.8.0 version Smooth upgrade new version 1.9.7