我不知道如何禁用“。well-known”目录的身份validation。
当我删除特定于SVN的指令(DAV,SVNPath,AuthzSVNAccessFile)时,情况就像预期的那样。
<VirtualHost *:443> ServerName www.example.com DocumentRoot "C:/www.example.com" ServerAdmin [email protected] SSLEngine On SSLCertificateFile "C:/Apache2/conf/ssl/www.example.com.crt" SSLCertificateKeyFile "C:/Apache2/conf/ssl/www.example.com.key" <Location /> DAV svn SVNPath "C:/svnrepo" SSLRequireSSL AuthName "www.example.com" AuthType Basic AuthUserFile "conf/svn/svn-users.txt" AuthGroupFile "conf/svn/svn-groups.txt" AuthzSVNAccessFile "conf/svn/svn-access.txt" Require valid-user </Location> <Location "/.well-known"> Satisfy Any Allow from all Require all granted #AuthType None # Apache 2.4 only </Location> </VirtualHost>
编辑:这也将工作,如果我没有重叠的path。 例如使用/ svn和/.well-known。 不幸的是,这不是我现在可以轻易改变的东西。
在您的webroot中,使用以下内容创build一个文件.htaccess :
Options +Indexes <IfModule mod_rewrite.c> RewriteRule "/\.|^\.(?!well-known/)" - [F] </IfModule>
你需要启用ModRewrite才能工作。
你可以检查Apache Directory选项。 波纹pipe是一个configuration示例:
<Directory /home/html/myfolder/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory>