公司服務器從託管機房遷移至阿里雲,開發代碼管理在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:09ui
版權全部 (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
輸入用戶名密碼連接成功;