日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

java webdav服务,nginx+webdav

發布時間:2025/3/21 65 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java webdav服务,nginx+webdav 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1、配置Nginx以支持WebDav:

Webdav是nginx一個組件,默認編譯nginx時是沒有安裝這個組件的。

如果跟應用公用一個nginx,需要重新編譯安裝nginx,重新安裝前需要備份好原來的nginx.conf。

1.1編譯安裝

上傳nginx源碼nginx-1.12.2.tar.gz到/root目錄下。

$ tar zxvf nginx-1.12.2.tar.gz????? //解壓nginx源碼

$ cd nginx-1.12.2

$ ./configure --prefix=/opt/nginx --with-http_dav_module?? //編譯時增加web_dav模塊

$ make && make install

Nginx成功安裝在/opt/nginx目錄下

1.2 webdav配置

1.2.1 編輯nginx.conf

$ vi /opt/nginx/conf/nginx.conf

在server中添加如下配置信息:

這里拿我本機的ambari 為例

location /ambari{

root /opt/apps/www/html;

index index.html index.htm;

autoindex on;

## webdav config

client_body_temp_path /tmp;

dav_methods PUT DELETE MKCOL COPY MOVE;

create_full_put_path on;

dav_access group:rw all:r;

}

如下圖所示:

1.2.2、Nginx的root目錄/opt/apps/www/html默認是只讀的,需要加寫權限:

$ mkdir –P ? ? /opt/apps/www/html/ambari;

$ chmod 777 /opt/apps/www/html

1.2.3、重啟nginx:

$ cd /opt/nginx/sbin

$ ./nginx -t $ nginx -s reload

1.2.4 測試webdav:

$ cd /root

$ echo "this is t.txt!" > t.txt $ curl -T t.txt 192.168.1.101/ambari/t.txt $ ll /opt/apps/www/html

(可以看到t.txt上傳到了這里) $ curl 192.168.1.101/ambari/t.txt //查看文件中內容

總結

以上是生活随笔為你收集整理的java webdav服务,nginx+webdav的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。