centos 6.5 安装svn 步骤

1,运行yum install -y subversion 只要网络正常的话,都能顺利安装的;

2,运行svnserve --version,如下图所示说明安装成功



3,创建版库

 mkdir /home/svn  #我的话在home下面的svn中

svnadmin create /home/svn/test  #我这里将svn作为所有版本库的目录,并创建了一个名为test的版本库

4.配置当前的版本库

创建版本库后,在当前版本库目录中会生成下面的文件,其中我们关心的是配置文件。

说明:
           (1)svnserve.conf:  svn服务综合配置文件。
           (2)passwd: 用户名口令文件。
           (3)authz: 权限配置文件。

[users]  
# harry = harryssecret  
# sally = sallyssecret  
repouser0 = user0passwd  
rock=rockpasswd  

其中对应的是 用户名=密码 ,其中等号两边的空格不是必须的。

4,修改authz文件

[groups]  
# harry_and_sally = harry,sally  
# harry_sally_and_joe = harry,sally,&joe  
team0=erpouser0 #将上面创建的分成两个组  
team1=rock  
# [/foo/bar]  
# harry = rw  
# &joe = r #上面的别名定义在这里实现 &在这里理解为指针就很容易了  
# * =  
# [repository:/baz/fuz]  
# @harry_and_sally = rw  
# * = r  
[repo0:/]  
@team0=r  
@team1=rw  
# 第一个小组只有读取的权限,第二个小组有读写的权限  
# 单个版本库的权限配置在这个文件中实现  


5,修改svnserve.conf

[general]  
### These options control access to the repository for unauthenticated  
### and authenticated users.  Valid values are "write", "read",  
### and "none".  The sample settings below are the defaults.  
anon-access = none #没有登录的用户不能访问  
auth-access = write #登录的用户可以写入  
### The password-db option controls the location of the password  
### database file.  Unless you specify a path starting with a /,  
### the file's location is relative to the directory containing  
### this configuration file.  
### If SASL is enabled (see below), this file will NOT be used.  
### Uncomment the line below to use the default password file.  
password-db = passwd #密码文件为当前目录下的passwd  
### The authz-db option controls the location of the authorization  
### rules for path-based access control.  Unless you specify a path  
### starting with a /, the file's location is relative to the the  
### directory containing this file.  If you don't specify an  
### authz-db, no path-based access control is done.  
### Uncomment the line below to use the default authorization file.  
authz-db = authz #验证文件为当前目录下的authz  

备注:
  1. anon-access = none #没有登录的用户不能访问  

  2. auth-access = write #登录的用户可以写入  

  1. password-db = passwd #密码文件为当前目录下的passwd  

    1. authz-db = authz #验证文件为当前目录下的authz  

    这几行前面不能有空格,否则会出错。


6. 停止和启动svn

svnserve -d -r /var/svn/  
关闭 <pre name="code" class="html">ps -aux |grep svn  
kill -9 进程id  

 
 
8,导入与导入工程
$ mkdir MyProject    
$ mkdir MyProject/trunk    
$ mkdir MyProject/branches    
$ mkdir MyProject/tags    
svn import MyProject svn://192.168.1.109/repo0/MyProject -m "first import project"  
</pre><pre name="code" class="html">导出 <pre name="code" class="html">svn co svn://192.168.1.109/repo0/MyProject  

 
 配置防火墙端口 
 
[root@zck conf]# vi /etc/sysconfig/iptables
添加以下内容:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
保存后重启防火墙
[root@zck conf]# service iptables restart

查看SVN进程

[root@zck conf]# ps -ef|grep svn|grep -v grep
root 12538 1 0 14:40 ? 00:00:00 svnserve -d -r /home/svn/test

检测SVN 端口
[root@zck conf]# netstat -ln |grep 3690
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN

停止重启SVN
[root@zck password]# killall svnserve //停止
[root@zck password]# svnserve -d -r /opt/svn/test // 启动



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值