阿里云服务器搭建多仓库svn服务器

1,yum 安装svn

yum install subversion

2,创建svn目录,一个仓库的总目录

mkdir /svnRepo

3,创建版本仓库

cd /svnRepo

svnadmin create /svnRepo/carpet

svnadmin create /svnRepo/c2c

上面就创建了两个仓库,分别为carpet和c2c

4,如果只是想做单一仓库的话

以c2c仓库为例:

只需要修改对应仓库的conf下的三个文件即可


分别是:passwd,authz,svnserve.conf

passwd

其中:passwd是设置用户密码的,格式为   账号 = 密码 ,需要注意的是,行首不能有空格

         

   authz

      authz是配置相关的权限

       

    svnserve.conf     

svnserve.conf是配置此仓库指定密码文件,权限文件的位置

        需要更改的是:

          anon-access = none    (前的注释取消,=之后改为none)表示禁止匿名,注意行首不能有空格

          auth-access = write   (认证用户可写,也就是通过密码登陆的)

          password-db = passwd(取消前面的的注释,这是指定passwd文件的位置,由于passwd与svnserve.conf是在同一文件夹,所以直接是文件名)

          authz-db =   authz (取消前面的注释,指定全线文件authz的位置)

### 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
### 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

           realm = /svnRepo/c2c(指定仓库的位置,这一行是添加的,如果是单一仓库,未使用共同的passwd和authz文件,这行配置可以省略)


         

### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
# realm = My First Repository






5,多仓库的配置:


在c2c单一仓库的基础上,将c2c的conf文件夹下的authz和passwd拷贝一份放到svnRepo

cp svnRepo/c2c/conf/authz   /svnRepo/authz

cp svnRepo/c2c/conf/passwd   /svnRepo/passwd

修改:passwd将所有需要的用户和密码都设置在/svnRepo/passwd中

       所有权限的分配也放在svnRepo/authz中

如图:


然后各自修改c2c仓库下conf中的svnserve.conf指定passwd_db与authz_db的路径


  carpet仓库下的svnserv.conf做相似修改即可


6,常用命令:

启动:

单一仓库启动:

svnserve -d -r /svnRepo/c2c

多仓库启动:

svnserve -d -r /svnRepo(注意svnRepo是总目录,比仓库高一层次)

停止:

svn的停止:

killall svnserve

卸载:

yum remove subversion

7,需要注意的问题:

使用小乌龟svn连接时,出现

1,出现 远程计算机积极拒绝

 注意端口,默认是需要开放3690 ,需要在阿里云的安全组规则中的开放

  

2,svnserve.conf:12:12 Option expected

   需要注意配置文件中每行前面是不能有空格的




      

      





猜你喜欢

转载自blog.csdn.net/qq_36922927/article/details/80897664
今日推荐