WebDav won't connect: 405 Method Not Allowed
The problem was that the Lets Encrypt setup had created a site specific ssl config that I hadn't noticed. Copied the above code into that file, and it worked fine.
Related videos on Youtube
jbhelfrich
Updated on September 18, 2022Comments
-
jbhelfrich over 1 year
I have a small server running Ubuntu 16.04. It is successfully serving webpages over https.
I want to set up webdav over https on Apache as well. I had trouble finding a tutorial that explicitly set that up and ended up using info from a couple different ones, so it's quite possible that I've done something contradictory at some point, but I have no idea what it is.
default-ssl-conf looks like this, with all the template comments removed. I haven't changed any of the settings before the Alias command except to add the DavLockDB directive.
DavLockDB /var/www/DavLock/davLock <IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin me@me DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined SSLEngine on SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> # My Webdav config starts here Alias "/webdav" "/var/www/webdav" <Directory /var/www/webdav> DAV on DirectoryIndex disabled AuthType Digest AuthName "webdav" AuthUserFile /etc/apache2/users.password Require valid-user </Directory> </VirtualHost>
Connecting via cadaver, to either localhost or the fully qualified name, gets the same response:
jbhelfrich@arm:/etc/apache2/sites-available$ cadaver https://localhost/webdav Could not access /webdav/ (not WebDAV-enabled?): 405 Method Not Allowed Connection to `localhost' closed.
I've tried it without /webdav as well, and get the same basic response. /var/www/DavLock and /var/www/webdav are both owned by www-data
/var/logs/apache2/access.log shows
::1 - - [10/Aug/2016:20:07:44 +0000] "OPTIONS / HTTP/1.1" 200 229 "-" "cadaver/0.23.3 neon/0.30.1" ::1 - - [10/Aug/2016:20:07:44 +0000] "PROPFIND / HTTP/1.1" 405 501 "-" "cadaver/0.23.3 neon/0.30.1"
error.log shows nothing relevant, and other_vhosts_access.log is empty.
alias, dav_fs, dav, and dav_lock modules are all enabled.
Anyone see what I'm missing?