Pages

Tuesday, 5 June 2012

升级LNMP中的NGINX到最新版



现在最新版是0.8.53,如果以后出新版,只要更新版本号就可以,在SSH里运行:
  • wget http://www.nginx.org/download/nginx-0.8.53.tar.gz
    tar zxvf nginx-0.8.53.tar.gz
    cd nginx-0.8.53
    ./configure –user=www –group=www –prefix=/usr/local/nginx –with-http_stub_status_module –with-http_ssl_module  –with-http_sub_module
    make
    mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
    cd objs/
    cp nginx /usr/local/nginx/sbin/
    /usr/local/nginx/sbin/nginx -t
    kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
    kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
    /usr/local/nginx/sbin/nginx -v
    cd ..
    cd ..
    rm -rf nginx-0.8.53
    rm -rf nginx-0.8.53.tar.gz