网站首页 > 开源技术 正文
本文以ubuntu系统进行安装。
1、安装svn服务器
输入 y 回车确认安装。
安装完毕后可以用 下边的命令查看是否安装完成,如果现实出版本号和版权信息等等就证明安装完成。
svn --version 成功后展示如下信息 svn, version 1.8.8 (r1568071) compiled Aug 20 2015, 12:51:30 on x86_64-pc-linux-gnu Copyright (C) 2013 The Apache Software Foundation. This software consists of contributions made by many people; see the NOTICE file for more information. Subversion is open source software, see http://subversion.apache.org/ The following repository access (RA) modules are available: * ra_svn : Module for accessing a repository using the svn network protocol. - with Cyrus SASL authentication - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme * ra_serf : Module for accessing a repository via WebDAV protocol using serf. - using serf 1.3.3 - handles 'http' scheme - handles 'https' scheme
2、创建版本库
首先创建目录,根据你的需要创建svn目录。我目录是:/usr/svn/test
然后创建版本仓库:
3、配置svn服务器
创建版本仓库后再 test/conf文件夹下生成了四个配置文件:authz hooks-env.tmpl passwd svnserve.conf
①、首先 svnserve.conf里边配置了版本库的权限,需要把下边5行的注释打开,一定注意,去掉#号的同时把空格去掉,否则svn服务不能正常运行
anon-access = none #控制非鉴权用户访问版本库的权限。取值范围为"write"、"read"和"none"。即"write"为可读可写,"read"为只读,"none"表示无访问权限。缺省值:read auth-access = write #控制鉴权用户访问版本库的权限。取值范围为"write"、"read"和"none"。即"write"为可读可写,"read"为只读,"none"表示无访问权限。缺省值:write password-db = passwd #指定账户密码配置文件,当前文件夹下的passwd文件 authz-db = authz #权限配置文件,当前文件夹下的authz文件 realm = first
#版本库的认证域,即在登录时提示的认证域名称。若两个版本库的 认证域相同,建议使用相同的用户名口令数据文件。缺省值:一个UUID(Universal Unique IDentifier,全局唯一标示)
②、配置passwd
如下代码,配置了用户名为test的用户,并为其创建了密码test123.如需要配置多用户就多写几个吧,记得换行
### This file is an example password file for svnserve. ### Its format is similar to that of svnserve.conf. As shown in the ### example below it contains one section labelled [users]. ### The name and password for each user follow, one account per line. [users] # harry = harryssecret # sally = sallyssecret test=test123
③配置authz权限
下边的代码为test用户创建了读和写的权限。
[groups] # harry_and_sally = harry,sally # harry_sally_and_joe = harry,sally,&joe # [/foo/bar] # harry = rw # &joe = r # * = # [repository:/baz/fuz] # @harry_and_sally = rw # * = r [/] test=rw
如果用户较多,需要分角色划分权限参考下边代码
这段代码,为test创建了admin的角色,为ttt用户创建了user的角色,最后使用@符号为角色创建权限,admin角色读写权限,user角色读权限。
[groups] # harry_and_sally = harry,sally # harry_sally_and_joe = harry,sally,&joe # [/foo/bar] # harry = rw # &joe = r # * = admin=test
user=ttt # [repository:/baz/fuz] # @harry_and_sally = rw # * = r [/] @admin=rw
@user=r
ok,配置已经完成,让我们启动svn服务器试试吧
执行命令:
启动服务器,-d表示守护线程后台运行,-r表示指定目录。注意:不要写成svnserve -d -r /usr/svn/test。否则虽然服务可正常启动,但是客户端用的时候可能会产生问题
查看是否启动成功:
如果结果为两个线程在运行,一般是成功了。
4、客户端访问
下载客户端不在赘述。
svn地址:svn://ip/test 然后输入用户名test和密码test123确认。
是不是连上了呢?如果没有检查是否清除了旧的数据信息,
清除旧数据方法:右键->tortoisesvn->setting->Saved Data,都clear掉吧。
最后补充关闭svn服务器的方法:使用ps -ef | grep svnserve查看进程后,记住pid,然后 kill -9 pid 就可以关闭了。
猜你喜欢
- 2025-05-08 基本Spring Cloud的微服务架构搭建及应用(一)
- 2025-05-08 代码质量扫描工具SonarQube原理及环境搭建
- 2025-05-08 小心!你的这些习惯和粗心,可能正在泄露信息!丨提示
- 2025-05-08 一步步搭建openwrt编译环境并编译ddserver源码
- 2025-05-08 远程办公、巡逻机器人、口罩识别……离不开一群“研发技术宅”
- 2025-05-08 树莓派可以DIY有趣的小制作(自己做树莓派)
- 2025-05-08 Git使用指南 | 教你轻松学会Git(git用法教程)
- 2025-05-08 UE5官方推荐!大型项目版本控制用Perforce还是SVN?
- 2025-05-08 戴尔服务器T410三块硬盘RAID5数据恢复成功案例
- 2025-05-08 为什么互联网巨头使用Git而放弃SVN?(含核心命令与原理)
你 发表评论:
欢迎- 05-08Peking Opera Featuring National Treasure Min Fanglei Premiers in Changsha
- 05-08安卓版Opera Mini浏览器更新,增强大屏设备支持
- 05-08Opera 36.0开发者版本发布:个性化新闻+简化菜单
- 05-08Vitas发布20周年专辑《OPERA20》首支单曲
- 05-08Android 版 Opera 89 带来了大量标签页改进
- 05-08基本Spring Cloud的微服务架构搭建及应用(一)
- 05-08代码质量扫描工具SonarQube原理及环境搭建
- 05-08小心!你的这些习惯和粗心,可能正在泄露信息!丨提示
- 最近发表
-
- Peking Opera Featuring National Treasure Min Fanglei Premiers in Changsha
- 安卓版Opera Mini浏览器更新,增强大屏设备支持
- Opera 36.0开发者版本发布:个性化新闻+简化菜单
- Vitas发布20周年专辑《OPERA20》首支单曲
- Android 版 Opera 89 带来了大量标签页改进
- 基本Spring Cloud的微服务架构搭建及应用(一)
- 代码质量扫描工具SonarQube原理及环境搭建
- 小心!你的这些习惯和粗心,可能正在泄露信息!丨提示
- 一步步搭建openwrt编译环境并编译ddserver源码
- 远程办公、巡逻机器人、口罩识别……离不开一群“研发技术宅”
- 标签列表
-
- jdk (81)
- putty (66)
- rufus (78)
- 内网穿透 (89)
- okhttp (70)
- powertoys (74)
- windowsterminal (81)
- netcat (65)
- ghostscript (65)
- veracrypt (65)
- asp.netcore (70)
- wrk (67)
- aspose.words (80)
- itk (80)
- ajaxfileupload.js (66)
- sqlhelper (67)
- express.js (67)
- phpmailer (67)
- xjar (70)
- redisclient (78)
- wakeonlan (66)
- tinygo (85)
- startbbs (72)
- webftp (82)
- vsvim (79)
本文暂时没有评论,来添加一个吧(●'◡'●)