The smooth upgrade of Nginx detailed

Source: Internet
Author: User
recently feel the company's Nginx version is too low and we have to add new Nginx module so can only think of is a smooth upgrade this way. NginxThe update is really fast, the latest Nginx 0.8.55 and Nginx 0.7.69 old stable version has been released. I prefer to use the new version of the software, so the original nginx-1.0.2 Smooth Upgradeto nginx-1.0.5 stable version. And record this process, hope to have a friend in need a little help.

1. Check the version you are currently using before you start.

#/usr/local/nginx/sbin/nginx-vnginx:nginx Version:nginx/1.0.5nginx:built by GCC4.1.2 20080704 ( Red Hat4.1.2-50) Nginx:tls SNI support disablednginx: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 ※Attention RedZone, which is a previously compiled parameter. It is necessary to edit the new version right away.

2. Download the new version: Http://nginx.org/en/download.html

Then: Unzip > Pre-prepare > Compile

# TarZXVF nginx-1.0.5.tar.gz# CDnginx-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# Make 3. After execution, there is no need to install in make, the next name/sbin/nginx for Nginx.old

# MV/usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.old 4. Copy the Nginx file under the compiled Objs directory to the Nginx installation directory sbin/

# CPobjs/nginx/usr/local/nginx/sbin/ 5. Test the new copy of the document in effect:

#/usr/local/nginx/sbin/nginx-t nginx:the configuration file /usr/local/nginx/conf/nginx.conf syntax is oknginx:configuration file/usr/ local/nginx/conf/nginx.conf Test is successful 6. Let nginx change the Nginx.pid file to Nginx.pid.oldbin, then start Nginx, realize uninterrupted service operation

# Kill-USR2 ' Cat/usr/local/nginx/nginx.pid ' (send a smooth upgrade signal to add the old nginx.pid file suffix nginx.pid.oldbin) #kill-winch (gentle stop worker process) ' cat/usr/local/nginx/nginx.pid.oldbin# kill- QUIT ' Cat/usr/local/nginx/nginx.pid.oldbin ' 7. Upgrade finished, and finally look at the upgraded version

#/usr/local/nginx/sbin/nginx-v Nginx:nginx version:nginx/1.0.5

Above describes the smooth upgrade of nginx, including the contents of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.