centos搭建svn伺服器
1.安裝subversion
yum install -y subversion
2.配置svn伺服器目錄預設路徑/var/svn
vim /etc/sysconfig/svnserve
OPTIONS="-r /svn"
3.使用svnadmin建立版本庫
mkdir -p /svn
svnadmin create /svn/test
[[email protected] /]# ll /svn/test
總用量 8
drwxr-xr-x. 2 root root 54 11月 14 12:51 conf
drwxr-sr-x. 6 root root 253 11月 14 11:49 db
-r--r--r--. 1 root root 2 11月 13 10:21 format
drwxr-xr-x. 2 root root 231 11月 13 10:21 hooks
drwxr-xr-x. 2 root root 41 11月 13 10:21 locks
-rw-r--r--. 1 root root 229 11月 13 10:21 README.txt
4.配置權限
ll /svn/test/conf
總用量 12
-rw-r--r--. 1 root root 1139 11月 13 10:53 authz
-rw-r--r--. 1 root root 377 11月 13 10:27 passwd
-rw-r--r--. 1 root root 3080 11月 14 12:51 svnserve.conf
vim /svn/test/svnserve.conf
anon-access = none
auth-access = write
password-db = passwd #密碼配置
authz-db = authz #權限配置
realm = test
[sasl]
vim /svn/test/passwd
[users]
harry = harryssecret
vim /svn/test/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
# [repository:/]
# @harry_and_sally = rw
# * = r
[test:/]
@harry_and_sally = rw
5.啟動svn伺服器
- 方式一
svnserve -d -r /svn/
- 方式二
systemctl start svnserve.service
最後祝大家生活愉快。