Apache+Svn设置问题详解

开发 项目管理
本文和大家学习一下Apache+SVN设置问题,主要包括建立SVNServer服务器和建立权限两部分内容,在这里和大家分享一下。

本节介绍一下SVN设置问题,开始是在win2003enterpriseserver下用Apache+Svn设置,希望通过本节的学习大家能够掌握Apache+SVN设置的方法,欢迎大家一起来学习。下面是具体介绍。
1.建立SVNServe服务器
1)启动服务器程序svnserve
A:-r直接指定到版本库(称之为单库svnserve方式)
比如,有一个库project1,位于D:\svn\project1
svnserve-d-rD:\svn\project1
此种方式建立的版本库,访问方式为:
Svn://127.0.0.1/
B:-r指定到版本库的上级目录(称之多库svnserve方式)
同样,有一个库project1,位于D:\svn\project1
如果使用以下命令启动svnserve
svnserve-d-rD:\svn
此种方式建立的版本库,访问方式为:
Svn://127.0.0.1/project1/。我们再来看一下Apache+SVN设置过程中如何建立权限。

2.建立权限
1)svnserve.conf文件结构分析
每个建立的版本库下,都存在/conf/svnserve.conf文件,此文件就是用于配置此版本库的访问权限。
在版本库权限配置文件svnserve.conf中,以#开头的行为注释。建立版本库后,默认文件内容为:
 

  1. ###Thisfilecontrolstheconfigurationofthesvnservedaemon,ifyou  
  2. ###useittoallowaccesstothisrepository.(Ifyouonlyallow###accessthroughhttp:and/orfile:URLs,thenthisfileis###irrelevant.)  
  3. ###Visithttp://subversion.tigris.org/formoreinformation.  
  4. [general]  
  5. ###Theseoptionscontrolaccesstotherepositoryforunauthenticated  
  6. ###andauthenticatedusers.Validvaluesare"write","read",  
  7. ###and"none".Thesamplesettingsbelowarethedefaults.  
  8. #anon-access=read 
  9. #auth-access=write 
  10. ###Thepassword-dboptioncontrolsthelocationofthepassword  
  11. ###databasefile.Unlessyouspecifyapathstartingwitha/,  
  12. ###thefile'slocationisrelativetotheconfdirectory.  
  13. ###Uncommentthelinebelowtousethedefaultpasswordfile.  
  14. #password-db=passwd 
  15. ###Theauthz-dboptioncontrolsthelocationoftheauthorization  
  16. ###rulesforpath-basedaccesscontrol.Unlessyouspecifyapath  
  17. ###startingwitha/,thefile'slocationisrelativetotheconf  
  18. ###directory.Ifyoudon'tspecifyanauthz-db,nopath-basedaccess  
  19. ###controlisdone.  
  20. ###Uncommentthelinebelowtousethedefaultauthorizationfile.  
  21. #authzauthz-db=authz  
  22. ###Thisoptionspecifiestheauthenticationrealmoftherepository.  
  23. ###Iftworepositorieshavethesameauthenticationrealm,theyshould  
  24. ###havethesamepassworddatabase,andviceversa.Thedefaultrealm  
  25. ###isrepository'suuid.  
  26. #realm=MyFirstRepository 

此文件,大部分都以#开头,为注释部分。文件真实内容只有一句:
[general]
Apache+SVN设置在以下讲解时,只显示出配置内容,不显示注释。
首先来解释以下两句的意义:
anon-access=read
auth-access=write
anon-access表示没有进行验证的用户的功能,有三个可选项:none,read,write。
none表示没有什么权限,此时客户端连接服务器时,客户端就提示进行验证用户;
read表示有读取本版本库的内容的权限,但不能进行commit操作;
write表示可以进行版本库的读写的权限;
auth-access表示经过了验证的用户的权限;
password-db=passwd
这个语句告诉svnserve.exe,用户名与密码放在passwd.文件中,对于passwd文件的结构后面再做说明authz-db=authz
告诉svnserve.exe,项目目录访问权限的相关配置是放在authz.文件中,此文件的设置是细分权限,具体结构下面将做说明;
所以,对于正常使用的版本管理,一般是要进行验证的,典型的/conf/svnserve.conf一般为:
[general]
anon-access=none
auth-access=write
password-db=passwd
authz-db=authz
注意:每个配置行,都要顶头写,没有空格。请期待下节有关Apache+SVN设置讲解。

 【编辑推荐】

  1. SVN配置文档新手指南
  2. 实用SVN配置教程浅析
  3. 详解使用SVN配置自动更新WEB服务器
  4. Centos下SVN的安装配置实用手册
  5. SVN服务器安装指导手册
责任编辑:佚名
相关推荐

2010-05-27 16:18:58

SVN设置

2010-05-19 15:45:23

Apache+SVN权

2010-05-19 15:25:47

Apache+SVN权

2010-05-19 15:15:24

Apache+SVN部

2011-07-29 08:51:51

Apache

2010-05-19 15:00:18

Apache+SVN部

2010-05-27 15:53:35

SVN属性设置

2010-05-27 09:41:05

SVN冲突

2010-06-02 15:51:01

SVN版本控制

2010-05-24 09:11:06

SVN版本库

2010-05-24 11:16:43

SVN更新URL

2010-05-25 19:57:32

2010-06-01 15:11:08

SVN删除文件

2010-05-25 17:35:12

SVN代理

2010-05-26 14:28:53

本地SVN

2010-05-28 17:15:17

SVN分支与合并

2010-05-31 13:23:43

SVN整合MyEcli

2010-05-25 18:32:22

apache+svn+

2010-05-20 12:43:37

SVN Update命

2010-06-01 12:36:04

SVN分支与合并
点赞
收藏

51CTO技术栈公众号