问题
I'm having a unusual problem with Ubuntu Server, Apache, Webdav and haven't been able to find an answer.
If I create a folder/file called "test.txt" then create a folder/file "test", it says the file already exists. If I delete "test.txt", then I can create a folder/file "test" it works. I can also create both from the command line on the server. Can be names other then text, e.g. jquery.ui.zip and ./jquery.ui/
I've tested is on a public server and I can create both, so I assume it's not a webdav limitation, but perhaps my configuration or apache2 webdav module causing the problem.
Perms seem ok, as I can create/copy/delete folders/files. Just a problem with naming collisions. Due to the large amount of files involved, it's simply not practical to rename them all.
Any help welcome, a nudge in the right direction would be good,
<VirtualHost *:443>
ServerName [removed]
ServerAlias [removed]
ServerAdmin [removed]
DocumentRoot /home/projects/
ErrorLog /home/projects/error.log
LogLevel warn
#Options Indexes None
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package. See
# /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
SSLCertificateFile [removed]
SSLCertificateKeyFile [removed]
Alias /projects /home/projects/
<Directory /home/projects/>
Options Indexes MultiViews
SSLOptions +StdEnvVars
AllowOverride None
Order allow,deny
allow from all
</Directory>
<Location /projects>
DAV On
AuthType Digest
AuthName "webdav1digest"
AuthUserFile [removed]
Require valid-user
ForceType text/plain
SSLOptions +StdEnvVars
Order deny,allow
Deny from all
Allow from 192.168.1.0/24
</Location>
# fixes a problem with several clients - redirects for folders with DAV methods.
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-careful
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^gvfs/*" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
</VirtualHost>
回答1:
Adding AllowOverride None
and Options None
seemed to fix the problem.
<Location /projects>
DAV On
AllowOverride None
Options None
ForceType text/plain
AuthType Digest
AuthName "webdav1digest"
AuthUserFile [removed]
Require valid-user
#SSLOptions +StdEnvVars
Order deny,allow
Deny from all
Allow from 192.168.1.0/24
</Location>
来源:https://stackoverflow.com/questions/20695683/apache-webdav-unable-to-create-test-folder-when-file-test-txt-exists