专栏名称: 请叫我算术嘉
今天看啥  ›  专栏  ›  请叫我算术嘉

Ubuntu16.04.5LTS安装SVN

请叫我算术嘉  · CSDN  ·  · 2019-12-01 14:16

文章预览

本文简单介绍Ubuntu系统下SVN的搭建过程

更新源

sudo apt-get update
  • 1

安装SVN

sudo apt-get install subversion
  • 1

创建文件夹

sudo mkdir /home/svn
sudo mkdir /home/svn/repository
sudo chmod -R 777 /home/svn/repository
sudo svnadmin create /home/svn/repository
cd /home/svn/repository/
sudo chmod -R 777 db
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

修改svnserve.conf

cd /home/svn/repository/conf/
sudo vi svnserve.conf 
  • 1
  • 2

修改这四行如下所示
anon-access = none 匿名用户不可读
auth-access = write 权限用户可写
password-db = passwd 密码文件为passwd
authz-db = authz 权限文件为authz

### users have read and write access to the repository.
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
### directory containing this file.  The specified path may be a
### repository relative URL (^/) or an absolute file:// URL to a text
### file in a Subversion repository.  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
### The groups-db option controls the location of the groups file.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

修改password文件,添加访问用户

sudo vi passwd
  • 1
[users]
# harry = harryssecret
# sally = sallyssecret
lidata = lidata429
  • 1
  • 2
  • 3
  • 4

给用户增加目录权限

sudo vi authz
  • 1
[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
[/]
lidata=rw
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

启动服务,并且监听81端口

sudo svnserve -d -r /home/svn --listen-port 81
  • 1

查看svn是否启动

ps -ef | grep svnserve
  • 1

停止服务

kill all svnserve
  • 1
………………………………

原文地址:访问原文地址
快照地址: 访问文章快照
总结与预览地址:访问总结与预览