WebDAV 405 Method Not Allowed

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
rossi123
n00b
n00b
Posts: 10
Joined: Mon Jan 14, 2008 8:19 am
Location: Wien
Contact:

WebDAV 405 Method Not Allowed

Post by rossi123 »

Hi,
i posted this question in the german group. i am sorry about this double-posting, but i really need to get this work until wednesday.

i installed webdav, but it alway says "405 Method Not Allowed". i'd like to access to the "/efin"-directory. NOT depending on parameters given to cadaver it alway rejects the path. i also tried to add an useraccount (like https://user@localhost/efin").
/var/dav # cadaver https://localhost/efin
WARNING: Untrusted server certificate presented for `localhost':
Issued to: Test Certificate, Apache HTTP Server
Issued by: For testing purposes only, Apache HTTP Server
Certificate is valid from Sat, 05 Nov 2005 23:05:21 GMT to Sun, 05 Nov 2006 23:05:21 GMT
Do you wish to accept the certificate? (y/n) y
Could not access /efin/ (not WebDAV-enabled?):
405 Method Not Allowed
Connection to `localhost' closed.
dav:!>
(it is not relevant whether i use http or https exept for the untrusted certificate)

/etc/apache2/modules.d/45_mod_dav.conf:
(i also tried to unmark the remarks, but nothing changed)

Code: Select all

Alias /efin /var/dav/mydavserver
<Directory /var/dav/mydavserver>
        Options None
        Dav On
#       AllowOverride None
#       Order allow,deny
#       Allow from all
        <Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
                AuthType Basic
                AuthName "WebDav Restricted Repository"
                AuthUserFile /var/dav/.davpasswd
                Require valid-user
        </Limit>
</Directory>
/etc/conf.d/apache2:

Code: Select all

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D PHP5 -D DAV -D DAV_FS -D SVN -D SVN_AUTHZ"
Needed directories and the password-file (generated with htpassword2):

Code: Select all

/var/dav # l
537546249 0 drwxr-xr-x  3 apache apache  100 Mar 30 21:42 .
671089061 4 drwxr-xr-x 15 root   root   4096 Mar 30 11:04 ..
537546251 4 -rw-r--r--  1 apache apache   20 Mar 30 19:49 .davpasswd
604259106 0 drwxrwxrwx  2 apache apache    6 Mar 30 11:04 mydavserver
/var/log/apache2/ssl_request_log:

Code: Select all

[30/Mar/2008:22:04:01 +0000] 127.0.0.1 TLSv1 DHE-RSA-AES256-SHA "OPTIONS /efin/ HTTP/1.1" -
[30/Mar/2008:22:04:01 +0000] 127.0.0.1 TLSv1 DHE-RSA-AES256-SHA "PROPFIND /efin/ HTTP/1.1" 291
/var/log/apache2/sl_access_log:

Code: Select all

127.0.0.1 - - [30/Mar/2008:22:04:01 +0000] "OPTIONS /efin/ HTTP/1.1" 200 -
127.0.0.1 - - [30/Mar/2008:22:04:01 +0000] "PROPFIND /efin/ HTTP/1.1" 405 291
/var/log/apache2/sl_error_log has no relevant entries

Thanks for your assistance in advance.

best regards
Markus
User avatar
jquinte
n00b
n00b
Posts: 74
Joined: Tue May 01, 2007 7:12 pm
Location: Berlin, Germany

Post by jquinte »

Same problem here. Does anyone have any ideas? :(
grumblebear
Apprentice
Apprentice
Posts: 206
Joined: Tue Feb 26, 2008 12:35 am

Post by grumblebear »

Did you really supply a valid username/password pair from /var/dav/.davpasswd?
Try to comment out the LIMIT directive.
User avatar
jquinte
n00b
n00b
Posts: 74
Joined: Tue May 01, 2007 7:12 pm
Location: Berlin, Germany

Post by jquinte »

I found the error that caused this weird behaviour.
There was a line in the 45_mod_dav.conf file that said:

Code: Select all

<IfModule auth_basic_module>
and that module was not included in the APACHE2_MODULES line in /etc/make.conf.
I'm now trying to fine tune the security.
meow
n00b
n00b
Posts: 22
Joined: Tue Mar 18, 2003 2:57 am

Post by meow »

After much trial and error, managed to get the webdav going with apache 2.2.8.

I have to use the location directive and I can't turn on authentication somehow and have to recreate 45_mod_dav.conf with just these:

DavLockDB /var/lib/dav/lockdb
Alias /upload "/home/intranet/calendar"
<Location /upload>
DAV On
</Location>

Hope these help those who are having problem with "405 Method Not Allowed" error message.
User avatar
jquinte
n00b
n00b
Posts: 74
Joined: Tue May 01, 2007 7:12 pm
Location: Berlin, Germany

Post by jquinte »

Hi, rossi123!
Do you have the proper authentication module loaded? Can you check that?
Because, as I wrote in my last post, that was exactly my problem.

What happen if you try commenting out the lines of the "Limit" block?

P.S.: Do not forget to put SOLVED in the title if you consider that the problem has been solved.
Post Reply