使用http访问Subversion版本控制

环境:
    1、ubuntu
    2、apache2
    3、subersion1.3
描述:
    因为在内网服务器上使用svn,但只有http 80端口映射到了外网,这样就无法使用svn的3690端口访问版本控制了。本身svn有自带apache的插件来通过http访问,不过需要一定的配置。
过程:
    1、安装需要的软件
sudo apt-get install apache2
sudo apt-get install subversion  libapache2-svn 
# 额外添加一个web查看器
sudo apt-get install websvn
    在此深刻体会了linux软件安装的方便,强烈推荐大家除非你使用.net,不然服务器还是使用linux好啊,省心省力。前段时间客户刚收到一封律师信,因为在win2003服务器上使用了破解的ftp软件,而在linux下有更方便的ssh可以使用。
    2、接下来需要做一些配置,首先,subversion的配置,因为由apache接管了svn的用户管理,所以只需要打开svn项目的配置文件中的读写权限
#创建svn库目录
$ mkdir 
- / home / linq / svn / LINQ
#生成库文件
$ sudo svnadmin create 
/ home / linq / svn / LINQ
#将所有权授予Apache(www
- data), 使之能对库文件进行读写操作:
$ sudo chown 
- R www - data:www - data  / var / local / repos 
#修改库文件LINQ底下的conf / svnserver.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  =  read

auth
- access  =  write
#因为不需要svn本身协议svn:
//,所以不需要配置authz和passwd文件
#http协议访问需要apache来进行权限控制
     3、配置apache访问svn的权限
        sudo vim /etc/apache2/mods-available/dav_svn.conf
   < Location  / svn >

  # Uncomment 
this  to enable the repository,
  DAV svn

  # Set 
this  to the path to your repository
  SVNPath 
/home/qmgwh/L/SVN/ LINQ

  # The following allows 
for  basic http authentication.  Basic authentication
  # should not be considered secure 
for  any particularly rigorous definition of
  # secure.

  # to create a passwd file
  # # rm 
- / etc / apache2 / dav_svn.passwd
  # # htpasswd2 
- / etc / apache2 / dav_svn.passwd dwhedon
  # New password:
  # Re
- type  new  password:
  # Adding password 
for  user dwhedon
  # #

  # Uncomment the following 
3  lines to enable Basic Authentication
  AuthType Basic
  AuthName 
"Subversion Repository"
  AuthUserFile /etc/subversion/
passwd

  # Uncomment the following line to enable Authz Authentication
  # AuthzSVNAccessFile 
/ etc / apache2 / dav_svn.authz

  # The following three lines allow anonymous read, but make
  # committers authenticate themselves.

  
< LimitExcept GET PROPFIND OPTIONS REPORT >
    Require valid
- user
  
</ LimitExcept >

</ Location >
/etc/subversion/passwd用户存放用户名和密码,可以任意指定这个文件
sudo htpasswd2 -c  / etc / subversion / passwd linq
   

4、重启Apache2:

# sudo /etc/init.d/apache2 restart

这时正常情况下,可以使用svn客户端(如netbean的svn插件)访问http://www.demo.com/svn

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值