自己非常愚蠢的搭了个svn-ubuntu17.04 搭建SVN

由于以前一直都在用git ,也有自己的git 仓库,但是到了新公司之后,用的确实svn ,一下子就有些不习惯,所以决定,自己搭一个,好好研究一下
环境 ubuntu 17.04

开始自己的命令

注:apt-get不知道在ubuntu哪个版本更新为apt,少4个词,就能省好长时间,真心不错
1.安装subversion
sudo apt install subversion
2.随便在哪个目录下创建个文件,作为svn的仓库专属文件夹
sudo mkdir /home/svn
3.创建一个文件夹,作为其中一个仓库
sudo mkdir /home/svn/repository
4.1将仓库初始化
sudo svnadmin create /home/svn/repository/
4.2记的给权限哟
sudo chmod -R 777 /home//svn/repository/
5.1编辑配置文件,修改权限,
cd /home/svn/repository/conf
sudo vim svnserve.conf

### 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 = read
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

分别将anon-access (设置任何一个人访问为可读)、auth-access(用户认证之后可写)、password-db(密码认证) 取消注释
注:一定要定格将每一行,要不然会报错的
5.2编辑用户配置文件
sudo vim passwd

### 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

joshua = joshuasecret

添加一个用户名为joshua 密码微joshuasecret 配置项
5.3修改组权限配置文件
sudo vim authz

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
own = joshua
# [/foo/bar]
# harry = rw
# &joe = r
# * =

[repository:/baz/fuz]

@harry_and_sally = rw

* = r

@own = rw

  • = r

own 组 里面具有joshua用户,也就是刚才创建,并给own组相应的权限

6.启动svnserve
svnserve -d -r /home/svn

7.这个仓库的地址就是svn://ip/repository,可以使用任何一个svn客户端进行checkout 了eg.windows 中的小乌龟,ubuntu 中的rabbit ,还有mac 中的Cornerstone

注:

  • svn 的默认端口为3690 ,当你需要另一个仓库时,需要将仓库指向另一个端口eg. svnserve -d -r /home/svn --listen-port yourport

  • 注意你的防火墙,sudo ufw allow 3690

  • 配置文件一定要顶格

then ,就可以愉快的搞事情了,

说实话,自己还是比较喜欢git

相关文章

首先介绍下什么是git和svnGIT(分布式版本控制系统)Git(读音...
注意点:系统环境:centos7,python,django,svn,jenkins首先安装...
  我使用过的版本控制工具有两种:早期的时候使用的是SVN,...
用好Git和SVN,轻松驾驭版本管理本文从Git与SVN的对比入手,...
01.jenkins安装jenkins网站:https://jenkins.io/安装:资料...
软件环境:centos7jdk1.8svn1.9maven3.5tomcat8jenkins2.80 ...