【安装+配置】Mac服务端svn

二、服务端

一搜索mac svn全是这种!!!过分

Mac系统已经自带了svn,我们已经不需要安装svn服务器了,简单的几步配置就可以开启我们的svn服务器了。

1、打开terminal,可以使用如下命令确定我们的Mac OS系统确实已经安装了svnserve。

以上是几百年前(bushi)的mac的自带

现在。。

重新安装吧

参考:

宝藏教程!!!

https://blog.csdn.net/u011516972/article/details/106520583/

1、下载

image-20211119224309630

Your CLT does not support macOS 11.2.
It is either outdated or was modified.
Please update your CLT or delete it if no updates are available.

Your CLT does not support macOS 11.2. It is either outdated or was modified.

!终于将Command Line Tools for Xcode安装完成

【安装+配置】Mac服务端svn_第1张图片

现在终于可以开始安装svn了

现在时间1120

【安装+配置】Mac服务端svn_第2张图片

da大感动事件!!

【安装+配置】Mac服务端svn_第3张图片

终于出现了新的东西

subversion终于看到在下载他了!

1130

十分钟 不敢想

看看下载了多少依赖

==> Downloading https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/5bdbf3b3fdadaf72744884b98b74a2ff887bd63a20b246f811a222a146ad7b64--pkg-config-0.29.2.tar.gz
==> Downloading https://ftp.gnu.org/gnu/gdbm/gdbm-1.18.1.tar.gz
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/c6e5196e3cea2a139cb849d508032f117c6351da5fe84323dc13ad2a0600264a--gdbm-1.18.1.tar.gz
==> Downloading https://www.openssl.org/source/openssl-1.1.1h.tar.gz
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/074582038ae735e83b4ab0ea44ac5b654fa5502b7aadbcb01237403ac0878ceb--openssl-1.1.1h.tar.gz
==> Downloading https://ftp.gnu.org/gnu/readline/readline-8.0-patches/readline80
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/47beb8acfca2f2c1f4c481f864e786627a8ba6e0dbdd0fc87a9d2bee461681c7--readline80-001
==> Downloading https://ftp.gnu.org/gnu/readline/readline-8.0-patches/readline80
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/c00dd25d193a8318f8c1387f51f4e497634b1392278fc65dbf14bb388199baef--readline80-002
==> Downloading https://ftp.gnu.org/gnu/readline/readline-8.0-patches/readline80
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/1c985b03f188d6b79dae2b15fbe1aa25b76a01503c2d9ccaf78900e9fdd395d9--readline80-003
==> Downloading https://ftp.gnu.org/gnu/readline/readline-8.0-patches/readline80
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/d362e6fd90dbb0314fa033ad3424721460f0b8b067309f035368b13d4a123399--readline80-004
==> Downloading https://ftp.gnu.org/gnu/readline/readline-8.0.tar.gz
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/2dd06cc6b778b6977a66d7986a2c0e71e557ff460a093af91f0f77a60d4e6d14--readline-8.0.tar.gz
==> Downloading https://www.sqlite.org/2020/sqlite-autoconf-3330000.tar.gz
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/5e52b8b0330f34548b7eecfdac41259cbbf426fc52aba671aed35c19feebc11d--sqlite-autoconf-3330000.tar.gz
==> Downloading https://downloads.sourceforge.net/project/lzmautils/xz-5.2.5.tar
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/a13e2dce533a3dcb05b2f1b86fc45eac1f6ebf737b54ef7d3089994649d28aa8--xz-5.2.5.tar.gz
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/33a9d
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/573dcefa80443b028c1a54ab98b23a130bbef9e8a696e6682d2ff29dbcfdcb18--arm64-3.9.patch
==> Downloading https://files.pythonhosted.org/packages/a7/e0/30642b9c2df516506d
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/6c4cd84935cccfee61e433509bdda7951ea6b77ae5db203b1e708eea72d93603--setuptools-50.3.2.zip
==> Downloading https://files.pythonhosted.org/packages/0b/f5/be8e741434a4bf4ce5
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/8420c2f6f4c2831dfbd1b0e1caa05c0c044729c31b52f8884a785a56038ad0e7--pip-20.2.4.tar.gz
==> Downloading https://files.pythonhosted.org/packages/83/72/611c121b6bd15479cb
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/1aa1a9563d6af09f2712c180679dfd512aac6c710fc3fb573175e88eaa7c6de3--wheel-0.35.1.tar.gz
==> Downloading https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/d37370983bfa2dfe731256050c2097e61210550756783e4623a6eb9a8812b210--Python-3.9.0.tar.xz
==> Downloading https://files.pythonhosted.org/packages/06/8c/eb8a0ae49eba5be054
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/b4e86049c816dde47c7a914a6db0f94a5688cb385de88d3bb08edd041e561aa6--virtualenv-20.1.0.tar.gz
==> Downloading https://files.pythonhosted.org/packages/d7/d8/05696357e0311f5b5c
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/d46628d315f103ea527907020cf5f6c94365bbb549783f75a794526482afb672--appdirs-1.4.4.tar.gz
==> Downloading https://files.pythonhosted.org/packages/2f/83/1eba07997b8ba58d92
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/b25916e85753e80fccf86f2f1ba088b86d1a82c93cd36bdb72613c81cb830c55--distlib-0.3.1.zip
==> Downloading https://files.pythonhosted.org/packages/14/ec/6ee2168387ce015463
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/6132211d03cc3113b135a5b72510e3b6ea1df5bf527eb89d71c3f45085c252a7--filelock-3.0.12.tar.gz
==> Downloading https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f4
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/e99698a932bde9f5fb8ca552923ae339984f284e1c7764df95c12175f573c0d7--six-1.15.0.tar.gz
==> Downloading https://files.pythonhosted.org/packages/ae/a4/2eb8d05b0ac9e168e8
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/548ea9bb28f574e57c3b3c43c37fe5737235f2e9ff662a362713261fc7e67add--SCons-4.0.1.tar.gz
==> Downloading https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.bz2
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/26d6d64b1dd138a02838ae49167401caeec92d83115d0822fbee5fbe50139599--pcre-8.44.tar.bz2
==> Downloading https://downloads.sourceforge.net/project/swig/swig/swig-4.0.2/s
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/89a36233d09f4573b4852efcc11df24c023ab61977b369cd2a59a964df95e132--swig-4.0.2.tar.gz
==> Downloading https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/ff08930ce8165de0173c4a8704a407636908779978246b3116202642460aca15--autoconf-2.69.tar.gz
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/7e224
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/3021c1f03876b2598be79d79d0441ba47897b8630aaa0a178b39954049954715--r1871981-macos11.patch
==> Downloading https://www.apache.org/dyn/closer.lua?path=apr/apr-1.7.0.tar.bz2
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/7b3e7c99ad0ba155cf2a60bfeeef56370fd87270338a0ebd2037179525a857f5--apr-1.7.0.tar.bz2
==> Downloading https://www.apache.org/dyn/closer.lua?path=apr/apr-util-1.6.1.ta
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/4bb8e327136518d3e4e4fc8a1d18676f1ef6e9d79f30a7ea9ec9da3e93175907--apr-util-1.6.1.tar.bz2
==> Downloading https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.xz
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/fbd8967fd8256b2e1856b74e8ff0f3d8371cb652c5768e47649613a69d4dc841--gettext-0.21.tar.xz
==> Downloading https://github.com/lz4/lz4/archive/v1.9.2.tar.gz
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/b710308bcaa3667085fea6d812de16b56b5d96e0c5e4be0154d0434f5f465c93--lz4-1.9.2.tar.gz
==> Downloading https://github.com/JuliaStrings/utf8proc/archive/v2.5.0.tar.gz
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/bf5771d72dd85249a3d851637471b1f1c4e9205eefaf0ecad31a79ef3964d5b1--v2.5.0.tar.gz
==> Downloading https://github.com/encukou/py3c/archive/v1.1.tar.gz
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/341faafd274c164961d080ffbaab85a010d9385563dc574212244e60297de7b8--v1.1.tar.gz
==> Downloading https://www.apache.org/dyn/closer.lua?path=serf/serf-1.3.9.tar.b
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/cfe7b56061b1bb57199b8b7a8782c47f1e318dbf2f6e108ce67c20f926be1df9--serf-1.3.9.tar.bz2
==> Downloading https://www.apache.org/dyn/closer.lua?path=subversion/subversion
Already downloaded: /Users/liuxinny/Library/Caches/Homebrew/downloads/98919580e649683a6ab6b81605c07393193a824df346bbb13e800952fef9f260--subversion-1.14.0.tar.bz2

