追求永无止境
分类: 系统运维
2016-02-03 19:15:01
# yum install -y subversion |
[root@sxauzx /]# rpm -ql subversion /etc/bash_completion.d /etc/bash_completion.d/subversion /etc/rc.d/init.d/svnserve /etc/subversion /usr/bin/svn /usr/bin/svnadmin /usr/bin/svndumpfilter /usr/bin/svnlook /usr/bin/svnserve /usr/bin/svnsync /usr/bin/svnversion |
[root@sxauzx /]# svn --help 用法: svn [options] [args] Subversion 命令行客户端,版本 1.6.11。 使用“svn help ” 显示子命令的帮助信息。 使用“svn --version”查看程序的版本号和版本库访问模块,或者 使用“svn --version --quiet”只查看程序的版本号。 大多数的子命令可接受文件或目录参数,对目录进行递归处理。 如果没有指定参数,默认对当前目录(包含当前目录)递归处理。 可用的子命令: add blame (praise, annotate, ann) cat changelist (cl) checkout (co) cleanup commit (ci) copy (cp) delete (del, remove, rm) diff (di) export help (?, h) import info list (ls) lock log merge mergeinfo mkdir move (mv, rename, ren) propdel (pdel, pd) propedit (pedit, pe) propget (pget, pg) proplist (plist, pl) propset (pset, ps) resolve resolved revert status (stat, st) switch (sw) unlock update (up) Subversion 是版本控制工具。 |
[root@sxauzx /]# mkdir -p /svn/{develop,test} |
[root@sxauzx /]# svnadmin create /svn/develop [root@sxauzx /]# cd /svn/develop [root@sxauzx develop]# ll 总用量 24 drwxr-xr-x. 2 root root 4096 2月 3 17:09 conf drwxr-sr-x. 6 root root 4096 2月 3 17:09 db -r--r--r--. 1 root root 2 2月 3 17:09 format drwxr-xr-x. 2 root root 4096 2月 3 17:09 hooks drwxr-xr-x. 2 root root 4096 2月 3 17:09 locks -rw-r--r--. 1 root root 229 2月 3 17:09 README.txt |
[root@sxauzx ~]# vim /svn/develop/conf/svnserve.conf 1 ### This file controls the configuration of the svnserve daemon, if you 2 ### use it to allow access to this repository. (If you only allow 3 ### access through http: and/or file: URLs, then this file is 4 ### irrelevant.) 5 6 ### Visit for more information. 7 8 [general] 9 ### These options control access to the repository for unauthenticated 10 ### and authenticated users. Valid values are "write", "read", 11 ### and "none". The sample settings below are the defaults. 12 anon-access = read #没有认证用户只有读权限 13 auth-access = write #认证用户具有写全写 14 ### The password-db option controls the location of the password 15 ### database file. Unless you specify a path starting with a /, 16 ### the file's location is relative to the directory containing 17 ### this configuration file. 18 ### If SASL is enabled (see below), this file will NOT be used. 19 ### Uncomment the line below to use the default password file. 20 password-db = passwd #指定账号密码文件 21 ### The authz-db option controls the location of the authorization 22 ### rules for path-based access control. Unless you specify a path 23 ### starting with a /, the file's location is relative to the the 24 ### directory containing this file. If you don't specify an 25 ### authz-db, no path-based access control is done. 26 ### Uncomment the line below to use the default authorization file. 27 authz-db = authz #指定认证文件 28 ### This option specifies the authentication realm of the repository. 29 ### If two repositories have the same authentication realm, they should 30 ### have the same password database, and vice versa. The default realm 31 ### is repository's uuid. 32 # realm = My First Repository 33 34 [sasl] 35 ### This option specifies whether you want to use the Cyrus SASL 36 ### library for authentication. Default is false. ...... |
[root@sxauzx ~]# vim /svn/develop/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 sxauzx = 123456 #用户名密码 |
[root@sxauzx ~]# vim /svn/develop/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 [/] sxauzx = rw #认证用户具有读写权限 |
[root@sxauzx ~]# svnserve -d -r /svn/develop/ |
[root@sxauzx ~]# svn list svn://127.0.0.1/svn/ develop/ |