我使用 Apache(和 mod_dav_svn)通过 https 访问我服务器上的 SVN 存储库。检查存储库并添加、删除或编辑文件工作完美,但当我重命名或复制文件时,服务器在提交时返回 400 Bad Request。
Apache 配置:
<VirtualHost *:443>
ServerName ***
SSLEngine on
SSLCertificateChainFile /etc/ssl/certs/sub.class1.server.ca.pem
SSLCertificateFile /etc/ssl/certs/***.crt
SSLCertificateKeyFile /etc/ssl/private/***.key
<Location />
DAV svn
SVNParentPath /var/local/svn
SVNListParentPath on
Order deny,allow
Allow from all
</Location>
<LocationMatch /.+>
AuthzSVNAccessFile /var/local/conf/access.authz
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /var/local/conf/.htpasswd
require valid-user
</LocationMatch>
</VirtualHost>
确切的错误信息:
svn: E175002: Commit failed (details follow):
svn: E175002: COPY of /***/!svn/bc/94/***: 400 Bad Request (https://***)
SVN 服务器:
$ svnadmin --version
svnadmin, version 1.6.17 (r1128011)
我的 IDE (IntelliJ Idea 11) 使用的 SVN 客户端:
Version: 1.7
Format: 29
遗憾的是,我在 apache 错误日志中找不到任何关于该问题的提示。 关于如何解决此问题的任何建议?
编辑: 我注意到,将配置更改为
<LocationMatch /.+>
DAV svn
AuthzSVNAccessFile /var/local/conf/access.authz
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /var/local/conf/.htpasswd
require valid-user
</LocationMatch>
修复了这个问题并允许我使用 svn copy,但是当我现在尝试更新我的本地工作目录时,我得到这个错误:
svn: E190001: Unusable URI: it does not refer to this repository
svn: E175002: REPORT of '/.+/***/!svn/vcc/default': 500 Internal Server Error (***)
apache 错误日志中的错误:
[Thu Jan 23 18:00:18 2014] [error] [client 94.222.125.77] Could not parse 'src-path' URL. [500, #190001]
[Thu Jan 23 18:00:18 2014] [error] [client 94.222.125.77] Unusable URI: it does not refer to this repository [500, #190001]
最佳答案
我不确定第一个问题。
但在您更改配置后,您的第二个问题是由具有 DAV svn
指令的 LocationMatch
引起的,因为这导致每条路径都被计算为存储库。
此配置应该有效:
<Location />
DAV svn
SVNParentPath /var/local/svn
SVNListParentPath on
Order deny,allow
Allow from all
AuthzSVNAccessFile /var/local/conf/access.authz
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /var/local/conf/.htpasswd
require valid-user
</Location>
关于apache - svn COPY 导致 400 Bad Request,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21313768/