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,如需转载请自行联系原作者

相关文章
|
9月前
|
弹性计算 运维 监控
Apsara Clouder云计算专项技能认证:云服务器ECS
Apsara Clouder云计算专项技能认证:云服务器ECS
|
6月前
|
应用服务中间件 Docker 容器
在服务器中使用Docker安装Tomcat、同时实现目录挂载、并且部署War包到服务器
这篇文章介绍了在Docker中安装Tomcat的过程,包括搜索Tomcat镜像、拉取镜像、目录挂载的准备、创建并挂载容器,以及如何进入容器和进行测试。文中还说明了如何将WAR包部署到Tomcat服务器并访问部署的应用。
在服务器中使用Docker安装Tomcat、同时实现目录挂载、并且部署War包到服务器
|
9月前
|
弹性计算 运维 Shell
自动备份指定目录到远程服务器
【4月更文挑战第30天】
68 0
|
4月前
|
Linux 数据安全/隐私保护 Windows
centos 7.2 搭建svn服务器
centos 7.2 搭建svn服务器
120 0
|
6月前
|
Ubuntu Linux 测试技术
在Linux中,已知 apache 服务的访问日志按天记录在服务器本地目录/app/logs 下,由于磁盘空间紧张现在要求只能保留最近7天的访问日志,请问如何解决?
在Linux中,已知 apache 服务的访问日志按天记录在服务器本地目录/app/logs 下,由于磁盘空间紧张现在要求只能保留最近7天的访问日志,请问如何解决?
|
6月前
|
Android开发
svn服务器配置常见问题
svn服务器配置常见问题
83 1
|
6月前
|
运维 网络协议 Linux
揭秘CentOS 7:系统目录奥秘大起底,网卡配置秒变高手,让你的服务器管理飞一般的感觉!
【8月更文挑战第5天】CentOS 7作为RHEL的社区版本,以其稳定性和丰富功能广受好评。本文通过案例分析介绍其系统目录结构及网卡配置方法。系统目录如/(根)、/bin(基本命令)、/boot(启动文件)、/dev(设备文件)、/etc(配置文件)、/home(用户目录)和/lib(共享库)等各司其职。网卡配置通过编辑/etc/sysconfig/network-scripts/下的ifcfg文件实现,如设置ens33接口的静态IP地址、子网掩码、网关和DNS服务器,并通过重启网络服务使配置生效。这是系统管理员必备的技能之一。
90 2
|
6月前
|
安全 Linux Shell
Linux服务器 /etc/pam.d目录下的文件都是什么作用?
【8月更文挑战第2天】Linux服务器 /etc/pam.d目录下的文件都是什么作用?
829 2
Request请求转发和重定向的资源路径问题,目录到底加不加,取决于浏览器用,还是服务器用,规避项目目录发生修改,导致重定向失败
Request请求转发和重定向的资源路径问题,目录到底加不加,取决于浏览器用,还是服务器用,规避项目目录发生修改,导致重定向失败
|
8月前
|
监控 Linux BI
【linux服务器系统盘爆满】/www/server/total/logs/目录内容过多导致服务器系统盘爆满,/www/server/total/logs/ 里是什么内容?是否可以删除?
【linux服务器系统盘爆满】/www/server/total/logs/目录内容过多导致服务器系统盘爆满,/www/server/total/logs/ 里是什么内容?是否可以删除?
146 1