作为程序员一定要保持良好的睡眠,才能好编程

linux 安装svn详细步骤及踩坑

发布时间:2018-04-11


[root@localhost ~]# yum install subversion
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
epel/metalink                                                                                            | 6.6 kB     00:00     
 * base: ftp.sjtu.edu.cn
 * epel: mirror.lzu.edu.cn
 * extras: ftp.sjtu.edu.cn
 * updates: ftp.sjtu.edu.cn
base                                                                                                     | 3.7 kB     00:00     
https://mirror.lzu.edu.cn/epel/6/i386/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
epel                                                                                                     | 4.7 kB     00:00     
epel/primary_db                                                                                          | 5.1 MB     00:06     
extras                                                                                                   | 3.3 kB     00:00     
updates                                                                                                  | 3.4 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package subversion.i686 0:1.6.11-15.el6_7 will be installed
--> Processing Dependency: perl(URI) >= 1.17 for package: subversion-1.6.11-15.el6_7.i686
--> Running transaction check
---> Package perl-URI.noarch 0:1.40-2.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================
 Package                        Arch                       Version                               Repository                Size
================================================================================================================================
Installing:
 subversion                     i686                       1.6.11-15.el6_7                       base                     2.2 M
Installing for dependencies:
 perl-URI                       noarch                     1.40-2.el6                            base                     117 k

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

Total download size: 2.3 M
Installed size: 11 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): perl-URI-1.40-2.el6.noarch.rpm                                                                    | 117 kB     00:00     
(2/2): subversion-1.6.11-15.el6_7.i686.rpm                                                               | 2.2 MB     00:02     
--------------------------------------------------------------------------------------------------------------------------------
Total                                                                                           931 kB/s | 2.3 MB     00:02     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : perl-URI-1.40-2.el6.noarch                                                                                   1/2 
  Installing : subversion-1.6.11-15.el6_7.i686                                                                              2/2 
  Verifying  : perl-URI-1.40-2.el6.noarch                                                                                   1/2 
  Verifying  : subversion-1.6.11-15.el6_7.i686                                                                              2/2 

Installed:
  subversion.i686 0:1.6.11-15.el6_7                                                                                             

Dependency Installed:
  perl-URI.noarch 0:1.40-2.el6                                                                                                  

Complete!

[root@localhost ~]# #建立svn目录 (使用隐藏目录)
[root@localhost ~]# mkdir /home/.svn
[root@localhost ~]#  #建立test仓库
[root@localhost .svn]# mkdir test
[root@localhost .svn]# svnadmin create /home/.svn/test
[root@localhost .svn]#

 

3、配置和管理svn

 1)建立好的svn仓库目录下都有一个 conf 文件夹, 使用 vim svnserve.conf  配置项在[general]下

anon-access:匿名用户的权限,可以为read,write和none,默认值read。不允许匿名用户访问:anon-access = none 

auth-access:认证用户的权限,可以为read,write和none,默认值write。 

password-db:密码数据库的路径,去掉前边的# 

authz-db:认证规则库的路径,去掉前边的#。 

注意:这些配置项的行都要顶格,否则会报错。修改配置后需要重启svn才能生效。

a7.png



2). 配置passwd文件 
    这是每个用户的密码文件,比较简单,就是“用户名=密码”,采用的是明码。如allen=111111 

a8.png


3) 配置authz 这个文件


[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
admin=news

[/]
@admin=rw
*=r


将admin=news  这个添加到groups 下


然后重新写入

[/]
@admin=rw
*=r

访问权限。


以上信息配置好以后,启动svnserve服务器:

启动和停止svn

这里有两种方式进行启动

如果需要svn自启动  可以把命令加入 /etc/rc.local 中

svnserve -d -r /home/.svn


1、根目录启动

.svn目录启动,svnserve -d -r /home/.svn

客户端连接:svn://192.168.1.222/test

2、仓库目录启动

svnserver -d -r /home/.svn/test

客户端连接 :svn://192.168.1.222/


停止

killall svnserver




客户端使用方法:


checkout 的地址: svn://192.168.1.222/test




https://wenku.baidu.com/view/54b04334a4e9856a561252d380eb6294dd8822f3.html




http://blog.sina.com.cn/s/blog_13cc013b50102wk5m.html



https://www.cnblogs.com/andy2simple/p/5386256.html



https://blog.csdn.net/wangyunzhong123/article/details/51559116

https://www.cnblogs.com/fengyumeng/p/7356904.html