学习笔记:在Debian下如何进行Subversion配置

开发 项目管理
本文主要介绍了Subversion配置问题的解决方法,在这里拿出来和大家分享一下,希望对大家有用。

学习Subversion时,你可能会遇到Subversion配置问题,这里将介绍Subversion配置问题的解决方法,在这里拿出来和大家分享一下。就像大多数软件的安装和配置一样,Subversion配置和使用在Debian下也是非常方便。现以使用Apache2+mod_svn的方式加以说明。

假定条件:我们将所有的项目都放在/var/lib/svn目录下,要创建foo这个项目。项目的使用人员有张三(zhangs)和李四(lis)。张三(zhangs)是领导,只负责审查(只读),不用修改;李四(lis)是苦工,什么都要干(读写)。

1.首先当然是安装Apache2和Subversion。
apt-getinstalllibapache2-svnapache2-mpm-preforksubversion
这儿选用apache2-mpm-prefork的理由是,当前在Debian中只有这个版本可以使用PHP4。

2.创建一个项目
svnadmincreate/var/lib/svn/foo
因为我们要由Apache2来提供服务,所以将目录权限改成是Apache2运行时用户www-data:
chownwww-data.www-data/var/lib/svn/foo-R。

通过上面对Subversion配置的介绍你一定对Subversion有了更深刻的理解吧,下面继续第三步。
3.配置Apache2
编辑/etc/apache2/mods-available/dav_svn.conf,使之如下:
#dav_svn.conf-ExampleSubversion/Apacheconfiguration
#
#FordetailsandfurtheroptionsseetheApacheusermanual.
#...
#URLcontrolshowtherepositoryappearstotheoutsideworld.
#Inthisexampleclientsaccesstherepositoryashttp://hostname/svn/repos

#uncommentthistoenabletherepository
DAVsvn

#setthistothepathtoyourrepository
SVNParentPath/var/lib/svn
SVNIndexXSLT"/svnindex.xsl"
#Thefollowingallowsforbasichttpauthentication.Basicauthentication
#shouldnotbeconsideredsecureforanyparticularlyrigorousdefinitionof
#secure.
#tocreateapasswdfile
##rm-f/etc/apache2/dav_svn.passwd
##htpasswd2-c/etc/apache2/dav_svn.passwddwhedon
#Newpassword:
#Re-typenewpassword:
#Addingpasswordforuserdwhedon
##
#Uncommentthefollowing3linestoenableBasicAuthentication
AuthTypeBasic
AuthName"SubversionRepository"
#AuthLDAPEnabledon
#AuthLDAPURLldap://localhost/ou=Users,dc=sczfcpa,dc=com?uid?one
AuthUserFile/etc/apache2/dav_svn.passwd
#UncommentthefollowinglinetoenableAuthzAuthentication
AuthzSVNAccessFile/etc/apache2/dav_svn.authz
#Uncommentthefollowingthreelinesallowanonymousread,butmake
#committersauthenticatethemselves
#
Requirevalid-user
#

修改访问权限的Subversion配置文件/etc/apache2/dav_svn.authz(/etc/apache2/mods-available/dav_svn.conf指定的),使之如下:
[foo:/]
*=
zhangs=r
lis=rw
然后再添加用户到/etc/apache2/dav_svn.passwd:
htpasswd2-c/etc/apache2/dav_svn.passwdzhangs
(输入密码)
htpasswd2-c/etc/apache2/dav_svn.passwdlis
(输入密码)
Apache2的监听端口在/etc/apache2/ports.conf里面设置,我设置的81,这样可以不影响现有的Apache1.3。
现在可以试试用http://localhost:81/svn/foo来访问了。
 

【编辑推荐】

  1. SubVersion Windows安装指南
  2. CentOS安装新版subversion
  3. Subversion SVN协议解析远程整数溢出漏洞
  4. 如何结合使用Subversion和Eclipse
  5. Subversion Pre-Commit-Hook Template未明安全漏洞
责任编辑:佚名
相关推荐

2010-07-27 11:08:12

Flex

2011-09-19 16:56:14

Vista秘密下载

2011-09-15 17:01:25

ubuntu备份

2010-05-18 09:59:06

Subversion安

2010-05-18 09:43:58

Subversion安

2010-08-03 14:52:49

Flex界面设计

2010-05-28 10:49:29

SVN服务器搭建

2010-05-24 16:21:55

SVNServer安装

2010-05-24 16:21:55

SVNServer安装

2010-02-22 16:05:40

Python配置

2010-05-25 12:41:19

Subversion

2010-05-18 13:26:16

Subversion插

2010-06-02 18:51:35

搭建SVN服务器

2010-05-25 18:32:22

apache+svn+

2010-03-25 18:52:15

Nginx负载均衡

2010-06-01 09:59:00

SVN客户端安装及环境

2010-05-24 08:51:13

Linux下SVN服务

2010-05-18 17:50:57

Subversion服

2010-05-12 18:05:45

linux下subvesubversionapache配置

2010-03-26 15:14:20

Linux系统环境
点赞
收藏

51CTO技术栈公众号