欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

從Nginx切換到Tengine的步驟分享

 更新時間:2012年11月13日 11:46:52   作者:  
由淘寶網(wǎng)發(fā)起的Web服務器 Tengine 可以被看作一個更好的Nginx,或者是Nginx的超集。它在Nginx的基礎(chǔ)上,針對大訪問量網(wǎng)站的需求,添加了很多高級功能和特性
從Nginx切換到Tengine主要是因為 concat 模塊(合并js、css),以及動態(tài)加載模塊功能(DSO)。
如果已經(jīng)用apt-get方式安裝了Nginx,可以嘗試以下步驟以切換到Tengine(不需要卸載Nginx):

1. 到官方下載你喜歡的Tengine版本,這里以最新版(1.4.0)為例,

復制代碼 代碼如下:

wget http://tengine.taobao.org/download/tengine-1.4.0.tar.gz

2. 解壓縮:

復制代碼 代碼如下:

tar -xvzf tengine-1.4.0.tar.gz

3. 進入解壓出來的文件夾:
復制代碼 代碼如下:

cd tengine-1.4.0/

4. 查看當前Nginx的編譯參數(shù):

復制代碼 代碼如下:

nginx -V


得到結(jié)果如下:

復制代碼 代碼如下:

nginx: nginx version: nginx/1.0.5
nginx: TLS SNI support enabled
nginx: configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.0.5/debian/modules/nginx-echo --add-module=/build/buildd/nginx-1.0.5/debian/modules/nginx-upstream-fair


5. 根據(jù)上面第三行的配置編譯Tengine,具體做法:從--prefix=/etc/nginx開始復制第三行的代碼,然后在--with-debug后面加上--with-http_concat_module(意前后需要有空格),并刪掉從--add-module開始的代碼(否則會編譯不過),完整的編譯腳本如下:

復制代碼 代碼如下:

./configure --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-debug --with-http_concat_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module


如果編譯中出現(xiàn)類似下面的錯誤,說明編譯依賴模塊不存在,你可以選擇安裝或者如果你不需要這個模塊的話,從上面的編譯腳本中刪除后再一次執(zhí)行編譯腳本,直到編譯完成:

復制代碼 代碼如下:
./configure: error: the HTTP XSLT module requires the libxml2/libxslt
libraries. You can either do not enable the module or install the libraries.

這里提示XSLT模塊不存在,在上面的編譯腳本中搜索xslt,找到了--with-http_xslt_module,刪除就可以了,同樣注意前后的空格。

成功后提示如下(其中的路徑是跟編譯腳本有關(guān)的,所以可能會略有不同):

復制代碼 代碼如下:

Configuration summary
+ using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1: using OpenSSL library
+ using system zlib library

nginx path prefix: "/etc/nginx"
nginx binary file: "/etc/nginx/sbin/nginx"
nginx configuration prefix: "/etc/nginx"
nginx configuration file: "/etc/nginx/nginx.conf"
nginx pid file: "/var/run/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/var/lib/nginx/body"
nginx dso module path: "/etc/nginx/modules"
nginx http proxy temporary files: "/var/lib/nginx/proxy"
nginx http fastcgi temporary files: "/var/lib/nginx/fastcgi"
nginx http uwsgi temporary files: "/var/lib/nginx/uwsgi"
nginx http scgi temporary files: "/var/lib/nginx/scgi"


6. 繼續(xù)編譯(make就可以了,不需要make install):
復制代碼 代碼如下:

make

7. 到objs目錄下編譯好的nginx文件:

復制代碼 代碼如下:
cd objs/

8. 停止nginx:

復制代碼 代碼如下:
service nginx stop


9. 復制objs目錄下的nginx文件到/usr/sbin/nginx目錄,覆蓋前記得備份原來文件:

復制代碼 代碼如下:
cp /usr/sbin/nginx /usr/sbin/nginx.bak
cp nginx /usr/sbin/

9. 測試nginx是否正常(/user/sbin目錄):
復制代碼 代碼如下:
nginx -t

