Detailed explanation of smooth upgrade of nginx
Release: 2016-07-29 09:14:44
Original
1061 people have browsed it
Recently, I feel that the company's nginx version is too low and we have to add a new nginx module, so the only way I can think of is to upgrade smoothly. Nginx updates really quickly. Recently, the old stable versions of nginx 0.8.55 and nginx 0.7.69 have been released. I prefer to use new versions of software, so I smoothly upgraded the original nginx-1.0.2 to the nginx-1.0.5 stable version. And record this process, hoping to be of some help to friends in need. 1. Check the current version before starting. # /usr/local/nginx/sbin/nginx -V
nginx: nginx version: nginx/1.0.5
nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
nginx: TLS SNI support disabled
nginx: 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※ Pay attention to the redarea, which are previously compiled parameters. You will need to edit the new version immediately. 2. Download the new version: http://nginx.org/en/download.htmlThen: Unzip> Previous preparations> Compile# tar zxvf nginx-1.0.5.tar.gz
# cd 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
# make3. After execution, there is no need to make install, then rename /sbin/nginx to nginx.old# mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old4. Copy the compiled nginx file in the objs directory to the nginx installation directory sbin/# cp objs/nginx /usr/local/nginx/sbin/5. Test the new The effect of the copied file: # /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 successful6. Let nginx modify the nginx.pid file to nginx.pid.oldbin, and then start nginx to achieve uninterrupted service operation# kill -USR2 `cat /usr/local/nginx/nginx.pid`(发送平滑升级信号将旧的nginx.pid文件添加后缀nginx.pid.oldbin)#kill -WINCH(平缓停止worker process) `cat /usr/local/nginx/nginx.pid.oldbin
# kill -QUIT `cat /usr/local/nginx/nginx.pid.oldbin`7. The upgrade is completed, and finally in Take a look at the upgraded version# /usr/local/nginx/sbin/nginx -v
nginx: nginx version: nginx/1.0.5
The above introduces the detailed explanation of smooth upgrade of nginx, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31