为什么 Apache SVN 存储库列表显示为空?

Why does Apache SVN repository list show empty?

我正在从 Windows 机器上的 Visual SVN 迁移到 Linux 机器上通过 Apache 服务的 SVN。到目前为止,大部分都是成功的。如果我将单个存储库的完整 URL 放入 Web 浏览器,我可以在多台机器的命令行上通过 svn 访问存储库并浏览存储库内容。它还正确地需要身份验证。

但是,当我在浏览器中转到根目录 (/svn) 时,我得到一个 存储库列表。我在互联网上发现了很多关于列表被阻止的情况的帖子,即你得到的是 HTTP 403 而不是列表,但那是 不是 我的情况。我得到一个列表 - 它恰好是空的。这在浏览器中显示为格式良好的页面,<ul></ul> 标记之间没有任何内容,并且在 Apache 日志中显示为给定的成功 (HTTP 200) 响应。

所以问题是为什么会发生这种情况以及如何解决它?

配置:

<VirtualHost *:80>
        ServerName svn.example.com
        Alias /svn /var/lib/svn
        <Location /svn>
                DAV svn
                SVNParentPath "/var/lib/svn/"
                SVNListParentPath On
                AuthType Basic
                AuthName "My Software Repository"
                AuthUserFile /etc/apache2/dav_svn.passwd
                Require valid-user
        </Location>
        RedirectMatch ^/$ /svn
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

这台机器上有多个虚拟主机。我只展示了 SVN 主机部分。

这是我在浏览器中导航到 svn.example.com/svn 时返回的 HTML(验证后):

<html><head><title>Collection of Repositories</title></head>
<body>
 <h2>Collection of Repositories</h2>
 <ul>
 </ul>
 <hr noshade><em>Powered by <a href="http://subversion.apache.org/">Apache Subversion</a> version 1.9.5 (r1770682).</em>
</body></html>

在添加 SVNListParentPath on 部分之前,我收到的是 HTTP 403,并且需要强调的是,这是我在这里和其他地方最常看到的情况。但这不是我的情况。

删除行 Alias /svn /var/lib/svn 似乎解决了问题,没有引起任何新问题。

我在处理 "redirect cycle" 时无意中发现了这个问题,该问题由另一个与此无关的问题的答案之一解决:What is the cause of "svn: E195019: Redirect cycle detected for URL"?