http svn svn http

简介:
#!/bin/bash
TMP=true
while ${TMP}
    do
    echo "1: svnserver 1.7"
    echo "2: svnserver 1.8"
    echo "3: svnserver 1.9"
    read -p "Please choose your country: " i
    case "$i" in
      1)
      echo "Install svnserver 1.7,plasea wait...."
      VERSION=1.7
      TMP=false;;
      2)
      echo "Install svnserver 1.8,plasea wait...."
      VERSION=1.8
      TMP=false;;
      3)
      echo "Install svnserver 1.9,plasea wait...."
      VERSION=1.9
      TMP=false;;
      *)
      echo "Please choose version"
      ;;
    esac
done
#add yum
echo "
[WandiscoSVN]
name=Wandisco SVN Repo
baseurl=http://opensource.wandisco.com/centos/6/svn-${VERSION}/RPMS/$basearch/
enabled=1
gpgcheck=0
" > /etc/yum.repos.d/wandisco-svn.repo

#install svn httpd
yum clean all
yum install subversion httpd mod_dav_svn -y

#configure snv and http
mv /etc/httpd/conf.d/subversion.conf /etc/httpd/conf.d/subversion.conf.old
echo "
# WANdisco Subversion Configuration
# For more information on HTTPD configuration options for Subversion please see:
# http://svnbook.red-bean.com/nightly/en/svn.serverconfig.httpd.html
# Please remember that when using webdav HTTPD needs read and write access your repositories.

# Needed to do Subversion Apache server.
LoadModule dav_svn_module     modules/mod_dav_svn.so
# Only needed if you decide to do "per-directory" access control.
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location /svn>
  DAV svn
  SVNParentPath /home/svn/
  AuthType Basic
  AuthName \"SVN Repo\"
  AuthUserFile /etc/httpd/conf.d/passwd
  AuthzSVNAccessFile /etc/httpd/conf.d/authz
  Require valid-user
</Location>
" > /etc/httpd/conf.d/subversion.conf

echo "
### 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
[project:/]
svnuser = rw
* =
# [/foo/bar]
# harry = rw
# &joe = r
# * =

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
" > /etc/httpd/conf.d/authz

mkdir /home/svn && svnadmin create /home/svn/project && chown -R apache:apache /home/svn

#add svn user
htpasswd -bc /etc/httpd/conf.d/passwd svnuser 12344321
/etc/init.d/httpd start
svnserve -d -r /home/svn/

echo "http://ip/svn/project    user:svnuser passwd:12344321
please stop iptables or open 3690 and 80
svn passwd file in /etc/httpd/conf.d/passwd
add svnuser use command \"htpasswd -b /etc/httpd/conf.d/passwd svnusername password\"" > svnserverinstall.log

cat svnserverinstall.log



本文转自 freeterman 51CTO博客,原文链接:http://blog.51cto.com/myunix/1718833,如需转载请自行联系原作者

相关文章
|
Apache 数据安全/隐私保护
如何搭建SVN服务器及HTTP下载工具
# tar xvzf httpd-2.2.3.tar.gz //进入解压后的目录 # cd httpd-2.2.3 //配置apache安装 # .
802 0
|
1月前
|
存储 网络协议 Ubuntu
Linux环境下的SVN服务器搭建并结合内网穿透实现远程连接
Linux环境下的SVN服务器搭建并结合内网穿透实现远程连接
|
3月前
|
Ubuntu 安全 网络安全
百度搜索:蓝易云【Ubuntu系统SVN服务器搭建教程】
现在,你已经成功在Ubuntu系统上搭建了SVN服务器。其他用户可以通过SVN客户端连接到你的SVN服务器,进行代码版本管理和协作开发。注意,为了安全起见,建议配置SSL加密以保护数据传输。
39 1
|
3月前
|
Apache 项目管理 数据安全/隐私保护
【cpolar】TortoiseSVN如何安装并实现公网提交文件到本地SVN服务器
【cpolar】TortoiseSVN如何安装并实现公网提交文件到本地SVN服务器
46 0
|
7月前
|
IDE Linux 开发工具
从旧服务器迁移svn到另一台新服务器中(linux系统)|遇到诸多坑,已解决
从旧服务器迁移svn到另一台新服务器中(linux系统)|遇到诸多坑,已解决
|
1月前
|
网络协议 Ubuntu Linux
如何在Linux环境搭建本地SVN服务器并结合cpolar实现公网访问
如何在Linux环境搭建本地SVN服务器并结合cpolar实现公网访问

相关实验场景

更多