家人们

我终于安装好了!

【安装+配置】Mac服务端svn_第4张图片

参考文章:进行下载svn

**2、**配置

这里可以康康【4、注意】 —哪里有简洁配置法

1)、创建 svn 目录

mkdir /Users/用户名/svn

将之前创建的文件夹设置为 SVN 的代码库,创建 svn repository
svnadmin create /Users/用户名/svn/repository

【安装+配置】Mac服务端svn_第5张图片

【安装+配置】Mac服务端svn_第6张图片

2)配置 svn 的用户权限

主要是修改 /svn/mycode/conf 目录下的三个文件
打开 svnserve.conf,将下列配置这四项前面的#和空格都去掉 (空格一定要去掉,否则失败)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-NUkLRkja-1639574316732)(/Users/liuxinny/Library/Application%2520Support/typora-user-images/image-20211120125237060.png)]

【安装+配置】Mac服务端svn_第7张图片

修改上面箭头的,去掉#
其中 anon-access = read 代表匿名访问的时候是只读的,
若改为 anon-access = none 代表禁止匿名访问,需要帐号密码才能访问
如果修改记得修改anon-access第一个箭头啊。

3)配置 passwd 文件、写入用户及密码

【安装+配置】Mac服务端svn_第8张图片

【安装+配置】Mac服务端svn_第9张图片

