mod_dav issues: method PUT is not allowed

Discussion in 'Apache' started by tametick, Jun 7, 2010.

  1. #1
    Hi,
    I'm trying to enable PUT requests on a server in a secure internal network (apache 2.2.15 on windows 7).

    in httpd.conf I've enabled mod_dav:

    LoadModule dav_module modules/mod_dav.so
    LoadModule dav_fs_module modules/mod_dav_fs.so
    LoadModule dav_lock_module modules/mod_dav_lock.so
    Code (markup):
    And configured the directory "files" to allow uploads via PUT:
    DavLockDB "C:\Server\apache_fs\Apache2.2\DAVLock"
    <Location /files>
    	Order Allow,Deny
    	Allow from all
    	Dav On
        <Limit PUT>
            Order allow,deny
            Allow from all
        </Limit>
    </Location>
    Code (markup):
    But when I try to upload a file with curl via PUT (-T) I get the following error:
    
    c:\curl>curl -T curl.exe [snipped url]/files
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>301 Moved Permanently</title>
    </head><body>
    <h1>Moved Permanently</h1>
    <p>The document has moved <a href="[snipped url]/files/">here</a>
    .</p>
    </body></html>
    
    Code (markup):
    Any ideas what's going on? The directory C:\Server\apache_fs\htdocs\files exists and is write enabled and DocumentRoot is "C:/server/apache_fs/htdocs".

    C:\Server\apache_fs\Apache2.2\DAVLock also exists and is write enabled.


    PS: when deleting the "files" directory the error message changes to "405 Method Not Allowed":
    
    c:\curl>curl -T curl.exe http://.../files
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>405 Method Not Allowed</title>
    </head><body>
    <h1>Method Not Allowed</h1>
    <p>The requested method PUT is not allowed for the URL /files.</p>
    </body></html>
    
    Code (markup):
     
    Last edited: Jun 7, 2010
    tametick, Jun 7, 2010 IP