当前位置:首页 >> 主机教程

常见SEO阿里云服务器虚拟机linux配置svn服务器 使用 注意事项

发布时间:2025-12-16 11:54:56 作者:熊猫主机教程网
简介 饥荒云 服务器 本文以ubuntu系统进行安装。 1、安装svn服务器 输入 y 回车确认安装。 安装完毕后可以用 下边的命令查看是否安装完成,如果现实出版本号和版权信息等等就证明安装完成。svn --version 成功后展示如下信息 svn, version 1.8.8 (r1568071) compiled Aug 20 2015, 12:51:30 on x86

饥荒云 服务器

本文以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=testuser=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 就可以关闭了。

腾讯云服务器解析