博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Centos/ubuntu配置SVN服务
阅读量:6149 次
发布时间:2019-06-21

本文共 4858 字,大约阅读时间需要 16 分钟。

Centos安装svn

yum -y install subversion

ubuntu安装svn

apt-get install subversion

Centos配置svn

root@hello:~# mkdir -p /svn/svn1root@hello:~# svnadmin create /svn/svn1/root@hello:~# cd /svn/svn1/conf/root@hello:/svn/svn1/conf# lsauthz passwd svnserve.confroot@hello:/svn/svn1/conf# vim passwd     编辑passwd,在【users】下添加用户名和密码### 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 = sallyssecretTest = 123456root@hello:/svn/svn1/conf# vim authz     [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_and_sally,组内有harry和sally用户# harry_sally_and_joe = harry,sally,&joe# [/foo/bar]                表示/foo/bar下的所有资源# harry = rw                harry 拥有读写权限# &joe = r# * =                       设置其他用户具有的权限# [repository:/baz/fuz]     表示repository下的/baz/fuz下的所有资源# @harry_and_sally = rw     设置harry_and_sally用户组为读写权限# * = r              [svn1:/]                    表示svn1下的所有资源Test = rw                   用户Test 权限为读写root@hello:/svn/svn1/conf# vim svnserve.conf[general]### These options control access to the repository for unauthenticated### and authenticated users. Valid values are "write", "read",### and "none". The sample settings below are the defaults.anon-access = none        #匿名访问的权限,可以是read,write,none,默认为readauth-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### starting with a /, the file's location is relative to the the### directory containing this file. If you don't specify an### authz-db, no path-based access control is done.### Uncomment the line below to use the default authorization file.authz-db = authz          #访问控制文件### This option specifies the authentication realm of the repository.### If two repositories have the same authentication realm, they should### have the same password database, and vice versa. The default realm### is repository's uuid.realm = SVN1              #认证空间名,SVN会在认证提示里显示,并且作为凭证缓存的关键字[sasl]### This option specifies whether you want to use the Cyrus SASL### library for authentication. Default is false.### This section will be ignored if svnserve is not built with Cyrus### SASL support; to check, run 'svnserve --version' and look for a line### reading 'Cyrus SASL authentication is available.'# use-sasl = true         开启sasl用户验证### These options specify the desired strength of the security layer### that you want SASL to provide. 0 means no encryption, 1 means### integrity-checking only, values larger than 1 are correlated### to the effective key length for encryption (e.g. 128 means 128-bit### encryption). The values below are the defaults.# min-encryption = 0# max-encryption = 256

ubuntu配置svn

root@hello:/svn/svn1/conf# pwd/svn/svn1/confroot@hello:/svn/svn1/conf# lsauthz hooks-env.tmpl passwd svnserve.confroot@hello:/svn/svn1/conf# vim passwd[users]Test = 123456root@hello:/svn/svn1/conf# vim authz[aliases]# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average[groups][svn1:/]Test = rwroot@hello:/svn/svn1/conf# vim svnserve.conf [general]anon-access = noneauth-access = writepassword-db = passwdauthz-db = authz# groups-db = groups         指定“group file”的位置,而该目录下并没有groups文件,因此该配置不能被启用!realm = svn1# force-username-case = none# hooks-env = hooks-env[sasl]# use-sasl = true# min-encryption = 0# max-encryption = 256

开机自动启动SVN脚本:

#!/bin/bashPatH=`/svn/svn1`SvN=`which svnserve`$SvN -d -r $PatH

添加开机启动

echo "bash /脚本绝对路径/脚本名" >> /etc/rc.d/rc.local

SVN启动控制脚本

根据实际情况进行修改 路径等信息

#!/bin/bash#chkconfig: 345 95 95#description: svnstop(){kill $(ps -ef | grep "svnserve -d -r" | grep -v grep | awk '{print $2}') > /dev/null 2>&1if [ ! $? -eq 0 ]then    echo "stop ERROR..."fi}start(){svnserve -d -r /svn/ > /dev/null 2>&1if [ ! $? -eq 0 ]then    echo "start ERROR..."fi}restart(){stopstart}case $1 instop)    stop;;start)    start;;restart)    restart;;*)    echo "please INPUT stop|start|restart"    exit 110;;esac

添加到系统服务(仅针对centos6.x系统)

将上面脚本命名为svnd

chmod +x ./svndmv ./svnd /etc/init.d/chkconfig svnd --addchkconfig svnd onchkconfig svnd --list

  

 

转载于:https://www.cnblogs.com/LuckWJL/p/9928145.html

你可能感兴趣的文章
Configuration python CGI in XAMPP in win-7
查看>>
bzoj 5006(洛谷 4547) [THUWC2017]Bipartite 随机二分图——期望DP
查看>>
CF 888E Maximum Subsequence——折半搜索
查看>>
欧几里德算法(辗转相除法)
查看>>
面试题1-----SVM和LR的异同
查看>>
MFC控件的SubclassDlgItem
查看>>
如何避免历史回退到登录页面
查看>>
《图解HTTP》1~53Page Web网络基础 HTTP协议 HTTP报文内的HTTP信息
查看>>
unix环境高级编程-高级IO(2)
查看>>
树莓派是如何免疫 Meltdown 和 Spectre 漏洞的
查看>>
雅虎瓦片地图切片问题
查看>>
HTML 邮件链接,超链接发邮件
查看>>
HDU 5524:Subtrees
查看>>
手机端userAgent
查看>>
pip安装Mysql-python报错EnvironmentError: mysql_config not found
查看>>
http协议组成(请求状态码)
查看>>
怎样成为一个高手观后感
查看>>
[转]VC预处理指令与宏定义的妙用
查看>>
JQuery radio单选框应用
查看>>
MySql操作
查看>>