我在FreeBSD 7.2上运行Apache 2.2上的Subversion 1.6。
我们的Apache / SVN服务器是这样设置的,当我们访问http://svn.example.gov/时,我们得到一个存储库列表。 下面是一个简单的示例configuration。 实际的configuration涉及LDAP,但希望这不会有问题。
# All users can access this directory <Location /> DAV svn SVNParentPath /data/svn # list all repos under /data/svn SVNListParentPath on SSLRequireSSL AuthName "Use your work password" AUthType Basic AuthUserFile /etc/apache22/htpasswd Require User admin customer1 customer2 </Location>
我想分成三个视图。 一个用于'/'(对于pipe理人员),一个用于'/ repo1'(用于customer1)和一个用于'/ repo2'(用于customer2),如下所示。 但是,当我尝试这个时,我得到以下错误:
客户端。 这个错误是错误的,因为我没有现有的工作副本。 我正在尝试检出一个新的工作副本:
$ svn co https://svn.example.gov/repo1/ svn: Repository moved permanently to 'https://svn.example.gov/repo1/'; please relocate
服务器端:
Jul 6 17:47:51 svn httpd[98216]: [error] [client 10.10.10.176] Could not fetch resource information. [301, #0] Jul 6 17:47:51 svn httpd[98216]: [error] [client 10.10.10.176] (2)No such file or directory: Requests for a collection must have a trailing slash on the URI. [301, #0]
这是我的新例子configuration:
# All users can access this directory <Location /> DAV svn SVNParentPath /data/svn # list all repos under /data/svn SVNListParentPath on SSLRequireSSL AuthName "Use your work password" AUthType Basic AuthUserFile /etc/apache22/htpasswd Require User admin </Location> # Only customer1 can access this repo <Location /repo1> DAV svn SVNPath /data/svn/repo1 Require User customer1 </Location> # Only customer2 can access this repo <Location /repo2> DAV svn SVNPath /data/svn/repo2 SSLRequireSSL Require User customer2 </Location>
<Location />和<Location /repo1>部分都适用于/repo1 URIpath,因此它们都按顺序处理。 请参阅http://httpd.apache.org/docs/2.2/sections.html 。
所以你要重复一些指令,我敢打赌,他们并不满意。 尤其是:
在Subversion版本库的configuration块中,必须存在[SVNPath]或SVNParentPath,但不能同时存在。
http://svnbook.red-bean.com/en/1.5/svn.ref.mod_dav_svn.conf.html
你有两个申请/repo1 。
我也不确定多个Require指令是如何工作的,对文档的快速扫描并不能启发我,但是您可以尝试并找出答案。
我build议先将pipe理视图放在/admin而不是根目录下,以避免复杂的多个<Location />部分同时应用。 然后,当这个工作,弄清楚如何分解常见的指令,使像上述工作的设置。 (也许你已经这样做了,然后你可以跳到第二步。)