我有一个svn在svn.example.com设置
我有SVNParentPath设置列出目录中的所有回购。
当我启用AuthzSVNAccessFile时,列表页面会返回403,而我可以直接以svn.example.com/repo名称正确访问repos。
<VirtualHost *:80> ServerName svn.example.com DocumentRoot /var/www/svn <Location /> DAV svn AuthType Basic AuthName "svn.example.com" AuthUserFile /etc/apache2/svn/users.passwd AuthzSVNAccessFile /etc/apache2/svn/authz SVNParentPath /var/svn SVNListParentPath on Require valid-user </Location> </VirtualHost>
[groups] admin = user1. user2, user3 [/] @admin = rw
The URI does not contain the name of a repository. [403, #190001] Could not fetch resource information. [500, #0] Could not open the requested SVN filesystem [500, #2] Could not open the requested SVN filesystem [500, #2]
svn.example.com:80 *myIP* - user1 [18/Nov/2010:13:56:53 +0000] "GET / HTTP/1.1" 403 274 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7"
…你有没有试过一个<Location /svn/>
– 尾随slah! 在那里: http : //www.svnforum.org/2017/viewtopic.php? t =6443人们似乎已经解决了“非root-dir案件”的问题。
…至less,你知道在哪里看得更远(mod-rewrite …?)。
进一步审查,我第二iiegn的答案。 我能够删除SVN 1.6.13的问题,通过添加一个没有斜线的尾部斜线和别名,就像文章所暗示的那样。
上一个响应:
我在StackOverflow上find了一个答案,在https://stackoverflow.com/questions/488778/how-do-i-list-all-repositories-with-the-svnparentpath-directive-on-apachesvn ,它声明添加:
SVNListParentPath On
这与http://svnbook.red-bean.com/en/1.5/svn.ref.mod_dav_svn.conf.html上的内容相符,其中指出:
SVNListParentPath On | Off
当设置为On时,允许SVNParentPath的GET,这会导致列出该path下的所有存储库。 默认设置是closures。
这应该解决403问题。
AuthzSVNAnonymous On AuthzSVNNoAuthWhenAnonymousAllowed On Satisfy Any
首先,你需要Satisfy Any
指令,如果运行组合的开放/authentication回购(即我有一些地区包含开源一些封闭的来源),你也需要匿名行。
正如我在这里升级在这里: http : //www.saiweb.co.uk/linux/mod_authz_svn-mod_dav_svn-prompting-for-password
validationSVNParentPath / var / svnpath是否存在于/ var / svn,并且可以通过apache访问和写入,否则你可能会将其归为root:root chown -R apache:apache /var/svn
我有相同的问题,在自己的子域上托pipeSubversion。 似乎需要像[]这样的configuration,但似乎只是导致一个无声的错误,渲染文件被完全忽略。 以下是我无法工作的变通办法,但可能会给你一些build议:
<location />
部分并将第一个重命名为<location /index/>
部分 我花了几分钟尝试了这一点,但没有太多的运气。 我会更新这个答案,如果我find一个方法来做这个工作,或更好的解决scheme。
我有同样的问题,并find以下解决方法。 主要思想是不要将“AuthzSVNAccessFile”应用到根,但申请其余的。 适用于apache2.2(Ubuntu Server 12.04)。
<VirtualHost *:80> ... <Location /> ... </Location> <Location /.+> AuthzSVNAccessFile /path/to/the/access/file </Location> </VirtualHost>
更新 (完整configuration):
<VirtualHost *:80> ServerAdmin [email protected] ServerName svn.company.lan <Location /> # Enable Subversion DAV svn # Directory containing all repository for this path SVNListParentPath on SVNParentPath /opt/subversion # LDAP Authentication & Authorization is final; do not check other databases AuthzLDAPAuthoritative on AuthBasicProvider ldap # Do basic password authentication in the clear AuthType Basic # The name of the protected area or "realm" AuthName "Subversion Repository" # The LDAP query URL # Format: scheme://host:port/basedn?attribute?scope?filter # The URL below will search for all objects recursively below the basedn # and validate against the sAMAccountName attribute AuthLDAPURL "ldap://dc1.company.com/dc=serv,dc=company,dc=com?sAMAccountName?sub" AuthLDAPBindDN "CN=svn1user,OU=ou1,DC=company,DC=com" AuthLDAPBindPassword "PASS" # Require authentication for this Location Require valid-user </Location> # <LocationMatch /.+> is a really dirty trick to make listing of repositories work (http://d.hatena.ne.jp/shimonoakio/20080130/1201686016) <LocationMatch /.+> AuthzSVNAccessFile /opt/subversion/subversion.perm </LocationMatch> </VirtualHost>