2.在mac环境下搭建一个SVN服务器环境

1)创建一个名为myCode的仓库——svnadmin命令

格式:

svnadmin SUBCOMMAND REPOS_PATH  [ARGS & OPTIONS ...]

svnadmin是Subversion存储库管理工具

首先就是在本地/Users/user的目录下创建一个名为mySVN的文件夹,然后就能够在这个文件夹中创建多个目录仓库

比如要创建一个名为myCode的仓库,执行语句为:

userdeMBP:~ user$ svnadmin create /Users/user/mySVN/myCode

然后mySVN文件夹下就生成了myCode,其目录结构为:

2)配置mySVN的用户权限

即修改/Users/user/mySVN/myCode/conf目录下的三个文件

1》svnserve.conf文件

# anon-access = read #匿名用户可读
# auth-access = write #授权用户可写 # password-db = passwd #使用哪个文件(即passwd文件)作为账号文件。由于同在一个目录路径下,所以这里不用全路径 # authz-db = authz #使用哪个文件作为权限文件

将上面的四个配置项前面的#号和空格去掉

anon-access = read代表匿名访问的时候是只读的,若改为anon-access = none代表禁止匿名访问,需要帐号密码才能访问

2》passwd文件

设置账户名和密码

[users]
# harry = harryssecret
# sally = sallyssecret
boss =

添加boss = 00000,boss为账户名,00000为密码

3》authz文件

配置用户组和权限

我们可以将在passwd里添加的用户分配到不同的用户组里,这样以后就可以对不同用户组设置不同的权限,没有必要对每个用户进行单独设置权限。

1> 在[groups]下面添加组名和用户名,如果有多个用户之间用逗号(,)隔开

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
topGroup = boss

说明boss账户被分配到topGroup这个组中

2> [/]代表svn服务器中的所有资源库

[/]
@topGroup = rw

表示topGroup这个组中的所有用户对所有资源库都有读写(rw)权限,组名前面要用@

如果只是设置某个用户可以写成,不用@:

[/]
boss = rw

资源也可以写的很细,比如:

[/foo/bar]
[repository:/baz/fuz]

3> 别名

[aliases] #将boss账户的别名设置为joe
joe = boss [/test] #然后让其对/test的权限为可读,使用别名需使用&
&joe = r

4> *

[repository:/baz/fuz]
* = r #代表所有人对该资源都有读权限

5> $authenticated

所有经过身份验证的用户,使用“$authenticated”表示

6>$anonymous

匿名用户使用“$anonymous”表示

3)启动svn服务器——svnserve命令

格式:

svnserve [-d | -i | -t | -X] [options]

Subversion存储库服务器

选项:

