> CentOS > CentOS教程 >

CentOS下使用yum安装svn


yum安装svn

[root@LAMP1 html]# yum -y install subversion
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: mirrors.pubyun.com
* extras: mirrors.pubyun.com
* updates: mirrors.pubyun.com
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: perl(URI) >= 1.17 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
--> Running transaction check
---> Package neon.x86_64 0:0.29.3-3.el6_4 will be installed
--> Processing Dependency: libgnutls.so.26(GNUTLS_1_4)(64bit) for package: neon-0.29.3-3.el6_4.x86_64
--> Processing Dependency: libproxy.so.0()(64bit) for package: neon-0.29.3-3.el6_4.x86_64
--> Processing Dependency: libpakchois.so.0()(64bit) for package: neon-0.29.3-3.el6_4.x86_64
--> Processing Dependency: libgnutls.so.26()(64bit) for package: neon-0.29.3-3.el6_4.x86_64
---> Package perl-URI.noarch 0:1.40-2.el6 will be installed
--> Running transaction check
---> Package gnutls.x86_64 0:2.8.5-14.el6_5 will be installed
--> Processing Dependency: libtasn1.so.3(LIBTASN1_0_3)(64bit) for package: gnutls-2.8.5-14.el6_5.x86_64
--> Processing Dependency: libtasn1.so.3()(64bit) for package: gnutls-2.8.5-14.el6_5.x86_64
---> Package libproxy.x86_64 0:0.3.0-10.el6 will be installed
--> Processing Dependency: libproxy-python = 0.3.0-10.el6 for package: libproxy-0.3.0-10.el6.x86_64
--> Processing Dependency: libproxy-bin = 0.3.0-10.el6 for package: libproxy-0.3.0-10.el6.x86_64
---> Package pakchois.x86_64 0:0.4-3.2.el6 will be installed
--> Running transaction check
---> Package libproxy-bin.x86_64 0:0.3.0-10.el6 will be installed
---> Package libproxy-python.x86_64 0:0.3.0-10.el6 will be installed
---> Package libtasn1.x86_64 0:2.3-6.el6_5 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:
gnutls                                            x86_64                                   2.8.5-14.el6_5                                    base                                      346 k
libproxy                                          x86_64                                   0.3.0-10.el6                                      base                                       39 k
libproxy-bin                                      x86_64                                   0.3.0-10.el6                                      base                                      9.0 k
libproxy-python                                   x86_64                                   0.3.0-10.el6                                      base                                      9.1 k
libtasn1                                          x86_64                                   2.3-6.el6_5                                       base                                      238 k
neon                                              x86_64                                   0.29.3-3.el6_4                                    base                                      119 k
pakchois                                          x86_64                                   0.4-3.2.el6                                       base                                       21 k
perl-URI                                          noarch                                   1.40-2.el6                                        base                                      117 k

Transaction Summary
==============================================================================================================================================================================================
Install       9 Package(s)

