2

嗨,

我实现了一个 SVN 服务器,它通过 LDAP 协议针对 AD 对用户进行身份验证。我使用 apache2 版本 2.2.14 来访问存储库 (HTTP)。到目前为止,这有效。

如果用户无法通过 LDAP 进行身份验证(因为未在 AD 中定义),我想增强我的配置以执行简单的“基于 svn 文件”的身份验证。我尝试这种方式:

我的根位置:

<Location />      
  AuthType basic
  AuthName "<DNS-Name-of-Server>"

  # for LDAP only this is enough (works for me)
  #AuthBasicProvider ldap
  #AuthzLDAPAuthoritative on

  # but I want this...
  # these two lines should make it, as I understand the Apache2 documentation
  AuthBasicProvider ldap file
  AuthzLDAPAuthoritative off

  AuthLDAPURL "ldap://my.server.com:3268/dc=mydomain,dc=com?sAMAccountName" NONE
  AuthLDAPBindDN "CN=serviceusers,OU=Users,DC=mydomain,DC=com"
  AuthLDAPBindPassword "secret"

  AuthUserFile /etc/svn/svn-auth # contains svn users, that are not listed in AD
  AuthzSVNAccessFile /etc/svn/svn-access # handles path-based authorisation

  Require valid-user
</Location>

许多子位置之一(不同的存储库):

<Location /repos1>
  DAV svn
  SVNPath /opt/svn/repos1

  # again:
  AuthUserFile /etc/svn/svn-auth # contains svn users, that are not listed in AD
  AuthzSVNAccessFile /etc/svn/svn-access # handles path-based authorisation

  Require valid-user
</Location>

那是行不通的。重新加载 apache2 后,我仍然能够对 AD 中列出的用户进行身份验证,但回退到基于文件的身份验证不起作用。Apache-Module 已启用(mods-enabled/authn_file.load 存在)

也许还有一个提示:此配置还允许通过 HTTP 和 SVN 协议实现多存储库访问方法。

提前感谢您的回复。

最好的问候 ITL

4

1 回答 1

0

我的设置与此类似,并且可以正常工作,也许您应该尝试按照此顺序移动,并配置最大 httpd 调试日志级别。

<Location /repos1>
  Require valid-user
  DAV svn
  SVNPath /opt/svn/repos1

  # again:
  AuthzSVNAccessFile /etc/svn/svn-access # handles path-based authorisation
  # Fallback:
  AuthUserFile /etc/svn/svn-auth # contains svn users, that are not listed in AD create using htpasswd

</Location>
于 2014-06-09T09:43:53.637 回答