一、修改下面3个配置文件后,重新启动apache服务器,就可以在Windows通过“映射网络驱动器”登陆了。
1. 去掉下面3行配置的注释
=========================
httpd.conf
=========================
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
# Distributed authoring and versioning (WebDAV)
# Attention! WEB_DAV is a security risk without a new userspecific configuration for a secure authentifcation
Include "conf/extra/httpd-dav.conf"
2. 删除下面的行,或者配置相应的访问规则
=========================
extra/httpd-xampp.conf
=========================
#
# New XAMPP security concept
#
# Close XAMPP security section here
<LocationMatch "^/(?i:(?:security))">
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8
ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>
# Close XAMPP sites here
<LocationMatch "^/(?i:(?:xampp|licenses|phpmyadmin|webalizer|server-status|server-info))">
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8
ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>
3. 在<LimitExcept GET OPTIONS>加上PROPFIND,如下:
=========================
extra/httpd-dav.conf
=========================
<Directory "C:/xampp/webdav">
Dav On
Order Allow,Deny
Allow from all
AuthType Digest
AuthName "XAMPP with WebDAV"
# You can use the htdigest program to create the password database:
# htdigest.exe -c "\xampp\security\webdav.htpasswd" "XAMPP with WebDAV" wampp
AuthUserFile "C:/xampp/security/webdav.htpasswd"
AuthDigestProvider file
# Allow universal read-access, but writes are restricted
# to the admin user.
<LimitExcept GET PROPFIND OPTIONS>
require valid-user
</LimitExcept>
</Directory>
二、创建用户
默认用户:xampp-dav-unsecure
默认密码:ppmax2011
创建新用户命令:
htdigest.exe -c "c:\xampp\security\webdav.htpasswd" "XAMPP with WebDAV" username
三、进一步可以通过编辑httpd-dav.conf配置文件进行权限设置