安装httpd,svn
yum install httpd httpd-devel subversion mod_dav_svn ntpdate -y
开始创建目录和配置文件
mkdir -p /etc/subversion && cd /etc/subversion && touch svn-authz.conf svn-user
开始创建版本库
mkdir -p /home/svndata && chown -R apache.apache /home/svndata && svnadmin create /home/svndata/Department_Server && chown -R apache.apache /home/svndata/Department_Server
开始配置文件
/etc/subversion/svn-authz.conf
[/]
name.sun = rw
* = rw
写入新的配置文件
<Location /sogdata>
DAV svn
#SVNListParentPath on
#SVNParentPath /data/svndata
SVNPath /data/svndata
LimitXMLRequestBody 8000000
LimitRequestBody 0
AuthBasicAuthoritative off
AuthType Basic
AuthName "svn"
AuthBasicProvider ldap
AuthLDAPURL "ldap://ip:389/ou=People,dc=自己设置,dc=com?uid"
AuthLDAPBindDN "cn=Manager,dc=自己设置,dc=com"
AuthLDAPBindPassword "manager的密码"
AuthUserFile /etc/subversion/svn-authz.conf
Require valid-user
#Require ldap-group cn=developer,dc=sogdata,dc=com
</Location>
写入配置文件至http.conf
echo "LoadModule dav_svn_module modules/mod_dav_svn.so" >>/etc/httpd/conf/httpd.conf
echo "LoadModule authz_svn_module modules/mod_authz_svn.so" >>/etc/httpd/conf/httpd.conf
sed -i 's/#ServerName www.example.com:80/ServerName localhost:80/g' /etc/httpd/conf/httpd.conf
启动httpd服务
svn服务搭建完成