如何在Windows上配置Apache服务的SVN,以便存储库中的路径可以使用Windows域组配置访问控制?
答案 0 :(得分:1)
经过一些研究后,我想我已经研究了如何使用mod_sspi和一系列Apache Location配置指令来做到这一点。
<Location /svn>
DAV svn
SVNParentPath "D:/SvnRepos"
SVNListParentPath On
AuthType SSPI
AuthName "SVN Server"
SSPIAuth On
SSPIAuthoritative On
SSPIDomain MYDOMAIN
SSPIOfferBasic On
Require group MYDOMAIN\PRODUCT1_DEVS MYDOMAIN\PRODUCT2_DEVS
</Location>
<Location /svn/Repo/Product1>
AuthType SSPI
AuthName "SVN Product1"
SSPIAuth On
SSPIAuthoritative On
SSPIDomain MYDOMAIN
SSPIOfferBasic On
Require group MYDOMAIN\PRODUCT1_DEVS
</Location>
<Location /svn/Repo/Product2>
AuthType SSPI
AuthName "SVN Product2"
SSPIAuth On
SSPIAuthoritative On
SSPIDomain MYDOMAIN
SSPIOfferBasic On
Require group MYDOMAIN\PRODUCT2_DEVS
</Location>
这种方法的缺点是配置明智,它有点冗长,并且不适用于WebSVN。第一个我不关心的,第二个我可能会看一下以后修复。
所有Apache和SVN专家的问题。这种配置安全可靠吗?它对我来说似乎没问题,但是我还没有看到其他地方提到的这种方法,所以我在没有专家反馈的情况下部署它有点紧张,而且我们内部没有经验丰富的Apache人员。
===编辑===
最终,我决定为每个需要特定访问权限的项目设置一个单独的存储库,使用与此类似的配置。
# Publishes repository 1 at url http://localhost/svn/Repo1 used mostly by team 1.
<Location /svn/Repo1>
# DAV config.
DAV svn
# Config to publish single repository.
SVNPath "D:/SvnRepos/Repo1"
# Config to publish all repositories in directory.
#SVNParentPath "D:/SvnRepos/"
#SVNListParentPath On
# Auth config.
AuthName "SVN"
AuthType SSPI
SSPIAuth On
SSPIOfferBasic On
SSPIAuthoritative On
<RequireAny>
# Allows access to any user.
#Require valid-sspi-user
# Allows access to users belonging to specified domain group(s).
Require sspi-group DOMAIN_NAME\TEAM1
# Allows access to specified domain users.
Require sspi-user DOMAIN_NAME\user1
</RequireAny>
</Location>
# Publishes repository 2 at url http://localhost/svn/Repo2 used by several teams.
<Location /svn/Repo2>
# DAV config.
DAV svn
# Config to publish single repository.
SVNPath "D:/SvnRepos/Repo2"
AuthName "SVN"
AuthType SSPI
SSPIDomain DOMAIN_NAME
SSPIAuth On
SSPIOfferBasic On
SSPIAuthoritative On
Require sspi-group DOMAIN_NAME\TEAM1 DOMAIN_NAME\TEAM2 DOMAIN_NAME\TEAM3
</Location>
我确实想知道我的原始配置是否可以工作,如果我刚刚删除了第一个位置元素,可以访问root / svn目录,我确信我必须已经测试过,但没有时间验证现在这个。
答案 1 :(得分:0)
您需要将Apache配置为使用LDAP / AD进行身份验证,并且必须配置path-base-authorization within SVN Repository以定义permissions within存储库。