0x00 前言:
最近整理了一下各种http请求,发现xampp里apache默认没支持put请求,所以有此文记录配置apache开启对put请求的支持。
0x01 环境:
win7+xampp
0x02 步骤:
1.在httpd.conf中把下面两行的注释去掉(先看看有没有这两个模块,应该有的)
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
2.修改httpd.conf某段如下
DocumentRoot “C:/xampp/htdocs”
<Directory “C:/xampp/htdocs”>
#
# Possible values for the Options directive are “None”, “All”,
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that “MultiViews” must be named *explicitly* — “Options All”
# doesn’t give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
#AllowOverride All#
# Controls who can get stuff from this server.
#
Require all granted
Dav On
AllowOverride None
Options All
Order allow,deny
Allow from all
</Directory>
<Directory “C:/xampp/htdocs”>
#
# Possible values for the Options directive are “None”, “All”,
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that “MultiViews” must be named *explicitly* — “Options All”
# doesn’t give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Includes ExecCGI#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
#AllowOverride All#
# Controls who can get stuff from this server.
#
Require all granted
Dav On
AllowOverride None
Options All
Order allow,deny
Allow from all
</Directory>
3.解决webdav锁的问题
新建文件DavLock,在httpd.conf中新增一行如下(路径写对应的DavLock文件所在路径)
DavLockDB C:/xampp/htdocs/DavLock
0x03 效果:
target url: 192.168.0.101
http method: put
upload file name: 111.png
local file path: /root/Pictures/1.png
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
<html><head>
<title>201 Created</title>
</head><body>
<h1>Created</h1>
<p>Resource /111.png has been created.</p>
<hr />
http method: put
upload file name: 111.png
local file path: /root/Pictures/1.png
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
<html><head>
<title>201 Created</title>
</head><body>
<h1>Created</h1>
<p>Resource /111.png has been created.</p>
<hr />
成功put文件!