Sunday, January 17, 2010

Connect SVN with LDAP

If you are trying to authenticate the SVN (Subversion) system with LDAP, Following is the Apache configuration file

Install following plugin

apt-get install libapache2-svn

Then create the following vhost conf file while loading following modules.

#-------------------Start Conf file---------------------------------------

LoadModule ldap_module /usr/lib/apache2/modules/mod_ldap.so
LoadModule authnz_ldap_module /usr/lib/apache2/modules/mod_authnz_ldap_module.so
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
LoadModule authz_svn_module /usr/lib/apache2/modules/mod_authz_svn.so

< Location /repo>
DAV svn
SVNParentPath /var/repo1/
SVNListParentPath On
SVNAutoversioning On
SVNReposName "Your Subversion Repository"
AuthzLDAPAuthoritative on
AuthType Basic
AuthName "Repo1 Subversion Repository"
AuthLDAPBindDN "CN=admin,DC=test,DC=com"
AuthLDAPBindPassword password
AuthLDAPURL "ldap://ldapserver.test.com:389/DC=test,DC=com?sAMAccountName?sub?(objectClass=*)"
Require valid-user
< /Location>

#------------------------End------------------------------------


#------------------------sampe 2 -------------------------------
< Location /repo>
DAV svn
SSLRequireSSL
SVNParentPath /var/repo/
SVNListParentPath On
SVNAutoversioning On
SVNReposName "Repository"
SVNPathAuthz off

AuthBasicProvider ldap
AuthBasicAuthoritative on
AuthzLDAPAuthoritative off

AuthType Basic

AuthName "Repository"
AuthLDAPBindDN "cn=admin,dc=test,dc=com"
AuthLDAPBindPassword password
AuthLDAPURL "ldap://ldapserver.com:389/ou=people,dc=test,dc=com?uid"
Require valid-user

#---------------------------------------------------------------
If you need any detail information, follow-up following blogs.

http://blogs.open.collab.net/svn/2009/03/subversion-with-apache-and-ldap-updated.html
http://blog.acmelab.org/2007/09/02/ubuntu-server-setup-lampldapsvntracmoinmoin/

No comments:

Post a Comment