【英文】Apache启动PUT请求

Preface

Starting a PUT Request in Apache

Starting a PUT Request

Enabling Modules

  • Modify the configuration file and uncomment lines 161 and 173

For MacOS:

/usr/local/etc/httpd/httpd.conf
1
2
LoadModule dav_module lib/httpd/modules/mod_dav.so
LoadModule dav_fs_module lib/httpd/modules/mod_dav_fs.so

For Windows:

Apache/conf/httpd.conf
1
2
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so

Enabling the Module

  • Inside the <Directory /></Directory> tags between lines 231 and 234 in the configuration file, add DAV On
/usr/local/etc/httpd/httpd.conf
1
2
3
4
<Directory />
...
DAV On
</Directory>

Enabling File Locks

  • Create a file lock named DavLock in the root directory of the site (the file has no extension)
1
2
+ /usr/local/var/www
- DavLock
  • Add the configuration for the file lock’s location in the empty space of the configuration file

<dir>: The root directory of the site. For example, the root directory of Apache installed by Brew on a Mac is /usr/local/var/www.

1
DavLockDB <dir>/DavLock

Uploading a File with PUT

/info.php: The path and filename to upload to
<?php phpinfo();?>: The content to write

1
2
3
4
5
PUT /info.php HTTP/1.1
Host: 127.0.0.1
Content-Length: 18

<?php phpinfo();?>

Done

References

哔哩哔哩 - 千锋教育网络安全学院