Centos搭建SVN服务器subversion

简介:

1、安装  subversion

1
2
3
4
5
6
7
8
9
10
11
yum  install  subversion
#最终显示
Installed:
   subversion.x86_64 0:1.6.11-12.el6_6                                                                                                                                                          
 
Dependency Installed:
   apr.x86_64 0:1.3.9-5.el6_2       apr-util.x86_64 0:1.3.9-3.el6_0.1     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    
   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!
#代表安装成功

2、判断是否安装成功

1
2
3
4
5
6
7
8
9
10
11
12
13
14
svnserve --version
svnserve, version  1.6 . 11  (r934486)
    compiled Feb  10  2015 22 : 08 : 22
 
Copyright (C)  2000 - 2009  CollabNet.
Subversion  is  open source software, see http: //subversion.tigris.org/
This product includes software developed by CollabNet (http: //www.Collab.Net/).
 
The following repository back-end (FS) modules are available:
 
* fs_base : Module  for  working  with  a Berkeley DB repository.
* fs_fs : Module  for  working  with  a plain file (FSFS) repository.
 
Cyrus SASL authentication  is  available.

3、建立SVN库。

1
2
[root@li538- 34  ~]# mkdir -p  /opt/svn/repos
[root@li538- 34  ~]# svnadmin create /opt/svn/repos

执行完上面的命令后,在repos下建立conf, db,format,hooks, locks, README.txt。

4、配置svn

进入上面生成的文件夹conf下,进行配置,   有以下几个文件authz, passwd, svnserve.conf
其中authz 是权限控制,可以设置哪些用户可以访问哪些目录,   passwd是设置用户和密码的,    svnserve是设置svn相关的操作。

1
2
3
4
5
6
7
8
9
10
[root@li538-34 ~] # cd /opt/svn/repos
[root@li538-34 repos] # ll
total 24
drwxr-xr-x 2 root root 4096 Feb 24 06:31 conf
drwxr-sr-x 6 root root 4096 Feb 24 06:31 db
-r--r--r-- 1 root root    2 Feb 24 06:31  format
drwxr-xr-x 2 root root 4096 Feb 24 06:31 hooks
drwxr-xr-x 2 root root 4096 Feb 24 06:31 locks
-rw-r--r-- 1 root root  229 Feb 24 06:31 README.txt
[root@li538-34 repos] #


进入conf打开passwd

1
2
3
4
5
6
7
[root@li538-34 repos] # cd conf
[root@li538-34 conf] # ll
total 12
-rw-r--r-- 1 root root 1080 Feb 24 06:31 authz
-rw-r--r-- 1 root root  309 Feb 24 06:31  passwd
-rw-r--r-- 1 root root 2279 Feb 24 06:31 svnserve.conf
[root@li538-34 conf] # vim passwd
1
2
3
4
5
[ users ]
# harry = harryssecret
# sally = sallyssecret
ningyuqiao=ningyuqiao
用户名=密码

打开authz,设置权限

1
2
[/]
ningyuqiao=rw

意思是ningyuqiao用户对所有的目录有读写权限

设定svnserv.conf

1
2
3
4
5
anon-access = none  # 使非授权用户无法访问
auth-access = write  # 使授权用户有写权限
password-db =  passwd
authz-db = authz    # 访问控制文件
realm =  /opt/svn/repos  # 认证命名空间,subversion会在认证提示里显示,并且作为凭证缓存的关键字。

注意:把中文全部去掉,否则会报错。

启动svn服务

1
svnserve -d -r  /opt/svn/repos

如果已经有svn在运行,可以换一个端口运行

1
svnserve -d -r  /opt/svn/repos  --listen-port 3391

采用TortoiseSVN, 连接地址为: svn://your server address (如果指定端口需要添加端口  :端口号)\







      本文转自ning1022 51CTO博客,原文链接:http://blog.51cto.com/ning1022/1615063,如需转载请自行联系原作者





相关文章
|
1月前
|
存储 网络协议 Ubuntu
Linux环境下的SVN服务器搭建并结合内网穿透实现远程连接
Linux环境下的SVN服务器搭建并结合内网穿透实现远程连接
|
2月前
|
缓存 关系型数据库 MySQL
百度搜索:蓝易云【CentOS8服务器安装MySQL报错:no match mysql-community-server】
现在,你已经成功安装了MySQL服务器并解决了"no match mysql-community-server"的报错问题。祝你使用愉快!
43 1
|
15天前
|
Linux
centos 查看服务器信息 版本cpu
centos 查看服务器信息 版本cpu
12 0
|
1月前
|
网络协议 Ubuntu Linux
如何在Linux环境搭建本地SVN服务器并结合cpolar实现公网访问
如何在Linux环境搭建本地SVN服务器并结合cpolar实现公网访问
|
1月前
|
Oracle 关系型数据库 Linux
服务器Centos7 静默安装Oracle Database 12.2
服务器Centos7 静默安装Oracle Database 12.2
85 0
|
1月前
|
存储 弹性计算 Linux
阿里云ECS(CentOS镜像)安装docker
阿里云ECS(CentOS镜像)安装docker
383 0
|
2月前
|
存储 网络协议 Ubuntu
Linux环境下SVN服务器的搭建与公网访问:使用cpolar端口映射的实现方法
由于文档资料越来越多,将所有资料都存放在自己的电脑上容易混淆,并且也不利于分享。这种情况下,考虑将资料上传SVN统一管理,这样一来其他人也能很方便的查略各种资料。
|
Linux Shell 数据安全/隐私保护
CentOS 搭建SVN服务器
CentOS 搭建SVN服务器
411 0
CentOS 搭建SVN服务器