當前位置:
首頁 > 知識 > Tengine-2.1.0的安裝與配置

Tengine-2.1.0的安裝與配置

※依賴庫:

PCRE

OpenSSL

Zlib

jemalloc

※安裝方式:

Linux下解壓,執行:

./configure

make

make install

一、庫文件

tar -jxvfjemalloc-3.6.0.tar.bz2 -C /usr/local/src

sudo apt-get installopenssl libssl-dev

tar -jxvfpcre-8.36.tar.bz2 -C /usr/local/src

tar -xvfzlib-1.2.8.tar.gz -C /usr/local/src

wgethttp://tengine.taobao.org/download/tengine-2.1.0.tar.gz

tar -zxvftengine-2.1.0.tar.gz

cd tengine-2.1.0

二、tengine-2.1.0安裝

在tengine-2.1.0根目錄下執行:

./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/src/pcre-8.36--with-jemalloc=/usr/local/src/jemalloc-3.6.0 --with-http_gzip_static_module--with-http_realip_module --with-http_stub_status_module--with-http_concat_module --with-zlib=/usr/local/src/zlib-1.2.8 --user=elvis --group=elvis

』--user=elvis --group=elvis『 可不寫

注意配置的時候–with-pcre、–with-openssl、–with-jemalloc、–with-zlib的路徑為源文件的路徑

make

make install

三、配置

打開nginx.conf配置文件後,最基礎的需要做以下幾個地方的修改(/usr/local/nginx/conf/nginx.conf)

[html] view plain copy

  1. --user=elvis
  2. #自動以CPU核心數啟動相應數量的進程
  3. worker_processes auto;
  4. #全局的錯誤日誌地址,方便調試
  5. error_log/home/jason/BigDisk/nginx/error.log;
  6. #開啟gzip支持
  7. gzip on
  8. server {
  9. #設置默認訪問的server(default是指通過ip或者servername未定義的域名進行訪問時就走到這個server)
  10. listen 80 default;
  11. #默認訪問的路徑
  12. root /home/jason/Work/nginx-default;
  13. location / {
  14. index index.php index.html index.htm;
  15. }
  16. #默認錯誤頁面
  17. error_page 500 502 503 504 /50x.html;
  18. location = /50x.html {
  19. root html;
  20. }
  21. #抓發到php-fpm
  22. location ~ .php$ {
  23. fastcgi_pass unix:/var/run/php-fpm.socket;
  24. fastcgi_index index.php;
  25. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  26. include fastcgi_params;
  27. }
  28. }

#引用其他的vhost配置文件

include vhost/*.conf;四、啟動

wget --no-check-certificate "http://raw.github.com/JasonGiedymin/nginx-init-ubuntu/master/nginx"-O /etc/init.d/nginx

chmod 777/etc/init.d/nginx

/etc/init.d/nginxstart

瀏覽器輸入主機ip即可訪問

中途出現問題,隨時可以來問我。

Tengine-2.1.0的安裝與配置

喜歡這篇文章嗎?立刻分享出去讓更多人知道吧!

本站內容充實豐富,博大精深,小編精選每日熱門資訊,隨時更新,點擊「搶先收到最新資訊」瀏覽吧!


請您繼續閱讀更多來自 程序員小新人學習 的精彩文章:

Discuz全版本任意文件刪除漏洞
Matlab對深度學習工具包DeepLearnToolbox的例子實現

TAG:程序員小新人學習 |