1.安装svn软件

yum install subversion

2.创建SVN版本库

mkdir /var/svn
cd /var/svn
svnadmin create /var/svn/svnrepos

ls 查看
image.png
3.svn目录说明
image.png
4.修改授权文件

vim authz

改为如下内容

### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
###  - a single user,
###  - a group of users defined in a special [groups] section,
###  - an alias defined in a special [aliases] section,
###  - all authenticated users, using the '$authenticated' token,
###  - only anonymous users, using the '$anonymous' token,
###  - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]

admin = zhangsan
user = zhangsan,lisi

[/]
@admin = rw
@user = rw

5.修改用户密码

vim passwd

改为如下内容

[users]

zhangsan = testpassword
lisi = testpassword

6.修改svnserve.conf,去掉一些注释的地方

vim svnserve.conf

如下所示
image.png

7.启动或杀掉重启svn

svnserve -d -r /var/svn
<!--3690是svn的默认端口,需要在阿里云的安全组和宝塔上放行端口-->
kill $(lsof -t -i:3690)

8.使用如下方式在windows上访问
image.png

PS:访问时如果报错,/var/svn/cloud/conf/svnserve.conf:19: Option expected 是因为配置文件中没有顶格写,图中是正确的


老段
0 声望0 粉丝