服务器端的搭建

1.查看SVN软件是否安装

[root@nfs01 svndata]# rpm -qa subversion

subversion-1.6.11-15.el6_7.x86_64

2.如果没有以上结果,则需执行如下命令进行安装。

[root@nfs01 ~]# yum install subversion -y

配置并启动SVN

建立SVN版本库数据存储根目录(svndata)及用户,密码权限目录(svnpasswd

[root@nfs01 ~]# mkdir -p /root/svndata     数据存储根目录

[root@nfs01 ~]# mkdir -p /root/svnpasswd   用户密码权限目录

启动SVN,指定访问的SVN根目录

[root@nfs01 ~]# svnserve -d -r /root/svndata/

查看SVN进程

[root@nfs01 ~]# ps -ef |grep svn

root       7820      1  0 05:34 ?       00:00:00 svnserve -d -r /root/svndata/

root       7822   7764  0 05:34 pts/0    00:00:00 grep svn

建立项目版本库

[root@nfs01 ~]# svnadmin create /root/svndata/sadoc

调整SVN配置文件及权限

先备份后修改

[root@nfs01 conf]# ll

total 12

-rw-r--r-- 1 root root 1080 Jul 24 05:36 authz

-rw-r--r-- 1 root root  309 Jul 24 05:36 passwd

-rw-r--r-- 1 root root 2279 Jul 24 05:36 svnserve.conf

[root@nfs01 conf]# cp svnserve.conf svnserve1.conf 

[root@nfs01 conf]# cp authz authz1 

[root@nfs01 conf]# cp passwd passwd1

[root@nfs01 conf]# vim svnserve.conf 

修改结果与原配置文件对比(×××部分是修改以后的)

[root@nfs01 conf]# diff svnserve.conf svnserve1.conf 

12,13c12,13

< anon-access = read

< auth-access = write

---

> # anon-access = read

> # auth-access = write

20c20

< password-db = /root/svnpasswd/passwd

---

> # password-db = passwd

27c27

< authz-db = /root/svnpasswd/authz

---

> # authz-db = authz

把密码文件模板拷贝到相关目录

[root@nfs01 conf]# cp passwd authz /root/svnpasswd/

[root@nfs01 conf]# /bin/mv authz passwd /root/svnpasswd/

(为了安全起见可以把权限改成700

[root@nfs01 svnpasswd]# cat passwd  添加用户和密码

### This file is an example password file for svnserve.

### Its format is similar to that of svnserve.conf. As shown in the

### example below it contains one section labelled [users].

### The name and password for each user follow, one account per line.

 

[users]

# harry = harryssecret

# sally = sallyssecret

kaoshi = kaoshi123

 

[root@nfs01 svnpasswd]# cat 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]

# harry_and_sally = harry,sally

# harry_sally_and_joe = harry,sally,&joe

wenyanchao = kaoshi

 

# [/foo/bar]

# harry = rw

# &joe = r

# * =

 

# [repository:/baz/fuz]

# @harry_and_sally = rw

# * = r

[sadoc:/]

wenyanchao = rw

提示:

1.等号前为账户等号后为密码,注意权限和等号两端的空格

 

客户端软件TortoiseSVN SVN安装

ok以后会出现如下页面

 

输入用户kaoshi   密码:kaoshi123   会出现如下页面