CentOS Install SVN
1.SVN Introduction
Subversion is a new generation of versioning tools, not only for program source control, but also for other work that requires collaborative management of data. As a rewrite and an improved version of CVS, the goal is to serve as a
Better version control software to replace the current popular CVS. Individuals are more inclined to use git, but developers in the company like to use SVN, so they deploy SVN. The installation starts below.
2. Installation
Source code compilation too cumbersome, or RPM package convenient, directly using Yum installation can be.
Yum install-y Subversion
3. Create a warehouse
Svnadmin Create/path/pro
Pro for the project name,/path/can write or do not write, do not write when the command is executed in the current directory to generate Pro directory, suggest or write absolute path, at least you know.
After the warehouse creation is complete, the resulting directory structure is as follows:
Pro
├──conf
│├──authz
│├──passwd
│└──svnserve.conf
├──db
│├──current
│├──format
│├──fsfs.conf
│├──fs-type
│├──min-unpacked-rev
│├──rep-cache.db
│├──revprops
││└──0
││└──0
│├──revs
││└──0
││└──0
│├──transactions
│├──txn-current
│├──txn-current-lock
│├──txn-protorevs
│├──uuid
│└──write-lock
├──format
├──hooks
│├──post-commit.tmpl
│├──post-lock.tmpl
│├──post-revprop-change.tmpl
│├──post-unlock.tmpl
│├──pre-commit.tmpl
│├──pre-lock.tmpl
│├──pre-revprop-change.tmpl
│├──pre-unlock.tmpl
│└──start-commit.tmpl
├──locks
│├──db.lock
│└──db-logs.lock
└──readme.txt
4. Modify the configuration file
The configuration file for the warehouse is as follows:
Conf
├──authz #用户权限配置文件
├──PASSWD #用户账号密码配置文件
└──svnserve.conf #仓库配置文件
Modify Svnserve.conf
[General]
Anon-access = None
auth-access = Write
Password-db = passwd
Authz-db = Authz
Note: All lines must be shelf, otherwise error.
Modify passwd
[Users]
Harry = Harryssecret
Sally = Sallyssecret
Note: If there are ' # ' before [users], SVN can only use anonymous logins; the passwords are all plaintext.
Modify Authz, configure user groupings and access permissions to different directories under [group]
[Groups]
admin = Li #设置分组, admin group, contains user Li
dev = long,ning #设置分组, admin group, contains user long,ning different user use is good separation
[pro:/] #设置仓库pro的根目录权限, the admin group has the degree of Read and write permissions, *= set other people can not access, *= in the middle do not have spaces, otherwise there will be problems.
@admin = RW
*=
[Pro:/dev] #设置仓库pro下dev目录权限, the Dev group has read and write permissions, *= set other people can not access, *= in the middle do not have spaces, or there will be problems.
@dev = RW
*=
5. Start and stop SVN
Single warehouse:
Startup: svnserve-d-r/path
Stop: kill-quit ' ps aux |grep svn|grep-v grep|awk ' {print $} '
multi-warehouse:
Because most of the time, the same user needs to use the same account and password to access the different repositories, then the configuration of permissions is not good to handle, the previous view of others the solution is specified in svnserve.conf
passwd and Authz paths are referred to the same file with relative paths. This is a feasible method, but when the new version of the Repository, you have to change the svnserve.conf file, inconvenient.
Look at Svnserve's help, you will find that there is a –config-file parameter, which is used to specify the path of the svnserve.conf, when it comes to this, the problem is clear, as long as the SVN service is started
, specify – The Config-file parameter, as long as this parameter is specified, all permissions are controlled by the svnserve.conf specified by the parameter, and the configuration of svnserve.conf under each repository conf directory is ignored, starting with the
parameters as follows
Svnserve-d-r/path–config-file/path/svnserve.conf
Because we are using Yum to install the SVN, viewing the/etc/rc.d/init.d/svnserve service startup script will find The script will first determine if there is a/etc/sysconfig/svnserve file, if it exists will import this article
, so we just write the configuration information here, it is convenient to manage multiple repositories, of course, specify to other locations can also modify the script.
#vim/etc/sysconfig/svnserve
options= "-r/data/svn–config-file/data/svn/svnserve.conf"
The Authz and passwd files specified in the specified configuration file can then be configured
to start SVN like other services at this time.
Note that even if the Svnserve service is already running, modify the configuration file or user, rights management files, save immediately after the effective, do not need to restart.
The source of this article:
Time Note timesnotes.com
Original works, reproduced please specify the source: http://timesnotes.com/?p=18
This article is from the "Re Notes" blog, make sure to keep this source http://timesnotes.blog.51cto.com/1079212/1679046
centos6.4 Installing SVN