码迷,mamicode.com
首页 > 其他好文 > 详细

在CentOS安装SVN

时间:2016-05-03 20:34:40      阅读:360      评论:0      收藏:0      [点我收藏+]

标签:svn

Release: CentOS release 6.7 (Final)

版本: Linux version 2.6.32-573.22.1.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Mar 23 03:35:39 UTC 2016


SVN:version 1.6.11 (r934486)


Step 1: 安装Subversion

[root@80 ~]# yum install subversion


Step 2: 检查版本

[root@80 ~]# svn --version


Step 3: 创建SVN目录和仓库

[root@80 svn]# mkdir /opt/svn

[root@80 svn]# svnadmin create /opt/svn/test.localhost.com


Step 4: 添加用户和权限

[root@80 repos]# vim /opt/svn/test.localhost.com/conf/passwd

[users]

# harry = harryssecret

# sally = sallyssecret

jasonwu = jasonwupw

alanzhang = alanzhangpw

sky = skypw

joel = joelpw


[root@80 repos]# vim /opt/svn/test.localhost.com/conf/authz 

[groups]

DEV  = joel,sky,alanzhang,jasonwu

[v2.test.localhost.com:/]

@DEV = rw

* =


Step 5: 修改配置文件

[root@80 repos]# vim /opt/svn/test.localhost.com/conf/svnserve.conf 

anon-access = none

auth-access = write

password-db = /opt/svn/test.localhost.com/conf/passwd

authz-db = /opt/svn/test.localhost.com/conf/authz

realm = My First Repository


Step 6: 开启svn服务

[root@80 test.localhost.com]# svnserve -d -r /opt/svn


Step 7: checkout副本

[root@80 www]# svn co svn://192.168.11.80/test.localhost.com


Authentication realm: <svn://192.168.11.80:3690> My First Repository

Password for ‘joel‘: 

Authentication realm: <svn://192.168.11.80:3690> My First Repository

Username: joel

Password for ‘joel‘: 

Authentication realm: <svn://192.168.11.80:3690> My First Repository

Username: sky

Password for ‘sky‘: 


-----------------------------------------------------------------------

ATTENTION!  Your password for authentication realm:


   <svn://192.168.11.80:3690> My First Repository


can only be stored to disk unencrypted!  You are advised to configure

your system so that Subversion can store passwords encrypted, if

possible.  See the documentation for details.


You can avoid future appearances of this warning by setting the value

of the ‘store-plaintext-passwords‘ option to either ‘yes‘ or ‘no‘ in

‘/root/.subversion/servers‘.

-----------------------------------------------------------------------

Store password unencrypted (yes/no)? 


Step 8: 增加文件到SVN

[root@80 test.localhost.com]# vim test.txt

[root@80 test.localhost.com]# svn add *

A         test.txt


Step 9: 提交文件到SVN

[root@80 test.localhost.com]# svn commit * -m ‘test‘

Adding         test.txt

Transmitting file data .

Committed revision 1.


Step 10: 修改钩子

[root@80 www]# cd /opt/svn/test.localhost.com/

[root@80 test.localhost.com]# cd hooks/

[root@80 hooks]# vim post-commit 

#!/bin/sh

#export LANG=zh_CN.UTF-8


SVN=/usr/bin/svn

WEB=/www/test.localhost.com


#$SVN_PATH update svn://192.168.11.80/test.localhost.com $WEB_PATH  --username joel --password joel --no-auth-cache


$SVN update $WEB  --username sky --password sky


[root@80 hooks]# chmod -R 755 post-commit


本文出自 “老炮儿” 博客,请务必保留此出处http://joelemma.blog.51cto.com/11189330/1769817

在CentOS安装SVN

标签:svn

原文地址:http://joelemma.blog.51cto.com/11189330/1769817

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!