创建了两个用户,
用户 user1 密码是 1111,
用户 user2 密码是 2222

【安装+配置】Mac服务端svn_第10张图片

4) 配置 authz 文件

【安装+配置】Mac服务端svn_第11张图片

打开 authz,将在 passwd 里添加的用户分配到不同的用户组,方便管理权限。

【安装+配置】Mac服务端svn_第12张图片

### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
###  - a single user,
###  - a group of users defined in a special [groups] section,
###  - an alias defined in a special [aliases] section,
###  - all authenticated users, using the '$authenticated' token,
###  - only anonymous users, using the '$anonymous' token,
###  - anyone, using the '*' wildcard.
###
### A match can be inverted by prefixing the rule with '~'. Rules can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[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

修改后

【安装+配置】Mac服务端svn_第13张图片

[groups]

user = user1,user2

在 [groups] 下添加 uesr = user1,user2 标示创建了两个用户
等号左边是组名,右边是用户名

分组权限配置
使用 [/] 代表 svn 服务器中的所有资源库
[/]

@super = rw

@user = rw 这两句标示给 users 用户组相应的权限

表示授权的目录路径,这里是根目录,如果根目录底下有一个目录叫做 svnCode, 那么我们如果要编辑此目录的权限那么就要写成 [svnCode:/]

@uesr 表示给用户组授权,如果要给某一个用户授权则不用写前面的 @
r 表示可读,w 表示可写。

@user = rw
表示对 lib 文件夹 user 组有读写权限

5)启动 SVN 服务器

svnserve -d -r /Users/用户名/svn
样式运行如下图

【安装+配置】Mac服务端svn_第14张图片

我们也可以在活动监视器里进行检验查看查看查看成不成功、下图这个就是运行起来的样子、看起来还行。加油小伙计距离成功不远了。(参考了几篇我猜也差不多的了、反正也是自己折腾)

【安装+配置】Mac服务端svn_第15张图片

先这样了、搭建 svn 服务器环境了。
引用一下其他的先、有空再优化整理上。

3、一些命令

  • 启动 SVN: sudo svnserve -d -r /home/data/svn/

其中 -d 表示守护进程, -r 表示在后台执行
/home/data/svn/ 为 svn 的安装目录

  • 关闭 SVN

这里采取 linux 杀死进程的方式处理的

ps -ef|grep svnserve

ps aux | grep svn  
sudo kill -9 44923 

image-20211215193258065

4、简洁新建仓库+配置

1)新建 svnadmin create

新建仓库需要使用命令行来

先cd到根仓库:我的是在“svnRepository”

【安装+配置】Mac服务端svn_第16张图片

