Centos 搭建 SVN 服务

 公司服务器从托管机房迁移至阿里云,开发代码管理在svn上,也须要迁移至阿里云上。apache

 

     第一阶段购买了5台阿里云 4核8g ECS 服务器,系统选用 CentOS 7.2 64位。后端

 

安装 svncentos

     svn 的安装经过 yum 执行:yum install subversion服务器

     安装 openssl 以及 openssl-develless

          yum install openssl openssl-develtcp

 

查看 svn 版本svn

     svnserve —version测试

sh-4.2# svnserve --version
svnserve,版本 1.7.14 (r1542130)
   编译于 Nov 20 2015,19:25:09
ui

版权全部 (C) 2013 Apache 软件基金会。
此软件包含了许多人的贡献,请查看文件 NOTICE 以得到更多信息。
Subversion 是开放源代码软件,请参阅 http://subversion.apache.org/ 站点。
this

下列版本库后端(FS) 模块可用:

* fs_base : 模块只能操做BDB版本库。
* fs_fs : 模块与文本文件(FSFS)版本库一块儿工做。

Cyrus SASL 认证可用。

 

建立 svn 版本库

     cd /home

     mkdir -p ./svn/project

     svnadmin create /home/svn/project/

     svn 将在 /home/svn/project/ 中自动生成版本库文件

     sh-4.2# pwd
/home/svn/project/conf
sh-4.2# ls
authz  passwd  svnserve.conf

 

配置 svn

     cd /home/svn/project/conf

     authz 为权限配置文件

     passwd 用户名口令文件

     svnserve.conf svn 服务主配置

     

     配置用户名口令文件 passwd

     添加组用户以及密码

     [users]
# harry = harryssecret
# sally = sallyssecret

     

     配置权限文件 authz

     [groups]

     可添加组

     [groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe

     

     权限添加

     @后跟组名,则组中全部用户都有相同权限

     

# [/foo/bar]
# harry = rw
# &joe = r
# * =

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r

     

     配置 svn 主配置文件 svnserve.conf

     ### anon-access = read
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
### 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
### 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
realm = project
### The force-username-case option causes svnserve to case-normalize

    

启动svn

     svnserve -d -r /home/svn/project/

 

svn 默认监听 3690端口,centos 7以后防火墙使用 firewall

需打开 3690/tcp 端口

 

测试svn:

     

     客户端连接:svn://ip

     输入用户名密码连接成功; 

相关文章
相关标签/搜索