已经完成Centos6.5操作系统安装和配置,已经完成yum源安装和配置。
操作系统版本
Linux Centos6.5 2.6.32-431.el6.x86_64 (简称 Centos 6.5)
subversion-1.6.11-12.el6_6.x86_64
客户端SVN版本
TortoiseSVN-1.8.11.26392-x64-svn-1.8.13
yum源配置
cat /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
软件安装
yum install -y subversion
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirrors.skyshe.cn
* extras: mirrors.pubyun.com
* updates: mirrors.skyshe.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package subversion.x86_64 0:1.6.11-12.el6_6 will be installed
--> Processing Dependency: apr >= 1.3.0 for package: subversion-1.6.11-12.el6_6.x86_64
--> Processing Dependency: libneon.so.27()(64bit) for package: subversion-1.6.11-12.el6_6.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: subversion-1.6.11-12.el6_6.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: subversion-1.6.11-12.el6_6.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package neon.x86_64 0:0.29.3-3.el6_4 will be installed
--> Processing Dependency: libpakchois.so.0()(64bit) for package: neon-0.29.3-3.el6_4.x86_64
--> Running transaction check
---> Package pakchois.x86_64 0:0.4-3.2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================================================================================================
Installing:
subversion x86_64 1.6.11-12.el6_6 updates 2.3 M
Installing for dependencies:
apr x86_64 1.3.9-5.el6_2 base 123 k
apr-util x86_64 1.3.9-3.el6_0.1 base 87 k
neon x86_64 0.29.3-3.el6_4 base 119 k
pakchois x86_64 0.4-3.2.el6 base 21 k
Transaction Summary
==============================================================================================================================================================================================================================================================================
Install 5 Package(s)
Total download size: 2.6 M
Installed size: 12 M
Downloading Packages:
(1/5): apr-1.3.9-5.el6_2.x86_64.rpm | 123 kB 00:01
(2/5): apr-util-1.3.9-3.el6_0.1.x86_64.rpm | 87 kB 00:00
(3/5): neon-0.29.3-3.el6_4.x86_64.rpm | 119 kB 00:00
(4/5): pakchois-0.4-3.2.el6.x86_64.rpm | 21 kB 00:00
(5/5): subversion-1.6.11-12.el6_6.x86_64.rpm | 2.3 MB 00:01
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 240 kB/s | 2.6 MB 00:11
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : apr-1.3.9-5.el6_2.x86_64 1/5
Installing : apr-util-1.3.9-3.el6_0.1.x86_64 2/5
Installing : pakchois-0.4-3.2.el6.x86_64 3/5
Installing : neon-0.29.3-3.el6_4.x86_64 4/5
Installing : subversion-1.6.11-12.el6_6.x86_64 5/5
Verifying : neon-0.29.3-3.el6_4.x86_64 1/5
Verifying : subversion-1.6.11-12.el6_6.x86_64 2/5
Verifying : pakchois-0.4-3.2.el6.x86_64 3/5
Verifying : apr-util-1.3.9-3.el6_0.1.x86_64 4/5
Verifying : apr-1.3.9-5.el6_2.x86_64 5/5
Installed:
subversion.x86_64 0:1.6.11-12.el6_6
Dependency Installed:
apr.x86_64 0:1.3.9-5.el6_2 apr-util.x86_64 0:1.3.9-3.el6_0.1 neon.x86_64 0:0.29.3-3.el6_4 pakchois.x86_64 0:0.4-3.2.el6
Complete!
新建资源仓库
mkdir -p /home/svn/repo
svnadmin create /home/svn/repo
修改passwd配置文件
添加用户及密码
vim /home/svn/repo/conf/passwd
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.
[users]
# harry = harryssecret
# sally = sallyssecret
admin = admin123
shenhaiming = 12345678
xuguoxuan = 12345678
wangxiaolin = 12345678
fuzhengxi = 12345678
wuhuiling = 12345678
xuexiaogang = 12345678
wangpeng = 12345678
wenchu = 12345678
修改authz配置文件
为用户配置权限
vim /home/svn/repo/conf/authz
### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
### - a single user,
### - a group of users defined in a special [groups] section,
### - an alias defined in a special [aliases] section,
### - all authenticated users, using the '$authenticated' token,
### - only anonymous users, using the '$anonymous' token,
### - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[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
ywteam = shenhaiming,xuguoxuan,wangxiaolin,fuzhengxi,wuhuiling,xuexiaogang,wangpeng,wenchu
[/]
admin = rw
[repo:/运维组]
@ywteam = rw
~
修改svnserve.conf配置文件
vim /home/svn/repo/conf/svnserve.conf
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository. (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
### Visit http://subversion.tigris.org/ for more information.
[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
### 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 = /home/svn/repo/
[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256
~
启用SVN服务
svnserve -d -r /home/svn/
确认SVN服务端口
netstat -nalp | grep 3690
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 24427/svnserve
关闭SVN服务
ps -ef | grep svn
root 24427 1 0 12:39 ? 00:00:00 svnserve -d -r /home/svn/
root 24769 1905 0 14:33 pts/1 00:00:00 grep svn
kill -9 24427
SVN数据库迁移
称之为SVN全库操作,或称SVN全局备份并恢复,版本库数据的移植:svnadmin dump、svnadmin load
导出:
$svnadmin dump repos > dumpfile //将指定的版本库导出成文件dumpfile
新建:
$svnadmin create newrepos
导入:
$svnadmin load newrepos < dumpfile
详见SVN客户端使用手册
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/637517/viewspace-1766815/ ,如需转载,请注明出处,否则将追究法律责任。