Thursday, January 3, 2008

Subversion, Apache, Active Directory, SSL, LDAPS

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so


# this is the public cert obtained manually from the ldap server using
# openssl s_client -connect ldap.yourdomain.com:636
# the base64 encoded section of the output of the previous command was copied in to the following file
LDAPTrustedGlobalCert CA_BASE64 /etc/pki/tls/certs/yourOrgsLdap.crt



DAV svn
# /opt/remoteRepos/ is an NFS mounted filesystem
#
# SElinux is enabled on this system, so the NFS share is mounted with a
# context of httpd_sys_content_t so apache can actually read/write to the mounted share
#
# when creating a repository on a network share
# make sure it is --fs-type=fsfs and NOT berkleyDB

SVNParentPath /opt/remoteRepos

#Require SSL connection for password protection.
SSLRequireSSL

AuthBasicProvider ldap
AuthzLDAPAuthoritative off

AuthType Basic
AuthName "Enter Domain Username/Password"
AuthLDAPBindDN "CN=bindOnlyUserName,ou=People,DC=yourdomain,DC=com"
AuthLDAPBindPassword superAwesomePassword

#ldap uses port 389
#ldaps users port 636
AuthLDAPURL ldaps://ldap.yourdomain.com:636/OU=people,DC=yourdomain,DC=com?sAMAccountName?sub?(objectClass=user)
Require valid-user