- 检查安装情况再进行安装
svn --version
yum install subversion - yum -y install httpd mod_dav_svn
- 关闭selinux
setenforce 0
systemctl stop firewalld
systemctl disable firewalld - mkdir /project/svn && cd /project/svn
svnadmin create test
mkdir conf
cp test/conf/passwd conf/
cp test/conf/authz conf/ - http配置
vi /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 /project/svn
SVNListParentPath on
AuthType Basic
AuthName "Authorization SVN"
AuthzSVNAccessFile /project/svn/conf/authz
AuthUserFile /project/svn/conf/passwd
Require valid-user
</Location>
- 创建管理用户、并在authz文件添加对应访问权限(如admin/123456 访问/ rw权限)
cd /project/svn/conf
htpasswd -bc /svn/conf/passwd admin 123456
vim /svn/conf/authz
##授权单个项目
[groups]
test = admin
[test:/]
@test = rw
##授权所有项目
[groups]
admins = admin
[/]
@admins = rw
-
启动httpd/svn服务
chown -R apache:apache /svn/
(chmod -R o+rw /svn)
systemctl restart httpd && svnserve -d -r /svn/
ps -ef|grep svn && ps -ef|grep httpd -
测试:
浏览器访问:http://ip/svn/test (用户名admin密码123456,可以访问所有项目)