文章目录

服务器配置

检查环境

如果安装

修改配置

启动服务

tortoise测试

文件不显示状态图标

服务器配置

名称配置

centos7.5-1804

svn版本1.7.14

内存8G

磁盘1T

检查环境

检查是否已经安装过svn了


[root@svngit ~]# svnserve --version

svnserve, version 1.7.14 (r1542130)

   compiled Apr 11 2018, 02:40:28


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 back-end (FS) modules are available:


* fs_base : Module for working with a Berkeley DB repository.

* fs_fs : Module for working with a plain file (FSFS) repository.


Cyrus SASL authentication is available.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

看来CentOS7.5已自带了SVN服务了…


上述检查的命令也可以用以下这条指令


[root@svngit ~]# rpm -qa | grep subversion

subversion-libs-1.7.14-14.el7.x86_64

subversion-1.7.14-14.el7.x86_64

1

2

3

如果安装

如果没有安装的话,直接使用以下方式安装


yum -y install subversion

1

安装后再使用svnserve --version查看版本信息


接下来创建版本库目录和版本库


[root@svngit ~]# mkdir -p /var/svn/svnrepos

[root@svngit ~]# cd /var/svn/svnrepos/

[root@svngit svnrepos]# svnadmin create /var/svn/svnrepos/zim

[root@svngit svnrepos]# ll

total 0

drwxr-xr-x. 6 root root 86 Sep  8 17:55 zim

1

2

3

4

5

6

进入zim目录,查看目录结构


[root@svngit zim]# ll

total 8

drwxr-xr-x. 2 root root  54 Sep  8 17:55 conf

drwxr-sr-x. 6 root root 233 Sep  8 17:55 db

-r--r--r--. 1 root root   2 Sep  8 17:55 format

drwxr-xr-x. 2 root root 231 Sep  8 17:55 hooks

drwxr-xr-x. 2 root root  41 Sep  8 17:55 locks

-rw-r--r--. 1 root root 229 Sep  8 17:55 README.txt

1

2

3

4

5

6

7

8

修改配置

进入版本库/conf目录内


# 用户的读写权限等

-rw-r--r--. 1 root root 1080 Sep  8 17:55 authz

# 用户的账号和密码信息

-rw-r--r--. 1 root root  309 Sep  8 17:55 passwd

# SVN服务器相关配置

-rw-r--r--. 1 root root 3090 Sep  8 17:55 svnserve.conf

1

2

3

4

5

6

其中,svnserver.conf配置


[general]

### The anon-access and auth-access options control access to the

### repository for unauthenticated (a.k.a. anonymous) users and

### authenticated users, respectively.

### Valid values are "write", "read", and "none".

### Setting the value to "none" prohibits both reading and writing;

### "read" allows read-only access, and "write" allows complete 

### read/write access to the repository.

### The sample settings below are the defaults and specify that anonymous

### users have read-only access to the repository, while authenticated

### 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 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 = /var/svn/svnrepos

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

passwd文件中增加用户密码信息


[users]

# harry = harryssecret

# sally = sallyssecret

zhangsan = zhangsan

lisi = lisi

wangwu = wangwu

1

2

3

4

5

6

在authz文件中配置上述用户的分组情况和操作权限


[groups]

# harry_and_sally = harry,sally

# harry_sally_and_joe = harry,sally,&joe

group1 = zhangsan,lisi

group2 = wangwu

# [/foo/bar]

# harry = rw

# &joe = r

# * =


# [repository:/baz/fuz]

# @harry_and_sally = rw

# * = r

# 根目录

[/]

@group1 = rw

@group2 = r

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

启动服务

[root@svngit conf]# svnserve -d -r /var/svn/svnrepos

[root@svngit conf]# ps -aux | grep svn

root     26099  0.0  0.0 180716   804 ?        Ss   13:46   0:00 svnserve -d -r /var/svn/svnrepos

1

2

3

开启防火墙

SVN端口默认为3690,若Linux开启了防火墙,需开启默认端口

开启端口:firewall-cmd --zone=public --add-port=3690/tcp --permanent

重启防火墙:firewall-cmd --reload


[root@svngit conf]# netstat -antp | grep 3690

tcp        0      0 0.0.0.0:3690            0.0.0.0:*               LISTEN      26099/svnserve      

[root@svngit conf]# firewall-cmd --zone=public --add-port=3690/tcp --permanent

success

[root@svngit conf]# firewall-cmd --reload

success

1

2

3

4

5

6

tortoise测试

win64位下载地址:

https://osdn.net/projects/tortoisesvn/storage/1.14.0/Application/TortoiseSVN-1.14.0.28885-x64-svn-1.14.0.msi/




在Checkout的目录内创建测试文件和文件夹




还没有配置用户名和密码


之后再次提交可提交成功,使用wangwu的用户,则失败,因为wangwu配置时没有配置写权限。



文件不显示状态图标

如下,也不知道各个文件的状态是什么


解决办法:

找到下载的安装包,双击运行,到如下步骤时,点击中间的repair,修复一下,修复完小图标就显示出来了。



————————————————

版权声明:本文为CSDN博主「再看我把你吃掉」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/zz_aiytag/article/details/108462450


标签: none

添加新评论