微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

部署svn

部署svn

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# setenforce 0 
[root@localhost ~]# vi /etc/selinux/config 
SELINUX=disabled
  • 安装svnserve
[root@localhost ~]# yum -y install subversion
  • 创建版本库目录
[root@localhost ~]# mkdir -p /opt/svn/svnrepos
//此仅为目录,为后面创建版本库提供存放位置
  • 创建svn版本库
[root@localhost ~]# svnadmin create /opt/svn/svnrepos/test
//这里的test为版本库名称,可自定义,我这里是test

[root@localhost ~]# cd /opt/svn/svnrepos/test/
[root@localhost test]# ls 
conf  db  format  hooks  locks  README.txt
[root@localhost test]# ll
total 8
drwxr-xr-x. 2 root root  76 Oct 12 09:22 conf
drwxr-sr-x. 6 root root 233 Oct 12 09:22 db
-r--r--r--. 1 root root   2 Oct 12 09:22 format
drwxr-xr-x. 2 root root 231 Oct 12 09:22 hooks
drwxr-xr-x. 2 root root  41 Oct 12 09:22 locks
-rw-r--r--. 1 root root 246 Oct 12 09:22 README.txt
[root@localhost test]# cd conf/
[root@localhost conf]# ll
total 20
-rw-r--r--. 1 root root 1080 Oct 12 09:22 authz
-rw-r--r--. 1 root root  885 Oct 12 09:22 hooks-env.tmpl
-rw-r--r--. 1 root root  309 Oct 12 09:22 passwd
-rw-r--r--. 1 root root 4375 Oct 12 09:22 svnserve.conf

// authz:负责账号权限的管理,控制账号是否读写权限
// passwd:负责账号和密码的用户名单管理
// svnserve.conf:svn服务器配置文件
[root@localhost conf]# vi authz
//在文章末尾添加
[/]
账号 = rw

//我这里添加的账号为admin
[/]
watest = rw
[root@localhost conf]# vi passwd 
//在末尾添加账号和密码,格式如下
账号 = 密码

//我这里添加的账号watest
watest = 123456
[root@localhost conf]# vi svnserve.conf 
//把以下四行前的注释去掉并且顶行,保存即可
anon-access = read
auth-access = write
password-db = passwd
realm = My First Repository
  • 启动服务
[root@localhost ~]# svnserve -d -r /opt/svn/svnrepos
[root@localhost ~]# ss -antl 
State      Recv-Q     Send-Q           Local Address:Port           Peer Address:Port     Process     
LISTEN     0          128                    0.0.0.0:3690                0.0.0.0:*                    
LISTEN     0          128                    0.0.0.0:22                  0.0.0.0:*                    
LISTEN     0          128                       [::]:22                     [::]:* 
  • 访问

    在这里插入图片描述

原文地址:https://blog.csdn.net/Op_Wa/article/details/120716620

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