Valid options:
-d [--daemon] : daemon mode 守护进程模式,将会启动服务作为一个独立的端口监控进程运行在后台。
可以使用--listen-port=和--listen-host=参数来自定义需要的端口和主机名称。当前模式默认的端口是3690
-i [--inetd] : inetd mode 端口监控模式,用端口监控来启动处理客户的访问请求的进程。
当使用-i参数启动服务的时候,svnserve服务 通过stdin和stdout用自定义协议和客户端通讯。同时服务侦听3690端口。
-t [--tunnel] : tunnel mode 隧道模式,这个模式要求远程服务程序,如RSH或SSH,已经成功验证用户,并且使用已经校验的用户启动一个属于该用户的svnserve进程。
当使用该模式提供服务时,要确认启动的用户帐户具备对Repository的读/写权限。
-X [--listen-once] : listen-once mode (useful for debugging) 仅监听模式(在调试时有用)
-r [--root] ARG : root of directory to serve 要服务的目录的根目录
-R [--read-only] : force read only, overriding repository config file 强制只读,覆盖存储库配置文件
--config-file ARG : read configuration from file ARG 从文件ARG中读取配置信息
--listen-port ARG : listen port. The default port is 3690.[mode: daemon, listen-once] 监听端口,默认为3690[模式为daemon时使用,仅监听]
--listen-host ARG : listen hostname or IP address By default svnserve listens on all addresses.[mode: daemon, listen-once]
监听主机名或IP地址,默认情况下svnservice监听所有地址[模式为daemon时使用,仅监听]
-6 [--prefer-ipv6] : prefer IPv6 when resolving the listen hostname 在解析监听主机名时首选IPv6
[IPv4 is preferred by default. 默认首选IPv4
Using IPv4 and IPv6 at the same time is not supported in daemon mode. 在守护模式下不支持同时使用IPv4和IPv6。
Use inetd mode or tunnel mode if you need this.] 如果你需要使用这个参数,请选择使用inetd或tunnel模式
-c [--compression] ARG : compression level to use for network transmissions [0 .. no compression, 5 .. default,9 .. maximum compression]
用于网络传输的压缩级别[0 ..不压缩,5 ..默认级别,9 ..最大压缩]
-M [--memory-cache-size] ARG : size of the extra in-memory cache in MB used to minimize redundant operations.
Default is 16.0 switches to dynamically sized caches.[used for FSFS and FSX repositories only]
用于最小化冗余操作的额外内存缓存(以MB为单位)的大小
默认是16.0切换到动态大小的缓存。[只适用于FSFS及FSX存储库]
--cache-txdeltas ARG : enable or disable caching of deltas between older revisions. 启用或禁用旧版本之间的增量缓存
Default is yes. 默认是启用的
[used for FSFS and FSX repositories only] 仅用于FSFS和FSX存储库
--cache-fulltexts ARG : enable or disable caching of file contents 启用或禁用文件内容缓存
Default is yes. 默认是启用的
[used for FSFS and FSX repositories only] 仅用于FSFS和FSX存储库
--cache-revprops ARG : enable or disable caching of revision properties. 启用或禁用修订属性的缓存
Consult the documentation before activating this. 在激活它之前,请参阅文档
Default is no. 默认是禁用的
[used for FSFS and FSX repositories only] 仅用于FSFS和FSX存储库
--cache-nodeprops ARG : enable or disable caching of node properties 启用或禁用节点属性的缓存
Default is yes. 默认是启用的
[used for FSFS repositories only] 仅用于FSFS存储库
--client-speed ARG : Optimize network handling based on the assumption that most clients are connected with a bitrate of ARG Mbit/s.
Default is 0 (optimizations disabled).
假设大多数客户端以ARG Mbit/s的比特率连接,优化网络处理。
默认值为0(禁用优化)
--block-read ARG : Parse and cache all data found in block instead of just the requested item. 解析和缓存在块中找到的所有数据,而不仅仅是请求的项。
Default is no. 默认是禁用的
[used for FSFS repositories in 1.9 format only] 只适用于1.9格式的FSFS存储库
-T [--threads] : use threads instead of fork [mode: daemon] 使用线程而不是分叉[模式:守护进程]
--min-threads ARG : Minimum number of server threads, even if idle. 服务器线程的最小数量,即使是空闲的。
Capped to max-threads; minimum value is 0. max-threads封顶;最小值是0。
Default is 1. 默认为1
[used only with --threads] 仅与--threads参数一起使用
--max-threads ARG : Maximum number of server threads, even if there are more connections. 服务器线程的最大数量,即使有更多的连接
Minimum value is 1. 最小值为1
Default is 256. 默认为256
[used only with --threads] 仅与--threads参数一起使用
--max-request-size ARG : Maximum acceptable size of a client request in MB. 客户端请求的最大可接受大小(MB为单位)
This implicitly limits the length of paths and property values that can be sent to the server.
这隐式地限制了可以发送到服务器的路径和属性值的长度
Also the peak memory usage for protocol handling per server thread or sub-process.
和每个服务器线程或子进程的协议处理的内存使用峰值。
0 disables the size check; 如果设置值为0,则禁用该大小检查
default is 16. 默认值为16
--max-response-size ARG : Maximum acceptable server response size in MB. 最大可接受的服务器响应大小(以MB为单位)。
Longer responses get truncated and return an error. 较长的响应将被截断并返回错误。
This limits the server load e.g. when checking out at the wrong path level.这限制了服务器负载,例如在错误的路径级别签出时
Default is 0 (disabled). 默认设置为0(即禁用)
--foreground : run in foreground (useful for debugging)[mode: daemon] 在前台运行(用于调试)[mode: daemon]
--single-thread : handle one connection at a time in the parent process (useful for debugging) 在父进程中每次处理一个连接(用于调试)
--log-file ARG : svnserve log file svnserve日志文件
--pid-file ARG : write server process ID to file ARG[mode: daemon, listen-once] 将服务器进程ID写入文件ARG[模式为daemon时使用,仅监听]
--tunnel-user ARG : tunnel username (default is current uid's name)[mode: tunnel] 隧道用户名(默认为当前uid的名称)[模式为tunnel时使用]
-h [--help] : display this help 显示帮助信息
--virtual-host : virtual host mode (look for repo in directory of provided hostname) 虚拟主机模式(在提供主机名的目录中查找repo)
--version : show program version information 显示项目的版本信息
-q [--quiet] : no progress (only errors) to stderr 没有进程(只有错误)到stderr

执行:

userdeMBP:~ user$ svnserve -d -r /Users/user/mySVN/myCode  //没有反应则成功
userdeMBP:~ user$

然后可以到活动监视器中查看它,如下图

4)关闭svn服务器——直接在活动监视器上关闭它

