3

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"
Peter Mortensen
  • 2,318
  • 5
  • 23
  • 24
Manos Dilaverakis
  • 327
  • 3
  • 4
  • 9

2 Answers2

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>
Peter Mortensen
  • 2,318
  • 5
  • 23
  • 24
Manos Dilaverakis
  • 327
  • 3
  • 4
  • 9
  • 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 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 04 '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... http://httpd.apache.org/docs/2.2/mod/mod_dav.html – regulatre Dec 07 '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.

Peter Mortensen
  • 2,318
  • 5
  • 23
  • 24
iiegn
  • 304
  • 2
  • 3