#!/usr/bin/env bash
#安装软件 HTTP 和 SVN软件
yum install -y httpd subversion mod_dav_svn
#创建库文件夹并更改文件夹权限
mkdir /home/svn
chown -R apache:apache /home/svn
svnadmin create /home/svn
chmod -R g+rws /home/svn
#修改SVN配置文件
cat > /etc/httpd/conf.modules.d/-subversion.conf << EOF
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
LoadModule dontdothat_module modules/mod_dontdothat.so
<Location /svn>
DAV svn
SVNPath /home/svn
AuthType Basic
AuthName "SVN repository"
AuthUserFile /etc/subversion/passwd
AuthzSVNAccessFile /home/svn/conf/authz
Require valid-user
</Location>
EOF
#启动HTTP服务
systemctl enable httpd
systemctl start httpd
#创建用户,设置库文件的用户权限
echo "admin = jason" >> /home/svn/conf/authz
echo "[/]" >> /home/svn/conf/authz
echo "@admin = rw" >> /home/svn/conf/authz
echo "*=" >> /home/svn/conf/authz
htpasswd -c /etc/subversion/passwd jason
chown -R apache:apache /home/svn #关闭防火墙和selinux,selinux必须关闭,防火墙不关闭的话打开防火墙的80和3690端口
#运行脚本: sh -x svn.sh

添加账户:  htpasswd -m /etc/subversion/passwd  monday

账户权限:

cd  /home/svn/conf
[root@jason conf]# cat authz |grep -Ev '^%|^$'
### 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
admin = jason,test,monday,aimee
users =luffy
[/]
@admin = rw #读写
@users=r #读
*= #其他用户无权限

[/test]
@users = r

重启httpd服务

客户端

TortoiseSVN-1.9.7.27907-x64-svn-1.9.7

SVN地址:http://192.168.199.224/svn/

http://192.168.199.224/svn/test

centos7 脚本搭建SVN的更多相关文章

  1. CentOS7下搭建SVN服务器

    (1).安装SVN 1)安装SVN [root@youxi1 ~]# yum -y install subversion mod_dav_svn [root@youxi1 ~]# cat /etc/s ...

  2. CentOS7:搭建SVN + Apache 服务器

    1. 安装httpd 安装httpd服务: $ sudo yum install httpd 检查httpd是否安装成功: $ httpd -version Server version: Apach ...

  3. Centos7下搭建SVN服务,本地提交代码自动同步到WEB目录

    1.安装SVN服务[root@bogon ~]# yum -y install subversion 2.查看svnserve安装目录[root@bogon ~]# whereis svnserves ...

  4. Centos7 下搭建SVN + Apache 服务器

    1. 安装httpd 安装httpd服务: $ sudo yum install httpd 检查httpd是否安装成功: $ httpd -version Server version: Apach ...

  5. centos7.5搭建svn

    1.安装svnyum install subversion 2.查看安装位置rpm -ql subversion 3.创建svn版本库目录mkdir -p /var/svn/svnrepos 4.创建 ...

  6. 基于腾讯Centos7云服务器搭建SVN版本控制库

    基于腾讯Centos7云服务器搭建SVN版本控制库 最近在和小伙伴组队参加一个关于人工智能的比赛,无奈不知道怎么处理好每个人的代码托管问题,于是找到了晚上免费svn托管服务器的服务,但是所给的免费空间 ...

  7. centos7 搭建svn服务器&客户端的访问&备份迁移

    当今用于版本控制的软件程序主要的有svn和git,其它软件咱不熟悉,今天记录下搭建svn服务器和svn客户端使用: 使用环境:虚拟机为centos7系统,svn服务器安装在centos7系统平台上,s ...

  8. centos7.3给搭建SVN服务器

    centos7.3给搭建SVN服务器 1 安装svnserver yum install subversion 2 查看版本 svnserve --version 3 创建版本库 3.1 运行以下命令 ...

  9. linux(centos7)下SVN服务器如何搭建

    linux(centos)下SVN服务器如何搭建?说到SVN服务器,想必大家都知道,可以是在LINUX下如何搭建SVN服务器呢?那么今天给大家分享一下linux(centos)搭建SVN服务器的思路! ...

随机推荐

  1. smbpasswd 和 pdbedit 的区别

    以前我们在windows上共享文件的话,只需右击要共享的文件夹然后选择共享相关的选项设置即可.然而如何实现windows和linux的文件共享呢?这就涉及到了samba服务了,这个软件配置起来也不难, ...

  2. load_basemap

    map = new Map("map", { //basemap: "satellite", //center: [-85.743, 38.256], //zo ...

  3. python3中最新百度首页弹窗的登录方法

    from selenium import webdriverimport timedriver = webdriver.Ie()driver.get("http://www.baidu.co ...

  4. react-native ios打包 、设置图标 启动图片

    在这里只记录xcode 打包操作,申请证书操作,之前已经记录过了. https://www.cnblogs.com/hellovoidworld/p/4127576.html  参考了这篇文章,只是可 ...

  5. Centos下lnmp正确iptables配置规则

    查看iptable运行状态 service iptables status 清除已有规则 iptables -Fiptables -Xiptables -Z 开放端口 #允许本地回环接口(即运行本机访 ...

  6. fb发布打包外部资源

    将资源放在src文件夹下面即可 然后在打包那就会看到资源,勾上即可

  7. AIR文件操作(二):使用文件对象操作文件和目录

    转载于:http://www.flashj.cn/wp/air-file-operation2.html 文件对象是啥?文件对象(File对象)是在文件系统中指向文件或目录的指针.由于安全原因,只在A ...

  8. cordova- cordova-plugin-splashscreen启动页面和图标的设置

    https://www.cnblogs.com/a418120186/p/5856371.html

  9. 飞利浦 PHILIPS 电动牙刷HX6730 拆解

    今日,一直比较喜欢用的电动牙刷,飞利浦HX6730坏掉了,初步感觉考虑飞利浦的保修,但是发现发票找不到了.飞利浦的客服也说,电动牙刷的两年保修依据分别是:1.发票开据日期:2.在无发票的情况下,看底部 ...

  10. java 实现Bridge模式(转)

    原文:http://chjking.blog.163.com/blog/static/6439511120081152534252/ 看了网上一些关于咖啡加奶的例子,觉得真是天下文章一大抄,不管好的坏 ...