新聞中心
這里有您想知道的互聯網營銷解決方案
nginx非覆蓋式升級怎么實現
本篇內容介紹了“nginx非覆蓋式升級怎么實現”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
創(chuàng)新互聯2013年至今,是專業(yè)互聯網技術服務公司,擁有項目網站制作、網站建設網站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元甘州做網站,已為上家服務,為甘州各地企業(yè)和個人服務,聯系電話:18980820575
覆蓋式升級:
升級目的:nginx1.3版本之后支持了websocket ,簡單的配個代理就能讓你的websocket工作正常
本次針對已有nginx非覆蓋式升級,具體如下:
下載nginx
解壓編譯
備份拷貝原有配置文件
關閉原有服務,啟動新服務
如果有weget $ weget http://nginx.org/download/nginx-1.8.0.tar.gz 或者訪問 http://nginx.org/en/download.html 推薦1.8.0 穩(wěn)定版 $ tar -zxvf nginx-1.8.0.tar.gz $ cd nginx-1.8.0 $ ./configure --prefix=/usr/local/nginx-1.8.0 Mac OX 下也許你能順利通過,但是如果Ubuntu下可能會報PCRE依賴包沒有 so 你可以如下操作: $ apt-get install libpcre3 libpcre3-dev 成功后可執(zhí)行安裝了 $ make && make install 這樣在你的/usr/local/nginx-1.8.0下就成功安裝了一個nginx 和原有的不沖突 $ cd /usr/local/nginx-1.8.0 $ ls -lrt drwxr-xr-x 2 root root 4096 Aug 17 10:32 sbin drwxr-xr-x 2 root root 4096 Aug 17 10:32 html drwxr-xr-x 2 root root 4096 Aug 17 10:35 logs drwx------ 2 www-data root 4096 Aug 17 10:35 uwsgi_temp drwx------ 2 www-data root 4096 Aug 17 10:35 scgi_temp drwx------ 2 www-data root 4096 Aug 17 10:35 fastcgi_temp drwxr-xr-x 5 root root 4096 Aug 17 19:49 conf drwx------ 12 www-data root 4096 Aug 17 22:37 proxy_temp drwx------ 2 www-data root 4096 Aug 17 22:46 client_body_temp ldd nginx 可以看到并沒有自己的.so 依賴文件 ldd /usr/local/nginx-1.8.0/sbin/nginx (ubuntu) otool -L ~/dwetl/nginx1.8.0/sbin/nginx (Mac OX) 接著關閉&備份已有nginx 配置文件等 echo 'stop nginx ....' service nginx stop echo 'cp config file.' cp /etc/nginx/nginx.conf /usr/local/nginx-1.8.0/conf/ cp -r /etc/nginx/conf.d/ /usr/local/nginx-1.8.0/conf/ echo 'upgrade nginx.' mv /usr/sbin/nginx /usr/sbin/nginx1.1.19 # 保留之前的nginx 萬一出問題了咋辦呢,留條后路 ln -s /usr/local/nginx-1.8.0/sbin/nginx /usr/sbin/nginx echo 'restart nginx.' service nginx restart 輕松搞定
“nginx非覆蓋式升級怎么實現”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關的知識可以關注創(chuàng)新互聯網站,小編將為大家輸出更多高質量的實用文章!
文章題目:nginx非覆蓋式升級怎么實現
瀏覽地址:http://fisionsoft.com.cn/article/jechgj.html