十年網(wǎng)站開發(fā)經(jīng)驗 + 多家企業(yè)客戶 + 靠譜的建站團隊
量身定制 + 運營維護+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
支持put上傳需要修改以下配置
http.conf
//打開下面兩個module
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
//增加一下配置,允許Apache支持put方法
Dav On
AllowOverride None
Options ALL
Order allow,deny
Allow from all
DavLockDB DavLock
除此之外,想要通過put上傳文件,需要建立一個文件夾 DavLock
文件目錄位置為 ./Apache/DavLock
為Apache安裝目錄下增加一個鎖文件
WebDAV使得應用程序可以直接將文件寫到 Web Server 上,
并且在寫文件時候可以對文件加鎖,寫完后對文件解鎖,還可以支持對文件所做的版本控制。
基于 WebDAV可以實現(xiàn)一個功能強大的內(nèi)容管理系統(tǒng)或者配置管理系統(tǒng)。
PUT /test.txt HTTP/1.1
Accept: */*
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Win32)
Host: 127.0.0.1
hello world
COPY /test.txt HTTP/1.1
Host: test.com
Destination: http://test.com/test.asp
MOVE /dir_name/test.aspx HTTP/1.1
Destination: /test.aspx
Host: test.com
//MOVE方法要求移動的文件不在同一個文件夾內(nèi)
PUT,COPY,MOVE等方法執(zhí)行成功后服務器響應的返回值都會是201
使用BurpSuit的Repeater模塊發(fā)包
創(chuàng)新互聯(lián)成立于2013年,先為大通等服務建站,大通等地企業(yè),進行企業(yè)商務咨詢服務。為大通企業(yè)網(wǎng)站制作PC+手機+微官網(wǎng)三網(wǎng)同步一站式服務解決您的所有建站問題。
Request請求包
PUT /test.txt HTTP/1.1
Accept: */*
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Win32)
Host: 127.0.0.1
Content-Length: 35
hello world" ?>
Respons響應包
HTTP/1.1 201 Created
Date: Fri, 22 Dec 2017 09:46:32 GMT
Server: Apache/2.4.23 (Win32) OpenSSL/1.0.2j PHP/5.5.38
Location: http://127.0.0.1/test.txt
Content-Length: 181
Content-Type: text/html; charset=ISO-8859-1
201 Created
Created
Resource /test.txt has been created.
Request請求包
COPY /test.txt HTTP/1.1
Accept: */*
Accept-Language: en-US
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Win32)
Host: 127.0.0.1
Destination: http://127.0.0.1/test.php
Content-Length: 2
\r\n
\r\n
#必須要有兩個回車,便于理解使用(\r\n)表明,實際直接敲兩個回車就好。
Respons響應包
HTTP/1.1 201 Created
Date: Fri, 22 Dec 2017 09:56:11 GMT
Server: Apache/2.4.23 (Win32) OpenSSL/1.0.2j PHP/5.5.38
Location: http://127.0.0.1/test.php
Content-Length: 184
Content-Type: text/html; charset=ISO-8859-1
201 Created
Created
Destination /test.php has been created.
Request請求包
GET /test.php HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: http://127.0.0.1/
Connection: close
Upgrade-Insecure-Requests: 1
Respons響應包
HTTP/1.1 200 OK
Date: Fri, 22 Dec 2017 10:07:57 GMT
Server: Apache/2.4.23 (Win32) OpenSSL/1.0.2j PHP/5.5.38
X-Powered-By: PHP/5.5.38
Content-Length: 19
Connection: close
Content-Type: text/html
hello world
Request請求包
GET /test.txt HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: http://127.0.0.1/
Connection: close
Upgrade-Insecure-Requests: 1
Respons響應包
HTTP/1.1 200 OK
Date: Fri, 22 Dec 2017 10:09:23 GMT
Server: Apache/2.4.23 (Win32) OpenSSL/1.0.2j PHP/5.5.38
Last-Modified: Fri, 22 Dec 2017 09:46:32 GMT
ETag: "1a-560eab110da27"
Accept-Ranges: bytes
Content-Length: 26
Connection: close
Content-Type: text/plain
echo "hello world"