CentOS7 部署SVN服务器

服务器端:svnserver 安装主要步骤

yum install subversion

rpm -ql subversion

mkdir /application/svndata

mkdir /application/svnpasswd

svnadmin create /application/svndata/doc

cp authz passwd /application/svnpasswd/

chmod 700 /application/svnpasswd/*

vim /etc/sysconfig/svnserve

systemctl start svnserve.service

systemctl status svnserve.service

ps -aux|grep svn

 

 检查安装

rpm -ql subversion

[root@ftp:/root]
> rpm -ql subversion
/etc/subversion
/etc/sysconfig/svnserve
/run/svnserve
/usr/bin/svn
/usr/bin/svnadmin
/usr/bin/svndumpfilter
/usr/bin/svnlook
/usr/bin/svnrdump
/usr/bin/svnserve
/usr/bin/svnsync
/usr/bin/svnversion
/usr/lib/systemd/system/svnserve.service
..................

  

创建svn数据目录和密码文件目录

mkdir /application/svndata

mkdir /application/svnpasswd

 

初始化仓库

svnadmin create /application/svndata/doc

  

拷贝并授权自定义账户和密码文件到自定义目录

cp authz passwd /application/svnpasswd/

chmod 700 /application/svnpasswd/*


设置自定账户和组、并目录配置权限

> cat /application/svnpasswd/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
liwm = 123456

 
  

> cat /application/svnpasswd/authz
### 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

 
  

doc = liwm
[doc:/]
@doc = rw

 

修改 svnserver 默认仓库目录

vim /etc/sysconfig/svnserve

/etc/sysconfig/svnserve 
# OPTIONS is used to pass command-line arguments to svnserve.
# 
# Specify the repository location in -r parameter:
OPTIONS="-r /application/svndata"

 

启动服务并检查进程

systemctl start svnserve.service

systemctl status svnserve.service

ps -aux|grep svn

 > systemctl status svnserve.service● svnserve.service - Subversion protocol daemo   Loaded: loaded (/usr/lib/systemd/system/svnserve.service; disabled; vendor preset: disabled)

   Active: active (running) since Sun 2019-02-24 20:07:27 CST; 1h 22min ago
  Process: 78018 ExecStart=/usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid $OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 78019 (svnserve)
    Tasks: 1
   Memory: 476.0K
   CGroup: /system.slice/svnserve.service
           └─78019 /usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid -r /application/svndata

Feb 24 20:07:27 ftp systemd[1]: Starting Subversion protocol daemon...
Feb 24 20:07:27 ftp systemd[1]: Started Subversion protocol daemon.


> ps -aux|grep svn
root      78019  0.0  0.0 162240   904 ?        Ss   20:07   0:00 /usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid -r /application/svndata
root      82590  0.0  0.0 112704   976 pts/0    S+   21:29   0:00 grep --color=auto svn
设置开机启动:

systemctl enable  svnserve.service

> systemctl enable svnserve.service
Created symlink from /etc/systemd/system/multi-user.target.wants/svnserve.service to /usr/lib/systemd/system/svnserve.service.

查看服务开机启动:
> systemctl is-enabled svnserve.service
enabled                                    

转载于:https://www.cnblogs.com/liweiming/p/10427940.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值