This document serves as documentation for the Gallery administrator to configure and troubleshoot the WebDAV module.
If you are looking for WebDAV client related instructions or for development documentation, please see:
The WebDAV URL for each album in Gallery is displayed in the WebDAV URL block. To enable this block, in Site Admin, from Admin Options, select Themes.
Alternatively, you can automatically connect with the Mount with WebDAV item link.
Lennart Poettering's Apache mod_dnssd can be used to publish Gallery and the Gallery WebDAV connection with multicast DNS / Zeroconf / DNSSD / Rendezvous / Bonjour: http://0pointer.de/lennart/projects/mod_dnssd/ http://packages.debian.org/libapache2-mod-dnssd
Add the following to your Apache config:
<IfModule mod_dnssd.c> <Location /gallery2> DNSSDServiceName "Gallery" </Location> <Location /gallery2/w> DNSSDServiceName "Gallery" DNSSDServiceTypes _webdav._tcp </Location> </IfModule>
As a result, Gallery will appear in Safari's Bonjour menu, in the Mac OS X "Connect to Server..." dialog, in the Gnome service discovery applet, etc.
More information about PHP XML support.
Your web server doesn't pass one of the WebDAV HTTP request methods to Gallery:
If your website runs on an Apache webserver, ensure that mod_dav is disabled for your website. See mod_dav.
More information about the HTTP auth module.
mod_dav is not required. Dav must be disabled (remove Dav On from your httpd.conf).
Most WebDAV clients don't support query strings. The 'Connect to WebDAV' URL rewrite rule generates short URLs without query strings.
The WebDAV spec, RFC 2518, promises the DAV header on all OPTIONS responses:
This header indicates that the resource supports the DAV schema and protocol as specified. All DAV compliant resources MUST return the DAV header on all OPTIONS responses.
The WebDAV module will return the DAV header on all responses, but some server configurations don't pass OPTIONS requests to scripts, e.g. Apache doesn't pass OPTIONS requests to CGI scripts: http://issues.apache.org/bugzilla/show_bug.cgi?id=37982
Alternatively, we can set DAV headers using Apache mod_headers and mod_rewrite. http://httpd.apache.org/docs/mod/mod_headers.html http://httpd.apache.org/docs/rewrite/
The mod_headers directives are in modules/webdav/data/options/.htaccess. The 'OPTIONS Requests' rewrite rule redirects OPTIONS requests to this directory.
If you are using Apache, you should check that mod_headers is enabled.
The URL rewrite module is needed to automatically redirect OPTIONS requests so we can set DAV headers, and to generate short URLs without query strings.
The WebDAV 'OPTIONS Requests' rule is only supported by the Apache mod_rewrite and ISAPI_Rewrite parser.
Alternatively, if you use Apache mod_rewrite, you can manually add to your Gallery .htaccess file:
RewriteCond %{REQUEST_METHOD} OPTIONS RewriteRule . /foo/gallery2/modules/webdav/data/options/ [QSA,L]
Problem:
If it seems as if the username/password is not accepted, you should check:
In that case Apache won't redirect example.com/gallery2 to example.com/gallery2/ and the native Windows WebDAV client does exactly that request.
Solution:
Just cancel when the username/password is not accepted when adding Gallery as network resource and click next in the wizard. Once Gallery is added as network resource, authentication should finally work.
If not possible, like it was for me, just try to install a webdav client (like DataFreeway), then setup your connection in this client. Then connect. After that, try again with Native Windows WebDav Client... It should work.
Tested under Apache 2.2.4 and mod_security 1.9.4 with URL Rewrite & HTTP Auth modules/plugins enabled. Client used was Windows XP "My Network Places"
Let's say you have a global (outside of any <Directory> or <VirtualHost> container) mod_security filter that deny requests other than GET, HEAD, and POST and return a "404 - file not found" (status:404) response.
SecFilterSelective REQUEST_METHOD "!^(GET|HEAD|POST)$" "id:1001,deny,log,status:404"
To bypass the filter and only allow it on a specific directory, add the following to your Apache config:
<Directory /path/to/gallery2/> Options FollowSymLinks -Indexes -Includes -IncludesNOEXEC -ExecCGI AllowOverride Options FileInfo AuthConfig .... SecFilterRemove 1001 SecFilterSelective REQUEST_METHOD "!^(GET|HEAD|POST|PROPFIND|PROPPATCH|MKCOL|LOCK|UNLOCK|MOVE|PUT|OPTIONS|DELETE|USERNAME)$" </Directory>
In the example given, "1001" ("id:1001,deny,log,status:404") is the ruleset ID assigned to the global filter. "SecFilterRemove 1001" disables the filter.
Save your changes, then restart Apache > login to Site Admin > Plugins > uninstall and reinstall the following plugin in the exact order:
- URL Rewrite, HTTP Auth then WebDav
start the Windows Explorer > browse into My Network Places > Add Network Place and paste the URL address provided by G2 to mount
As the above can be a little terse and disjointed...:
WARNING : "maintenance mode" must be disabled !! This is not compatible ! (for rewrite rules reasons)