部署svn

部署svn

  • 关闭防火墙和selinux
[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服务器配置文件
  • 修改配置文件----authz
[root@localhost conf]# vi authz
//在文章末尾添加
[/]
账号 = rw

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

//我这里添加的账号watest
watest = 123456
  • 修改配置文件----svnserve.conf
[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                     [::]:* 
  • 访问
    在这里插入图片描述
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在Linux部署svn,你需要执行以下步骤: 1. 安装svn服务器 你需要安装svn服务器软件,比如Apache Subversion或者CollabNet Subversion等。可以使用以下命令安装: ``` sudo apt-get update sudo apt-get install subversion ``` 2. 创建svn仓库 使用以下命令创建一个svn仓库: ``` sudo svnadmin create /path/to/repository ``` 3. 配置svn仓库 编辑svn仓库的配置文件,添加以下内容: ``` [general] anon-access = none auth-access = write password-db = passwd authz-db = authz ``` 其中,anon-access指定匿名用户的访问权限,auth-access指定认证用户的访问权限,password-db指定用户密码文件,authz-db指定用户访问控制文件。 4. 创建用户密码文件和访问控制文件 使用以下命令创建密码文件和访问控制文件: ``` sudo htpasswd -c /path/to/repository/conf/passwd username sudo touch /path/to/repository/conf/authz ``` 其中,htpasswd命令用于创建密码文件,-c选项表示创建新文件,username指定用户名;touch命令用于创建访问控制文件。 5. 编辑访问控制文件 编辑访问控制文件,添加以下内容: ``` [groups] admin = username [/] @admin = rw * = [repo:/] @admin = rw * = ``` 其中,[groups]指定用户组,admin指定管理员用户组,[/]表示根目录,[repo:/]表示repo目录,@admin表示管理员组,rw表示读写权限,*表示其他用户无权限访问。 6. 启动svn服务器 使用以下命令启动svn服务器: ``` sudo svnserve -d -r /path/to/repository ``` 其中,-d选项表示以守护进程方式启动,-r选项指定svn仓库路径。 7. 客户端连接svn服务器 使用svn客户端软件连接svn服务器,比如TortoiseSVN等。 以上就是在Linux部署svn的步骤。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值