之后输入命令:

“svnadmin create svn_test_second”

进行create 其中svn_test_second是仓库名字

svnadmin create

【安装+配置】Mac服务端svn_第17张图片

然后生成下面的文件

【安装+配置】Mac服务端svn_第18张图片

2)配置svnserve.conf

【安装+配置】Mac服务端svn_第19张图片

先打开

【安装+配置】Mac服务端svn_第20张图片

注意不能留空格!!【不然 就呵呵去叭】

【安装+配置】Mac服务端svn_第21张图片

3)配置passwd

之后配置passwd文件 主要是创建一个新的用户

【安装+配置】Mac服务端svn_第22张图片

4)配置authz

【安装+配置】Mac服务端svn_第23张图片

5)启动服务器

之后就可以启动服务器了

开启:

“(base) liuxinny@Xinny-MBP svnRepository % svnserve -d -r svn_test_second ”

svnserve -d -r 

完整命令行: 【删除掉中间失败的过程】

(base) liuxinny@Xinny-MBP svnRepository % svnadmin create svn_test_second
(base) liuxinny@Xinny-MBP svnRepository % ls
boot-03		repository	svn_test_second	tip.md
(base) liuxinny@Xinny-MBP svnRepository % svnserve -d -r svn_test_second
(base) liuxinny@Xinny-MBP svnRepository % ps -ef|grep svnserve          
  501 68432     1   0  8:14下午 ??         0:00.00 svnserve -d -r svn_test_second
  501 68467 29262   0  8:14下午 ttys001    0:00.00 grep svnserve
(base) liuxinny@Xinny-MBP svnRepository % 

注意如果其中根仓库下有同时运行的仓库 就会导致失败

【安装+配置】Mac服务端svn_第24张图片

遇到的失败:

失败的命令行处理:

(base) liuxinny@Xinny-MBP svnRepository % svnserve -d -r svn_test_second 
svnserve: E000048: 不能绑定服务器套接字: Address already in use
(base) liuxinny@Xinny-MBP svnRepository % ps -ef|grep svnserve           
  501 50845     1   0  7:37下午 ??         0:00.01 svnserve -d -r /Users/liuxinny/svnRepository
  501 67741 29262   0  8:12下午 ttys001    0:00.00 grep svnserve
(base) liuxinny@Xinny-MBP svnRepository % kill -9 50845
(base) liuxinny@Xinny-MBP svnRepository % ps -ef|grep svnserve
  501 68315 29262   0  8:14下午 ttys001    0:00.00 grep svnserve

这之后就可以重新开启了

这里是完整的【失败+处理+成功】

(base) liuxinny@Xinny-MBP svnRepository % svnadmin create svn_test_second
(base) liuxinny@Xinny-MBP svnRepository % ls
boot-03		repository	svn_test_second	tip.md
(base) liuxinny@Xinny-MBP svnRepository % svnserve -d -r svn_test_second 
svnserve: E000048: 不能绑定服务器套接字: Address already in use
(base) liuxinny@Xinny-MBP svnRepository % ps -ef|grep svnserve           
  501 50845     1   0  7:37下午 ??         0:00.01 svnserve -d -r /Users/liuxinny/svnRepository
  501 67741 29262   0  8:12下午 ttys001    0:00.00 grep svnserve
(base) liuxinny@Xinny-MBP svnRepository % kill -9 50845
(base) liuxinny@Xinny-MBP svnRepository % ps -ef|grep svnserve
  501 68315 29262   0  8:14下午 ttys001    0:00.00 grep svnserve
(base) liuxinny@Xinny-MBP svnRepository % svnserve -d -r svn_test_second
(base) liuxinny@Xinny-MBP svnRepository % ps -ef|grep svnserve          
  501 68432     1   0  8:14下午 ??         0:00.00 svnserve -d -r svn_test_second
  501 68467 29262   0  8:14下午 ttys001    0:00.00 grep svnserve
(base) liuxinny@Xinny-MBP svnRepository % 

链接客户端
【安装+配置】Mac — Cornerstone(又有问题惹呜呜呜):
https://blog.csdn.net/CeciliaXinn/article/details/121962003

你可能感兴趣的:(安装+环境配置,svn,macos,服务器)