如果出現(xiàn)syntax is ok,test is successful表示成功:

復制代碼 代碼如下:
the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful

10. 重新啟動nginx
復制代碼 代碼如下:

service nginx start


訪問服務器上一個不存在的頁面,查看服務器是否是Tengine
復制代碼 代碼如下:

403 Forbidden
You don't have permission to access the URL on this server. Sorry for the inconvenience.
Please report this message and include the following information to us.
Thank you very much!

URL: http://10.20.131.181/doc
Server: ubuntu-bak
Date: 2012/10/06 17:54:53
Powered by Tengine/1.4.0


注意看最后一行:Powered by Tengine/1.4.0 表示我們已經(jīng)成功從Nginx切換到了Tengine

相關(guān)文章

  • LNMP簡介(最新推薦)

    LNMP簡介(最新推薦)

    LNMP是指一組通常一起使用來運行動態(tài)網(wǎng)站或者服務器的自由軟件名稱首字母縮寫,L指Linux,N指Nginx,M一般指MySQL,也可以指MariaDB,P一般指PHP,也可以指Perl或Python
    2023-08-08
  • nginx配置location總結(jié)location正則寫法及rewrite規(guī)則寫法

    nginx配置location總結(jié)location正則寫法及rewrite規(guī)則寫法

    本文詳細講述了Nginx location正則寫法,Nginx 的Rewrite規(guī)則以及Nginx.conf中if指令與全局變量
    2018-10-10
  • 詳解nginx服務器綁定域名和設置根目錄的方法

    詳解nginx服務器綁定域名和設置根目錄的方法

    這篇文章主要介紹了詳解nginx服務器綁定域名和設置根目錄的方法,nginx服務器綁定域名以及設置根目錄非常方便,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-06-06
  • Nginx配置負載均衡時訪問地址無法生效的解決方法

    Nginx配置負載均衡時訪問地址無法生效的解決方法

    本文主要介紹了Nginx配置負載均衡時訪問地址無法生效的解決方法,例如負載均衡策略的設置是否正確、是否存在拼寫錯誤等,下面就來詳細的介紹一下,感興趣的可以了解一下
    2023-09-09
  • 解析nginx server_name的具體使用

    解析nginx server_name的具體使用

    nginx server_name對于正確配置虛擬主機非常重要,本文主要介紹了解析nginx server_name的具體使用,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2023-08-08
  • 配置ab來為Nginx服務器做壓力測試的方法

    配置ab來為Nginx服務器做壓力測試的方法

    這篇文章主要介紹了配置ab來為Nginx服務器做壓力測試的方法,ab是針對Apache的測試工具但本文講解其測試Nginx的過程,需要的朋友可以參考下
    2016-01-01
  • 關(guān)于Nginx服務器可視化配置問題

    關(guān)于Nginx服務器可視化配置問題

    Nginx是一款輕量級的Web 服務器/反向代理服務器及電子郵件(IMAP/POP3)代理服務器,在BSD-like 協(xié)議下發(fā)行,這篇文章主要介紹了Nginx服務器可視化配置,需要的朋友可以參考下
    2022-10-10
  • nginx日志格式分析以及修改詳解

    nginx日志格式分析以及修改詳解

    Nginx日志對于統(tǒng)計、系統(tǒng)服務排錯很有用,下面這篇文章主要給大家介紹了關(guān)于nginx日志格式分析以及修改的相關(guān)資料,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下
    2022-04-04
  • Nginx實現(xiàn)動靜分離的示例代碼

    Nginx實現(xiàn)動靜分離的示例代碼

    這篇文章主要介紹了Nginx實現(xiàn)動靜分離的示例代碼,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2019-01-01
  • 淺析Nginx配置文件中的變量的編寫使用

    淺析Nginx配置文件中的變量的編寫使用

    這篇文章主要介紹了Nginx配置文件中的變量的編寫使用,包括從常用的rewrite等方面來深入變量的相關(guān)定義,需要的朋友可以參考下
    2016-01-01

最新評論