SVN搭建与连接
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SVN搭建与连接相关的知识,希望对你有一定的参考价值。
服务器端的搭建
1.查看SVN软件是否安装
[[email protected] svndata]# rpm -qa subversion
subversion-1.6.11-15.el6_7.x86_64
2.如果没有以上结果,则需执行如下命令进行安装。
[[email protected] ~]# yum install subversion -y
配置并启动SVN
建立SVN版本库数据存储根目录(svndata)及用户,密码权限目录(svnpasswd)
[[email protected] ~]# mkdir -p /root/svndata 数据存储根目录
[[email protected] ~]# mkdir -p /root/svnpasswd 用户密码权限目录
启动SVN,指定访问的SVN根目录
[[email protected] ~]# svnserve -d -r /root/svndata/
查看SVN进程
[[email protected] ~]# 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
建立项目版本库
[[email protected] ~]# svnadmin create /root/svndata/sadoc
调整SVN配置文件及权限
先备份后修改
[[email protected] 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
[[email protected] conf]# cp svnserve.conf svnserve1.conf
[[email protected] conf]# cp authz authz1
[[email protected] conf]# cp passwd passwd1
[[email protected] conf]# vim svnserve.conf
修改结果与原配置文件对比(黄色部分是修改以后的)
[[email protected] 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/
[[email protected] conf]# /bin/mv authz passwd /root/svnpasswd/
(为了安全起见可以把权限改成700)
[[email protected] 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
[[email protected] 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 会出现如下页面
本文出自 “11533956” 博客,请务必保留此出处http://11543956.blog.51cto.com/11533956/1845730
以上是关于SVN搭建与连接的主要内容,如果未能解决你的问题,请参考以下文章