到这里svn服务端的使用就讲完了,下面要讲的是其客户端的使用

Mac svn使用学习-2-服务端的更多相关文章

  1. Mac svn使用学习-3-客户端调用服务端简单例子

    既然在前一篇内容中我们已经讲svn服务器搭建好了,那么接下来我们试着试着简单使用一个该服务器 1.从本地导入代码到服务器上 userdeMBP:~ user$ svn import /Users/us ...

  2. Mac svn使用学习-4-客户端cli命令详解

    客户端cli的使用 WC:Working Copy 你的工作区 将文件或目录版本化,这样下一次提交到存储库的时候,他们就都会被提交上去.能实现版本化的命令有: add 1.import 是否访问存储库 ...

  3. 学习C++服务端一:MySql与C++

    mysql学习: http://www.cnblogs.com/cy163/archive/2008/10/16/1312277.html http://developer.51cto.com/art ...

  4. CMDB学习之五服务端api

    服务端api 对发送来的数据进行处理,并返回结果,首先要创建一个Django项目 第一步,就是写URL路由在分支中写url api 主路由 from django.conf.urls import u ...

  5. Mac svn使用学习-1-简介

    在Windows环境中,可以使用TortoiseSVN来搭建svn环境.但是由于Mac自带了svn的服务器端和客户端功能,因此可以直接使用svn功能. svn即subversion,Subversio ...

  6. SpringBoot之oauth2.0学习之服务端配置快速上手

    现在第三方登录的例子数见不鲜.其实在这种示例当中,oauth2.0是使用比较多的一种授权登录的标准.oauth2.0也是从oauth1.0升级过来的.那么关于oauth2.0相关的概念及其原理,大家可 ...

  7. Mac下进行基于java服务端语言的微信公众号本地js-sdk调试的大致方法

    开发微信公众号应用调用js-sdk,需要先在微信公众号后台配置可信域名,之后从微信的入口地址重定向到改域名下的路径后便会返回code,之后可以拿到一系列需要的参数等等.那么本地开发,如果使用的是PHP ...

  8. 【分布式】Zookeeper服务端启动

    一.前言 前面已经了解了Zookeeper会话相关知识点,接着来学习Zookeeper服务端相关细节. 二.服务端 服务端整体架构如下 Zookeeper服务器的启动,大致可以分为以下五个步骤 1. ...

  9. vue服务端渲染简单入门实例

    想到要学习vue-ssr的同学,自不必多说,一定是熟悉了vue,并且多多少少做过几个项目.然后学习vue服务端渲染无非解决首屏渲染的白屏问题以及SEO友好. 话不多说,笔者也是研究多日才搞明白这个服务 ...

随机推荐

  1. Python发送短信提醒

    Python发送短信可借助腾讯云平台提供的短信服务 发送短信需要的及格参数: 1.SDK_AppID和SDK_Key 2.签名: 3.模板ID 下面贴出源码DEMO: from qcloudsms_p ...

  2. SpringBoot结合Swagger2自动生成api文档

    首先在pom.xml中添加如下依赖,其它web,lombok等依赖自行添加 <dependency> <groupId>io.springfox</groupId> ...

  3. Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central

    问题: maven安装完成,环境变量配置没有问题,cmd窗口运行mvn compile的时候报错如下: Plugin org.apache.maven.plugins:maven-resources- ...

  4. ScheduledExecutorService的两种方法

    开发中,往往遇到另起线程执行其他代码的情况,用java定时任务接口ScheduledExecutorService来实现. ScheduledExecutorService是基于线程池设计的定时任务类 ...

  5. Codeforces687C(SummerTrainingDay03-D DP)

    C. The Values You Can Make time limit per test:2 seconds memory limit per test:256 megabytes input:s ...

  6. MySql处理函数

    Lower(name) 转换为小写 Upper(name)转换为大写 Substr(name,length,index):从index开始截取length个字符串 Length(name) 获取长度 ...

  7. js 复制粘贴

    input输入框<div id="top-title" style="position: relative"> <img class=&quo ...

  8. SQLServer 学习笔记之超详细基础SQL语句 Part 12(The End)

    Sqlserver 学习笔记 by:授客 QQ:1033553122 -----------------------接Part 11------------------- 现在,我们希望从 " ...

  9. Just write about

    创建一个学生对象,存储学生对象,学生对象的数据来源于键盘录入,最后遍历集合. 学生类,集合对象,键盘录入数据并将数据赋值给学生类的成员(可以写成一个方法),调用方法,遍历集合.

  10. MAYA逼真手枪制作视频教程 中文字幕

    下载地址 更多中文字幕教程请关注微镜映画网,有各类CG教程提供