TFS - nginx-tfs模組

來源:互聯網
上載者:User

標籤:tfs   linux   nginx   

1.安裝yajl

yajl是一個開源的JSON庫

請到這裡下載: http://lloyd.github.io/yajl/(官網)

:http://download.csdn.net/detail/wei_xiaox126/8304485

解壓檔案

unzip yajl-master.zip

./configure

make && make install

提示沒有安裝cmake, apt-get install cmake

提示有一些test的錯誤,可以直接忽略 


2.安裝nginx/tengine

1)安裝pcre

:http://download.csdn.net/detail/wei_xiaox126/8304511

tar xvf pcre-8.35.tar.gz

cd pcre-8.35

./configure --prefix=/usr/local/pcre

make

make install

2)安裝nginx

官網下載nginx-1.3.0以下的版本。(官網連結可直接百度),以下連結本人下載,已測試可用

本地串連:http://download.csdn.net/detail/wei_xiaox126/8304537

3)

下載nginx-tfs模組:https://github.com/alibaba/nginx-tfs (官網連結)

本地連結:http://download.csdn.net/detail/wei_xiaox126/8304561

unzip nginx-tfs-master.zip

tar xvf nginx-1.2.9.tar.gz

cd nginx-1.2.9

./configure --prefix=/usr/local/nginx --add-module=/‘you tfs path‘/ 

make

make install

c)配置nginx

具體配置細節參看這裡:https://github.com/alibaba/nginx-tfs/blob/master/ReadMe.markdown

vim /usr/local/tengine/conf/nginx.conf

添加以下內容:(設定檔一定要對)

http {
tfs_upstream tfs_ns {
server 10.0.0.62:8108;
type ns;
#rcs_zone name=tfs1 size=128M;
#rcs_interface eth0;
#rcs_heartbeat lock_file=/logs/lk.file interval=10s;
}

tfs_body_buffer_size 2m;

tfs_send_timeout 3s;

tfs_connect_timeout 3s;
     tfs_read_timeout 3s;

server {
listen 80;
server_name xxx.xxx.xxx.xxx;
client_max_body_size 4096m;

   tfs_keepalive max_cached=50 bucket_count=10;

#tfs_log可以無
tfs_log "pipe:/usr/sbin/cronolog -p 30min /usr/local/tengine/logs/cronolog/%Y/%m/%Y-%m-%d-%H-%M-tfs_access.log";

   location / {
tfs_pass tfs://tfs_ns;
}
}

3.啟動nginx

e) API介面測試

用tfs-tools 上傳一個檔案,獲得檔案名稱

開啟瀏覽器瀏覽:

xxx.xxx.xxx.xxx:80/v1/tfs/‘filename‘

成功!


註:歡迎大家提出建議,支出錯誤

       歡迎轉載,註明出處,謝謝!


TFS - nginx-tfs模組

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.