svn 服务器创建多个目录 进行统一认证

简介:

实验环境 阿里云服务器 CentOS release 6.8 (Final)


## 安装 svn 

[root@localhost ~]# yum install subversion  -y     


##创建svn的根目录 

[root@localhost ~]#  mkdir -p /home/svnuser        


##建立多个产品仓库 

 

[root@localhost ~]# mkdir -p /home/svnuser 

[root@localhost ~]# mkdir -p /home/svnuser/test1

[root@localhost ~]# mkdir -p /home/svnuser/test2

[root@localhost ~]# mkdir -p /home/svnuser/test3

[root@localhost ~]# svnadmin create /home/svnuser/test1/

[root@localhost ~]# svnadmin create /home/svnuser/test2/

[root@localhost ~]# svnadmin create /home/svnuser/test3/


修改板块控制文件  

[root@localhost svnuser]# ls

test1  test2  test3

[root@localhost svnuser]# pwd

/home/svnuser


[root@localhost svnuser]# vim test1/conf/svnserve.conf 

anon-access = none  ##  不允许匿名访问

auth-access = write   ##认证用户可读

### The password-db option controls the location of the password

### database file.  Unless you specify a path starting with a /,

### the file's location is relative to the directory containing

### this configuration file.

### If SASL is enabled (see below), this file will NOT be used.

### Uncomment the line below to use the default password file.

password-db =../../passwd  ## 密码认证

### The authz-db option controls the location of the authorization

### rules for path-based access control.  Unless you specify a path

### starting with a /, the file's location is relative to the the

### directory containing this file.  If you don't specify an

### authz-db, no path-based access control is done.

### Uncomment the line below to use the default authorization file.

authz-db = ../../authz  ##   用户权限配置

### This option specifies the authentication realm of the repository.

### If two repositories have the same authentication realm, they should

### have the same password database, and vice versa.  The default realm

### is repository's uuid.

# realm = My First Repository


[root@localhost svnuser]# cp test1/conf/svnserve.conf test2/conf/svnserve.conf 

cp: overwrite `test2/conf/svnserve.conf'? y

[root@localhost svnuser]# cp test1/conf/svnserve.conf test3/conf/svnserve.conf 

cp: overwrite `test3/conf/svnserve.conf'? y


[root@localhost svnuser]# cp test1/conf/authz .

[root@localhost svnuser]# cp test1/conf/passwd .

[root@localhost svnuser]# ls

authz  passwd  test1  test2  test3


配置用户权限 


[groups]   ##定义组

test1=test1

test2=test2

test3=test3

admin=admin


[/]   #表示根目录 这里指的是 /home/svnuser

@admin =rw


[svnuser/test1:/] #test1的目录

@test1 = rw  ##test1拥有读写权限

* = r  ## 只有读的权限

[svnuser/test2:/]

@test2 = rw

* = r

[svnuser/test3:/]

@test3 = rw

* = r


[root@localhost svnuser]# vim passwd

[users]  ##配置用户的权限

# harry = harryssecret

# sally = sallyssecret

test1=test1

test2=test2

test3=test3

admin=admin


启动svn 服务 


[root@localhost svnuser]# svnserve -d -r  /home/  


查看端口 


[root@localhost svnuser]# ps aux | grep svn 

root       855  0.0  0.0 156540   756 ?        Ss   14:50   0:00 svnserve -d -r /home/

root       861  0.0  0.0 103316   836 pts/0    S+   14:51   0:00 grep svn

[root@localhost svnuser]# netstat -anutp | grep svn

tcp        0      0 0.0.0.0:3690                0.0.0.0:*                   LISTEN      855/svnserve 


客户端使用小乌龟 svn://{your-server-ip}:/svnuser/test1  




本文转自 水滴石川1 51CTO博客,原文链接:http://blog.51cto.com/sdsca/1786578,如需转载请自行联系原作者

相关文章
|
2月前
|
存储 网络协议 Ubuntu
Linux环境下的SVN服务器搭建并结合内网穿透实现远程连接
Linux环境下的SVN服务器搭建并结合内网穿透实现远程连接
|
2月前
|
网络协议 Shell 网络安全
实验目的1.编译安装httpd2.优化路径3.并将鲜花网站上传到web服务器为网页目录4.在客户机访问网站http://www.bdqn.com
实验目的1.编译安装httpd2.优化路径3.并将鲜花网站上传到web服务器为网页目录4.在客户机访问网站http://www.bdqn.com
166 0
|
4月前
|
Ubuntu 安全 网络安全
百度搜索:蓝易云【Ubuntu系统SVN服务器搭建教程】
现在,你已经成功在Ubuntu系统上搭建了SVN服务器。其他用户可以通过SVN客户端连接到你的SVN服务器,进行代码版本管理和协作开发。注意,为了安全起见,建议配置SSL加密以保护数据传输。
39 1
|
4月前
|
Apache 项目管理 数据安全/隐私保护
【cpolar】TortoiseSVN如何安装并实现公网提交文件到本地SVN服务器
【cpolar】TortoiseSVN如何安装并实现公网提交文件到本地SVN服务器
49 0
|
6天前
|
弹性计算 运维 Shell
自动备份指定目录到远程服务器
【4月更文挑战第30天】
17 0
|
11天前
|
数据采集 前端开发 JavaScript
vue3 + fastapi 实现选择目录所有文件自定义上传到服务器
vue3 + fastapi 实现选择目录所有文件自定义上传到服务器
14 0
|
2月前
|
网络协议 Ubuntu Linux
如何在Linux环境搭建本地SVN服务器并结合cpolar实现公网访问
如何在Linux环境搭建本地SVN服务器并结合cpolar实现公网访问
|
3月前
|
存储 网络协议 Ubuntu
Linux环境下SVN服务器的搭建与公网访问:使用cpolar端口映射的实现方法
由于文档资料越来越多,将所有资料都存放在自己的电脑上容易混淆,并且也不利于分享。这种情况下,考虑将资料上传SVN统一管理,这样一来其他人也能很方便的查略各种资料。
|
5月前
|
算法 程序员 Apache
Windows下搭建SVN服务器并配置eclipse和idea
Windows下搭建SVN服务器并配置eclipse和idea
68 1
|
5天前
|
存储 弹性计算 固态存储
阿里云服务器CPU内存配置详细指南,如何选择合适云服务器配置?
阿里云服务器配置选择涉及CPU、内存、公网带宽和磁盘。个人开发者或中小企业推荐使用轻量应用服务器或ECS经济型e实例,如2核2G3M配置,适合低流量网站。企业用户则应选择企业级独享型ECS,如通用算力型u1、计算型c7或通用型g7,至少2核4G配置,公网带宽建议5M,系统盘可选SSD或ESSD云盘。选择时考虑实际应用需求和性能稳定性。