免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1288 | 回复: 0
打印 上一主题 下一主题

Linux下配置svn版本管理工具概要 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-07 12:36 |只看该作者 |倒序浏览

Linux下配置svn版本管理工具概要
一、安装svn需要的工具和支持库
二、安装步骤
三、测试
四、配置Apache,使得可以通过浏览器通过网络浏览项目代码
五、参考资料
一、安装svn需要的工具和支持库
在linux上安装svn server需要一些额外的工具和运行库支持,它们是:
1. Apache Portble Runtime 0.9.7
2. autoconf 2.50 or newer (unix only)
3. libtool 1.4 or newer (unix only)
4. Neon library 0.24.7 or 0.25.5
5. Berkeley DB 4.X (svn server使用bdb repository filesystem或访问本地bdb repository
所需,否则svn会使用fsfs filesystem)
6. Apache Web Server 2.0.49 or newer
7. Python 2.0
二、安装步骤
1. 首先编译Apache
下载最新版本的Apache Web Server,编译并安装。
./configure --prefix=/usr/local/apache2 --enable-mods-shared=most --with-dbm=db4 --with-berkeley-db=/usr
make && make install
安装好Apache后,在Apache的bin目录下有相应的apr和apu配置程序。
2. 其次编译并安装svn
编译svn时要指定相应的apache选项和选用的Berkeley DB。
./configure --with-apr=/usr/local/apache2  --with-apr-util=/usr/local/apache2 --with-apxs=/usr/local/apache2/bin/apxs --with-neon=/usr --with-berkeley-db=/usr
make && make install
注意1:
装svn server时要注意和apache配合,主要是对Berkeley DB版本的统一使用。在configure apache和svn时,都要指定同样的Berkeley DB。
对于apache:使用 --with-dbm=db4 --with-berkeley-db=/path/to/db来指定。
对于svn:使用 --with-berkeley-db=/path/to/db来指定。
注意2:
svn自己所带的包里也包含了apr、apu和neon这些额外的运行库,但时为了减少svn对这些库的依赖,最好是在configure配置时指定外部的运行库路径来定位这些库,这样就可以从svn版本仓库里获取最新的svn代码来编译安装svn。
三、测试
1.
安装完svn后在Apache的配置文件httpd.conf中会有下面两行:
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
2.创建svn仓库
a.)使用svnadmin创建代码仓库基目录
svnadmin create /path/to/repos  
b.)导入项目代码
svn import /path/to/project file:///path/to/repos
注意:为了便于svn的管理,项目的目录结构最好是:
/project
├─/baranches
├─/tags
└─/trunk
把项目的代码放在trunk目录中。
c.)从代码仓库中checkout出本地工作版本
svn checkout file:///path/to/repos/trunk /path/to/workcopy
d.)修改本地工作拷贝,并试用各种svn命令
svn diff
svn update
svn commit
...
四、配置Apache,使得可以通过浏览器通过网络浏览项目代码
五、参考资料
下载svn: http://subversion.tigris.org/downloads/subversion-1.3.1.tar.gz
下载apache:  http://mirror.vmmatrix.net/apache/httpd/httpd-2.2.2.tar.gz
svn网站上一篇非常不错的安装指南:
http://svn.collab.net/repos/svn/trunk/INSTALL
这个文件就是svn tar包里包含的INSTALL。
更多参考文档:
http://subversion.tigris.org/servlets/ProjectDocumentList
3.1.3 用户密码文件和权限配置文件
用户密码文件svnpasswd和权限配置文件svnauthz都存放于Apache2的安装目录下。
用户密码文件svnpasswd
用户密码文件可以使用Apache2自带的htpasswd命令。在Apache2的安装目录下使用下面命令创建svnpasswd文件。
bin\htpasswd –c svnpasswd username
如果需要在现有文件中添加新的用户名或者修改用户名,那么使用下面的命令:
bin\htpasswd svnpasswd username
★注意,此时svnpasswd需要在bin目录下存在,如果用户名已经存在,那么将不会给出提示,直接修改了密码。
权限配置文件svnauthz
权限分配的文件的格式如下。
[groups]
admin = john, kate
devteam1 = john, rachel, sally
devteam2 = kate, peter, mark
docs = bob, jane, mike
training = zak
# Default access rule for ALL repositories
# Everyone can read, admins can write, Dan German is excluded.
[/]
* = r
@admin = rw
dangerman =
# Allow developers complete access to their project repos
[proj1:/]
@devteam1 = rw
[proj2:/]
@devteam2 = rw
[bigproj:/]
@devteam1 = rw
@devteam2 = rw
trevor = rw
# Give the doc people write access to all the docs folders
[/trunk/doc]
@docs = rw
# Give trainees write access in the training repository only
[TrainingRepos:/]
@training = rw
权限配置文件中,关键的几个概念是:目标和权限,也就是为谁分配什么样的权限。读为r,写为w,如果没有权限那么什么也不写即可。
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/19429/showart_335856.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP