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

Steps:

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
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.1.44 svn.ehowstuff.local svn
192.168.1.48 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/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<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
</Location>

4. Restart httpd service :

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

Leave a Reply