商务合作加Q:411239339

CentOS 6.4中搭建svn服务器

浏览:322次阅读
没有评论

共计 1933 个字符,预计需要花费 5 分钟才能阅读完成。

1、安装 subversion

yum install subversion -y

2、查看安装文件

# rpm -ql subversion

/etc/bash_completion.d
/etc/bash_completion.d/subversion
/etc/rc.d/init.d/svnserve
/etc/subversion
/usr/bin/svn
/usr/bin/svnadmin
/usr/bin/svndumpfilter
/usr/bin/svnlook
/usr/bin/svnserve
/usr/bin/svnsync
/usr/bin/svnversion

3、查看 svn 命令使用方法

# svn --help
usage: svn <subcommand> [options] [args]
Subversion command-line client, version 1.6.11.
Type 'svn help <subcommand>' for help on a specific subcommand.
Type 'svn --version' to see the program version and RA modules
  or 'svn --version --quiet' to see just the version number.

Most subcommands take file and/or directory arguments, recursing
on the directories.  If no arguments are supplied to such a
command, it recurses on the current directory (inclusive) by default.

Available subcommands:
   add
   blame (praise, annotate, ann)
   cat
   changelist (cl)
   checkout (co)
   cleanup
   commit (ci)
   copy (cp)
   delete (del, remove, rm)
   diff (di)
   export
   help (?, h)
   import
   info
   list (ls)
   lock
   log
   merge
   mergeinfo
   mkdir
   move (mv, rename, ren)
   propdel (pdel, pd)
   propedit (pedit, pe)
   propget (pget, pg)
   proplist (plist, pl)
   propset (pset, ps)
   resolve
   resolved
   revert
   status (stat, st)
   switch (sw)
   unlock
   update (up)

4、创建 svn 版本目录

mkdir /data/svn -p

5、创建 svn 版本库

svnadmin create /data/svn

6、配置用户

cd /data/svn/conf
echo "guozi = xxxx" >> password

其中 guozi 为用户名,xxxx 为密码

7、配置权限

[/]
guozi = rw

意思是版本库的根目录 (/data/svn)guozi 对其有读写权限。扩展一下,[groups] 节点可以添加组,比如:

MyProject = guozi,xiaoming

然后可以在 [/] 下边加上 @MyProject = rw, 意思是对 MyProject 组给可读可写权限。

你还可以设置多个目录,比如 [dev:/] 节点,表示 /data/svn/dev 目录进行权限设置,更多设置请查看 svn 官方文档。

8、开放配置文件

打开 svnserver.conf,根据以下说明配置好权限

anon-access = none
auth-access = write # 授权用户可写
password-db = passwd # 使用哪个文件作为账号文件
authz-db = authz # 使用哪个文件作为权限文件

9、修改启动文件

将 /etc/init.d/svnserve 文件中的 args 参数修改如下:

args="--daemon --pid-file=${pidfile} $OPTIONS -d -r /data/svn"

10、启动 svn

/etc/init.d/svnserve start

11、将 svnserve 加入开机启动

chkconfig svnserve on

 

正文完
扫码赞助
post-qrcode
 0
果子
版权声明:本站原创文章,由 果子 于2015-03-21发表,共计1933字。
转载说明:除特殊说明外本站文章皆由果较瘦原创发布,转载请注明出处。
评论(没有评论)