Home  >  Article  >  Backend Development  >  nginx seamless upgrade

nginx seamless upgrade

WBOY
WBOYOriginal
2016-07-28 08:28:05881browse

Reference article: [http://www.2cto.com/os/201305/208921.html][6]

1. Download the new nginx package

Download address: [http://nginx.org][ 6]

2. Place nginx in the /usr/src directory

3. Compile the new nginx

<code>tar zxvf  nginx<span>-</span><span>1.10</span><span>.1</span><span>.</span>tar<span>.</span>gz
cd nginx<span>-</span><span>1.10</span><span>.1</span><span>.</span>tar<span>.</span>gz
<span>.</span>/configure <span>--</span>prefix<span>=</span>/usr/<span>local</span>/nginx <span>--</span><span>with</span><span>-stream</span><span>--</span><span>with</span><span>-cc</span><span>=</span>/usr/sfw/bin/gcc
make</code>

Note: Just make here, do not make install. Among them –prefix=/usr/local/nginx is the directory where nginx was originally installed.

4. Replace the original nginx executable file

After compilation, there is an nginx executable file in the objs directory under the nginx-1.10.1 folder, which is the new executable file.

<code><span># 备份原理的nginx执行文件</span>
mv /usr/<span>local</span>/nginx/sbin/nginx /usr/<span>local</span>/nginx/sbin/nginx.old

<span># 复制新的nginx执行文件到安装目录下</span>
cp objs/nginx /usr/<span>local</span>/nginx/sbin/nginx</code>

5. Check whether it is successful

<code><span># 显示nginx是否运行正常</span>
/usr/local/nginx/sbin/nginx -t

<span># 显示nginx版本信息</span>
/usr/local/nginx/sbin/nginx -V</code>
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the seamless upgrade of nginx, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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