Total download size: 3.2 M
Installed size: 14 M
Downloading Packages:
Setting up and reading Presto delta metadata
updates/prestodelta                                                                                                                                                    | 233 kB     00:00    
Processing delta metadata
Package(s) data still to download: 3.2 M
(1/9): gnutls-2.8.5-14.el6_5.x86_64.rpm                                                                                                                                | 346 kB     00:00    
(2/9): libproxy-0.3.0-10.el6.x86_64.rpm                                                                                                                                |  39 kB     00:00    
(3/9): libproxy-bin-0.3.0-10.el6.x86_64.rpm                                                                                                                            | 9.0 kB     00:00    
(4/9): libproxy-python-0.3.0-10.el6.x86_64.rpm                                                                                                                         | 9.1 kB     00:00    
(5/9): libtasn1-2.3-6.el6_5.x86_64.rpm                                                                                                                                 | 238 kB     00:00    
(6/9): neon-0.29.3-3.el6_4.x86_64.rpm                                                                                                                                  | 119 kB     00:00    
(7/9): pakchois-0.4-3.2.el6.x86_64.rpm                                                                                                                                 |  21 kB     00:00    
(8/9): perl-URI-1.40-2.el6.noarch.rpm                                                                                                                                  | 117 kB     00:00    
(9/9): subversion-1.6.11-12.el6_6.x86_64.rpm                                                                                                                           | 2.3 MB     00:00    
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                         2.3 MB/s | 3.2 MB     00:01    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libproxy-bin-0.3.0-10.el6.x86_64                                                                                                                                           1/9
  Installing : libproxy-python-0.3.0-10.el6.x86_64                                                                                                                                        2/9
  Installing : libproxy-0.3.0-10.el6.x86_64                                                                                                                                               3/9
  Installing : perl-URI-1.40-2.el6.noarch                                                                                                                                                 4/9
  Installing : libtasn1-2.3-6.el6_5.x86_64                                                                                                                                                5/9
  Installing : gnutls-2.8.5-14.el6_5.x86_64                                                                                                                                               6/9
  Installing : pakchois-0.4-3.2.el6.x86_64                                                                                                                                                7/9
  Installing : neon-0.29.3-3.el6_4.x86_64                                                                                                                                                 8/9
  Installing : subversion-1.6.11-12.el6_6.x86_64                                                                                                                                          9/9
  Verifying  : libproxy-0.3.0-10.el6.x86_64                                                                                                                                               1/9
  Verifying  : libproxy-bin-0.3.0-10.el6.x86_64                                                                                                                                           2/9
  Verifying  : subversion-1.6.11-12.el6_6.x86_64                                                                                                                                          3/9
  Verifying  : pakchois-0.4-3.2.el6.x86_64                                                                                                                                                4/9
  Verifying  : libproxy-python-0.3.0-10.el6.x86_64                                                                                                                                        5/9
  Verifying  : libtasn1-2.3-6.el6_5.x86_64                                                                                                                                                6/9
  Verifying  : neon-0.29.3-3.el6_4.x86_64                                                                                                                                                 7/9
  Verifying  : gnutls-2.8.5-14.el6_5.x86_64                                                                                                                                               8/9
  Verifying  : perl-URI-1.40-2.el6.noarch                                                                                                                                                 9/9

Installed:
  subversion.x86_64 0:1.6.11-12.el6_6                                                                                                                                                        

Dependency Installed:
  gnutls.x86_64 0:2.8.5-14.el6_5     libproxy.x86_64 0:0.3.0-10.el6     libproxy-bin.x86_64 0:0.3.0-10.el6     libproxy-python.x86_64 0:0.3.0-10.el6     libtasn1.x86_64 0:2.3-6.el6_5   
  neon.x86_64 0:0.29.3-3.el6_4       pakchois.x86_64 0:0.4-3.2.el6      perl-URI.noarch 0:1.40-2.el6         

Complete!
[root@LAMP1 html]# 之后就安装成功了,我们创建一个svn的根目录:

mkdir /var/www/svndata

之后我们需要使用svnadmin创建一个代码库myproject1:

svnadmin /var/www/svndata/myproject1

之后我们就创建了代码仓库,可以开始操作了,但是在这之前,我们要配置下我们这个myproject1下的的svn用户和权限。

首先我们可以看到/var/www/svndata/myproject1/目录下的结构:

[root@LAMP1 myproject1]# ll
总用量 24
drwxr-xr-x. 2 root root 4096 3月  19 15:03 conf
drwxr-sr-x. 6 root root 4096 3月  19 13:54 db
-r--r--r--. 1 root root    2 3月  19 13:33 format
drwxr-xr-x. 2 root root 4096 3月  19 13:33 hooks
drwxr-xr-x. 2 root root 4096 3月  19 13:33 locks
-rw-r--r--. 1 root root  229 3月  19 13:33 README.txt
[root@LAMP1 myproject1]# 我们需要到conf下,这里有很多好东西:

[root@LAMP1 conf]# ll
总用量 12
-rw-r--r--. 1 root root 1174 3月  19 14:39 authz
-rw-r--r--. 1 root root  314 3月  19 14:38 passwd
-rw-r--r--. 1 root root 2274 3月  19 13:34 svnserve.conf
[root@LAMP1 conf]# 首先我们要到svnserve.conf里设置匿名用户和授权用户的权限:

anon-access = none
auth-access = write然后我们到passwd文件里创建用户:

[users]
san.zhang=123456
si.li=123456
wu.wang=123456然后到authz文件里设置用户组和授权:

[groups]
users=si.li,wu.wang
admin=san.zhang

[/]
@admin=rw
*=r

[chromext:/branches]
@users=rw其中@代表后面的是组,没有@的话代表用户名。

最后我们开启我们的svn服务器就好了:

svnserve -d -r /var/www/svndata/

(责任编辑:IT)