linux 搭建 svn 及采坑记录

220 阅读5分钟

目录

1 使用yum 安装SVN包

2.验证安装版本

3 创建SVN 版本库

3.1.创建svn文件夹

3.2.创建名为davesvn为版本库

4 SVN 配置

4.1配置svnserve.conf 

4.2配置 passwd

4.3配置 authz

5.启动svn

6.查看svn进程

7.杀掉进程

偶尔遇到问题

访问版本库 提示 项目不可读svn:遇到不可读路径;拒绝访问

使用:

关闭防火墙 centos1.7 

查看防火墙状态。

临时关闭防火墙命令。重启电脑后,防火墙自动起来。

永久关闭防火墙命令。重启后,防火墙不会自动启动。

打开防火墙命令。




 


 

1 使用yum 安装SVN包

 
[root@VM_16_3_centos ~]# yum install -y subversion

 

2.验证安装版本

 
[root@VM_16_3_centos ~]# svnserve --version

 

3 创建SVN 版本库

3.1.创建svn文件夹


 [root@VM_16_3_centos ~]# mkdir /home/svn

 

3.2.创建名为davesvn为版本库


 [root@VM_16_3_centos ~]# svnadmin create /home/svn/davesvn  
  • 重点是 davesvn  之后的 客户端 访问用的就是 svn:// ip : 端口/davesvn

 

4 SVN 配置

创建版本库后,在这个目录下会生成3个配置文件:


[root@VM_16_3_centos ~]# cd /home/svn/davesvn/conf/
[root@VM_16_3_centos conf]# pwd
/home/svn/davesvn/conf
[root@VM_16_3_centos conf]# ls
authz  passwd  svnserve.conf
[root@VM_16_3_centos conf]# 
  1. svnserve.conf:  svn服务配置文件下。
  2. passwd: 用户名口令文件。
  3. authz: 权限配置文件。

 

4.1配置svnserve.conf 

在[general]下加入如下内容


[general]
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz

这里有些重点 内容 上边文件 有时候 攒出来会在 read  write passwd  authz  后边多加一个空格 导致部署的时候出现问题 ,粘贴的时候最好看下如果客户端访问发现有问题可已关注下这里,已经更新成没有空格的了,但还是要注意另外俩个文件写入内容的时候也要看下 哦了

4.2配置 passwd

在整个文件的最下边创建用户明密码


test1 = 123456

test2 = 333333
  • 配置用户信息

 

4.3配置 authz

在[groups] 下填写如下内容


[groups]

admin = test1

dev=test2

[davesvn:/]

@admin = rw

@dev = rw
  • 配置用户权限

 

5.启动svn


[root@VM_16_3_centos ~]# svnserve -d -r /home/svn

5.1有的时候会报错如:


svnserve: E000098: Can't bind server socket: Address already in use

 

5.2可以通过制定端口的方式解决如下


[root@VM_16_3_centos ~]# svnserve -d -r /home/svn --listen-port 3691

 

6.查看svn进程


[root@VM_16_3_centos ~]# ps -aux |grep svn
root     14398  0.0  0.0 166320   912 ?        Ss   16:15   0:00 svnserve -d -r /home/svn --listen-port 3691
root     16855  0.0  0.0 112648   960 pts/0    S+   16:45   0:00 grep --color=auto svn

 

7.杀掉进程


[root@VM_16_3_centos ~]#  kill -9 14398(进程号)

 

接下来就可以使用windows的客户svn端访问使用了

windows客户端svn下载地址:tortoisesvn.net/downloads.h…

 

 

偶尔遇到问题

访问版本库 提示 项目不可读svn:遇到不可读路径;拒绝访问

  •     Item is not readable svn: Unreadable path encountered; access denied
  • 把 conf/svnserve.conf 中内容修改  anon-access = none   如下

[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz

 

使用:

  • 使用浏览器打开:svn://111.111.111.111:3690/davesvn/
  • 使用浏览器打开:svn://111.111.111.111:3691/davesvn/
  • 或使用 下载下来的svn直接输入这个地址就ok

 

关闭防火墙 centos1.7 

 

查看防火墙状态。

systemctl status firewalld

 

临时关闭防火墙命令。重启电脑后,防火墙自动起来。

systemctl stop firewalld

 

永久关闭防火墙命令。重启后,防火墙不会自动启动。

systemctl disable firewalld

 

打开防火墙命令。

systemctl enable firewalld

 

持续更新

 

 

 

 

 

ok