Friday, January 14, 2011

Apache and Subversion authentication with Microsoft Active Directory

Apache and Subversion authentication with Microsoft Active Directory on CentOS:

1) Create an user account on AD as ldapbind under Users OU

2) On CentOS Box, Install following packages:

# yum install httpd subversion openldap openssl mod_dav_svn mod_authz_svn mod_ssl

3) Create a repo:

# svnadmin create /svn/repo1

4) Edit /etc/httpd/conf.d/subversion.conf file with following parameters:

# vim /etc/httpd/conf.d/subversion.conf


<(Location /svn)>
DAV svn
SVNParentPath /svn
AuthBasicProvider ldap
AuthType Basic
AuthzLDAPAuthoritative off
AuthName "My Subversion Server"
AuthLDAPURL "ldap://server.example.com:389/DC=example,DC=com?sAMAccountName?sub?(objectClass=*)"
AuthLDAPBindDN "ldapbind@example.com"
AuthLDAPBindPassword "password"
require valid-user
Order allow,deny
AllowOverride None
Allow from all
< / L o c a t i o n >


5) Edit /etc/openldap/ldap.conf :

REFERRALS off

6) Restart httpd service and try to access on UI:

# service httpd start
# chkconfig httpd on

7) Access on UI: https://example.com/svn/repo1