Home > Backend Development > PHP Tutorial > Detailed explanation of smooth upgrade of nginx

Detailed explanation of smooth upgrade of nginx

WBOY
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_modulePay 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.

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template