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
- --user=elvis
- #自動以CPU核心數啟動相應數量的進程
- worker_processes auto;
- #全局的錯誤日誌地址,方便調試
- error_log/home/jason/BigDisk/nginx/error.log;
- #開啟gzip支持
- gzip on
- server {
- #設置默認訪問的server(default是指通過ip或者servername未定義的域名進行訪問時就走到這個server)
- listen 80 default;
- #默認訪問的路徑
- root /home/jason/Work/nginx-default;
- location / {
- index index.php index.html index.htm;
- }
- #默認錯誤頁面
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- #抓發到php-fpm
- location ~ .php$ {
- fastcgi_pass unix:/var/run/php-fpm.socket;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- }
#引用其他的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即可訪問
中途出現問題,隨時可以來問我。
※Discuz全版本任意文件刪除漏洞
※Matlab對深度學習工具包DeepLearnToolbox的例子實現
TAG:程序員小新人學習 |