2

I'm trying to enable HTTP-DAV on Apache (httpd.x86_64 2.2.3-43.el5.centos) running on CentOS 5.4.

I have the following relevant entries in my httpd.conf.

LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so

<IfModule mod_dav_fs.c>
    DAVLockDB /var/lib/dav/lockdb
</IfModule>

<Location /var/www/html/updates>
    Dav On
</Location>

/var/www/html/ is the Apache root. I have reloaded Apache without any errors in the error log. I can also access this directory via HTTP in Firefox.

I have an application under development which needs to communicate with the web server over HTTP-DAV, but instead reports that the web server returned "(405) Method not allowed". This happens when it sends a PROPFIND request.

Apache's access log reports the following when that happens:

192.168.1.29 - - [25/Nov/2010:17:21:26 +0200] "PROPFIND /updates/2.0.1.0/ HTTP/1.1" 405 320 "-" "-"

Presumably HTTP-DAV isn't enabled. What am I doing wrong?

Reply to pacey: There are no Limit or LimitExcept Directives in any of Apache's configuration files. There is no .htaccess file in /var/www/html/updates/ or /var/www/html/.

Reply to Zoredache: Apache has write access to updates.

Reply to iiegn: I gave cadaver a try. Apparently WebDAV's not enabled.

dav:!> open http://hybrid/updates/
Could not access /updates/ (not WebDAV-enabled?):
405 Method Not Allowed
Connection to `hybrid' closed.

The only relevant thing in the logs (LogLevel debug) is in the access log:

192.168.1.240 - - [26/Nov/2010:14:41:45 +0200] "OPTIONS /updates/ HTTP/1.1" 200 - "-" "cadaver/0.22.3 neon/0.25.5"
192.168.1.240 - - [26/Nov/2010:14:41:45 +0200] "PROPFIND /updates/ HTTP/1.1" 405 319 "-" "cadaver/0.22.3 neon/0.25.5"
  • are there any <Limit> or LimitExcept Directives in the apache configuration? – pacey Nov 25 '10 at 15:50
  • maybe the error log will tell you more? – Mike Nov 25 '10 at 16:04
  • Does the apache user have write access to /updates/? – Zoredache Nov 25 '10 at 21:21
  • is there a .htaccess file in the path to /var/www/html/updates which gets evaluated? If so, what are the contents. – pacey Nov 26 '10 at 9:30
6

I finally figured it out.

Instead of

<Location /var/www/html/updates>
    Dav On
</Location>

it needs to be (Directory instead of Location)

<Directory /var/www/html/updates>
   Dav On
</Directory>
  • hm, then there seems to be some interaction with, i guess, /var/www being DocRoot or other (Directory) settings further up the path. i have dav working on a <Location /some/path> with /some/path not being part of any other setting. – iiegn Nov 26 '10 at 13:51
  • 1
    I have the same problem (405 error) but I am using Directory. – Brad Aug 4 '11 at 18:37
  • 2
    DAV will not work on a directory if DirectoryIndex is enabled and the index file exists (usually index.html). I guess the two situations require different responses for the same HTTP request. – migle Oct 10 '15 at 18:08
  • This worked, but I don't understand why... The docs specify the use of mod_dav with Location tags... httpd.apache.org/docs/2.2/mod/mod_dav.html – regulatre Dec 7 '15 at 20:52
1

The set-up seems sufficient.

To test the set-up you could try cadaver, the command-line WebDAV client for Unix. There, start with something like "> open URL" to see whether you can open a connection. Then, "> propget ." or "> ls"

...and with the PROPFIND request pay attention to: http://httpd.apache.org/docs/2.2/mod/mod_dav.html#davdepthinfinity.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.