系统为CentOS 6.2
# yum install httpd httpd-devel subversion mod_dav_svn
第二步:创建SVN库和项目
mkdir /home/svn/repos //创建SVN库总目录
svnadmin create /home/svn/repos/projcet1 //创建项目svn库
groupadd subversion //创建一个叫subversion的组为拥有仓库所在的目录 usermod -G subversion -a apache //将自己和Apache 用户加入组成员
# chgrp -R subversion /home/svn/repos/project1 # chcon -R -t httpd_sys_content_t /home/svn //这步非常重要,要不apache会没有权限访问文件
第五步:配置httpd
第六步:配置SVNvim /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so <Location /svn> DAV svn SVNParentPath /home/svn/repos SVNListParentPath on # # # Limit write permission to list of valid users. # <LimitExcept GET PROPFIND OPTIONS REPORT> # # Require SSL connection for password protection. # # SSLRequireSSL # AuthType Basic AuthName "Authorization Realm" AuthUserFile /home/svn/passwd Require valid-user AuthzSVNAccessFile /home/svn/authz.conf # </LimitExcept> </Location>
# htpasswd -c /home/svn/passwd test //第一次添加用户使用参数“-c”以后再添加就不用了 # chcon -R -t httpd_sys_content_t /home/svn/passwd //这步非常重要,要不apache会没有权限访问文件 # chcon -R -t httpd_sys_content_t /home/svn/authz.conf
[groups] #everyone =esin,tester groupA = esin groupB = tester [/] * = r [project1:/] @groupA = rw #@everyone = r [project1:/] #@everyone = r @groupB = r