Release: CentOS Release 6.7 (Final)
version: Linux version 2.6.32-573.22.1.el6.x86_64 ([email protected]) (GCC version 4.4.7 20120313 (Red Hat 4.4.7-16) (gcc)) #1 SMP Wed Mar 03:35:39 UTC 2016
SVN: Version 1.6.11 (r934486)
Step 1: Install Subversion
[[email protected] ~]# Yum install subversion
Step 2: Check the version
[[Email protected] ~]# SVN--version
Step 3: Create SVN directories and warehouses
[Email protected] svn]# MKDIR/OPT/SVN
[Email protected] svn]# svnadmin create/opt/svn/test.localhost.com
Step 4: Add Users and Permissions
[Email protected] repos]# VIM/OPT/SVN/TEST.LOCALHOST.COM/CONF/PASSWD
[Users]
# Harry = Harryssecret
# sally = Sallyssecret
Jasonwu = JASONWUPW
Alanzhang = ALANZHANGPW
Sky = SKYPW
Joel = JOELPW
[Email protected] repos]# Vim/opt/svn/test.localhost.com/conf/authz
[Groups]
DEV = Joel,sky,alanzhang,jasonwu
[v2.test.localhost.com:/]
@DEV = RW
* =
Step 5: Modify the configuration file
[Email protected] repos]# vim/opt/svn/test.localhost.com/conf/svnserve.conf
Anon-access = None
auth-access = Write
Password-db =/opt/svn/test.localhost.com/conf/passwd
Authz-db =/opt/svn/test.localhost.com/conf/authz
Realm = My First Repository
Step 6: Turn on SVN service
[Email protected] test.localhost.com]# svnserve-d-R/OPT/SVN
Step 7:checkout Copy
[[Email protected] www]# SVN co svn://192.168.11.80/test.localhost.com
Authentication Realm: <svn://192.168.11.80:3690> My first Repository
Password for ' Joel ':
Authentication Realm: <svn://192.168.11.80:3690> My first Repository
Username:joel
Password for ' Joel ':
Authentication Realm: <svn://192.168.11.80:3690> My first Repository
Username:sky
Password for ' sky ':
-----------------------------------------------------------------------
attention! Your Password for authentication realm:
<svn://192.168.11.80:3690> My First Repository
Can only is stored to disk unencrypted! You is advised to configure
Your system so, Subversion can store passwords encrypted, if
Possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
Of the ' store-plaintext-passwords ' option to either ' Yes ' or ' no ' in
'/root/.subversion/servers '.
-----------------------------------------------------------------------
Store Password unencrypted (yes/no)?
Step 8: Add files to SVN
[Email protected] test.localhost.com]# vim test.txt
[[Email protected] test.localhost.com]# SVN add *
A Test.txt
Step 9: Submit files to SVN
[[Email protected] test.localhost.com]# SVN commit *-M ' test '
Adding Test.txt
Transmitting file data.
Committed Revision 1.
Step 10: Modify Hooks
[Email protected] www]# cd/opt/svn/test.localhost.com/
[Email protected] test.localhost.com]# CD hooks/
[Email protected] hooks]# vim Post-commit
#!/bin/sh
#export LANG=ZH_CN. UTF-8
Svn=/usr/bin/svn
Web=/www/test.localhost.com
# $SVN _path update svn://192.168.11.80/test.localhost.com $WEB _path--username Joel--password Joel--no-auth-cache
$SVN update $WEB--username Sky--password Sky
[Email protected] hooks]# chmod-r 755 post-commit
This article is from the "Old Cannon" blog, please be sure to keep this source http://joelemma.blog.51cto.com/11189330/1769817
Install SVN on CentOS