yum install httpd subversion -y
2、mod_dav_svn是apache服务器访问svn的一个模块
yum install mod_dav_svn -y
安装成功后,会有mod_dav_svn.so和mod_authz_svn.so两个文件。
3、创建svn仓库
mkdir -p /var/www/svn/
svnadmin create /var/www/svn
4、配置权限以及用户
chown -R apache:apache /var/www/svn
touch /var/www/svn/conf/apachepwd #创建用户文件
htpasswd /var/www/svn/confapachepwd admin #创建用户 admin
5、修改用户访问权限
vim /var/www/svn/conf/authz
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
# [/foo/bar]
# harry = rw
# &joe = r
# * =
[/]
admin = rw #授权用读写权限
# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
6、配置httpdvim /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
SVNListParentPath on
SVNPath /var/www/svn
AuthType Basic
Satisfy Any
AuthName "Subversion repos"
AuthUserFile /var/www/svn/conf/apachepwd
AuthzSVNAccessFile /var/www/svn/conf/authz
Require valid-user
</Location>
7、启动httpd服务器
systemctl start httpd.service
8、访问测试
使用浏览器访问 http://IP/svn
原文地址:http://blog.51cto.com/gavin0/2122474