共计 1668 个字符,预计需要花费 5 分钟才能阅读完成。
如何实现 nginx 平滑重启与平滑升级?
平滑重启 kill -HUP `cat /usr/local/www/nginx/logs/nginx.pid`
平滑升级 nginx:
cd /yujialin
wget http://nginx.org/download/nginx-1.0.6.tar.gz
tar zxvf nginx-1.0.6.tar.gz
cd nginx-1.0.6
/usr/local/www/nginx/sbin/nginx -V
nginx: nginx version: nginx/1.0.4
nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
nginx: configure arguments: –prefix=/usr/local/www/nginx –with-pcre=/yujialin/pcre-8.12 –with-http_stub_status_module –with-http_gzip_static_module
得到编译参数
./configure –prefix=/usr/local/www/nginx –with-pcre=/yujialin/pcre-8.12 –with-http_stub_status_module –with-http_gzip_static_module
用上面这段编译
然后 make,千万别 make install
make 完了 在 objs 目录下就多了个 nginx,这个就是新版本的程序了
mv /usr/local/www/nginx/sbin/nginx /usr/local/www/nginx/sbin/nginx-20110906
cp objs/nginx /usr/local/www/nginx/sbin/nginx
/usr/local/www/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 successfu
make upgrade 执行升级
执行完后 /usr/local/nginx/sbin/nginx -V
nginx: nginx version: nginx/1.0.6
nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
nginx: configure arguments: –prefix=/usr/local/www/nginx –with-pcre=/yujialin/pcre-8.12 –with-http_stub_status_module –with-http_gzip_static_module
推荐阅读 :
Nginx 实现反向代理和负载均衡的配置及优化 http://www.linuxidc.com/Linux/2013-11/92909.htm
Nginx 做负载均衡报:nginx: [emerg] could not build the types_hash http://www.linuxidc.com/Linux/2013-10/92063.htm
Nginx 负载均衡模块 ngx_http_upstream_module 详述 http://www.linuxidc.com/Linux/2013-10/91907.htm
Nginx+Firebug 让浏览器告诉你负载均衡将请求分到了哪台服务器 http://www.linuxidc.com/Linux/2013-10/91824.htm
Ubuntu 安装 Nginx php5-fpm MySQL(LNMP 环境搭建) http://www.linuxidc.com/Linux/2012-10/72458.htm
Nginx 的详细介绍 :请点这里
Nginx 的下载地址 :请点这里