How to Enable LDAP Authentication for Subversion on CentOS 6.2

Share this Article :

This post will show the quick steps to enable LDAP authentication for existing subversion on linux CentOS 6.2. This guideline assumed that your existing subversion server has been configured properly and working with htpasswd user. This guideline also assumed that 389 LDAP has been installed but not yet configure in your subversion configuration file.

Prerequisites :
How to Install Httpd on CentOS 6.2
How to Install and Configure Subversion 1.6 on CentOS 6.2
How to Install 389 Directory Server on CentOS 6.2

Also Read :   How to Prepare for Zimbra Collaboration Suite 7.1.4 Mail Server Installation on CentOS 6.2 x86_64


1. Append /etc/hosts for ldap server fqdn. If your ldap server has been registered on DNS server, you can skip this step.

[[email protected] ~]# vi /etc/hosts   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 svn.ehowstuff.local svn ldap.ehowstuff.local ldap

2. Locate and open subversion.conf using vi editor

[[email protected] ~]# vi /etc/httpd/conf.d/subversion.conf

3. Modify the existing subversion.conf to below :

LoadModule dav_svn_module     modules/
LoadModule authz_svn_module   modules/

<Location /svn/repos>
        DAV svn
        SVNParentPath /svn/repos
        AuthBasicProvider ldap
        AuthType Basic
        AuthzLDAPAuthoritative on
        AuthName "My Subversion server"
        AuthLDAPURL "ldap://ldap.ehowstuff.local:389/DC=ehowstuff,DC=local?uid?sub?(objectClass=*)" NONE
        AuthzSVNAccessFile /svn/permissions/svnaccess
        Require valid-user

4. Restart httpd service :

[[email protected] ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Leave a Reply