关键字: subversion apache 版本控制
Subversion configuration
1. 下载apache(2.2.4)
http://www.trieuvan.com/apache/httpd/binaries/win32/apache_2.2.4-win32-x86-no_ssl.msi
2. 下载subversion(Win32 packages built against Apache 2.2)
http://subversion.tigris.org/files/documents/15/38212/svn-win32-1.4.4.zip
跟python相关的一下文件, 可以从以下地址下载
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100&expandFolder=8100&folderID=8100
3. 安装apache,并解压缩subversion到一指定目录, 并设置如下环境变量,方便svn在命令提示符下正确显示中文帮助信息
APR_ICONV_PATH=D:\svn-win32-1.4.4\iconv
3. 修改apache的配置文件httpd.conf
(1) 去掉前两行代码前的注释符号# 并加上后两行
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_svn_module "D:/svn-win32-1.4.4/bin/mod_dav_svn.so"
LoadModule authz_svn_module "D:/svn-win32-1.4.4/bin/mod_authz_svn.so"
我也尝试过把svn的另个so文件拷贝到modules目录,也拷贝了svn bin目录的一下dll,apache作为服务老是跑不
起来,在命令行窗口用httpd可以启动,也不多研究了,反正目前这样是很好的
(2) 配置apache的目录访问路径,以及授权用户的访问
xml 代码
<Location /svn>
DAV svn
SVNParentPath D:\svn
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile D:\passwd
Require valid-user
</Location>
创建密码文件,以及用户和密码,使用apache的htpasswd
htpasswd.exe -c passwd Administrator
在某个密码文件上增加用户及密码
htpasswd -b passwd clarance 123456
更多用法请参照apache的文档,下面也列出了它的使用方法
Usage:
htpasswd [-cmdpsD] passwordfile username
htpasswd -b[cmdpsD] passwordfile username password
htpasswd -n[mdps] username
htpasswd -nb[mdps] username password
-c Create a new file.
-n Don't update file; display results on stdout.
-m Force MD5 encryption of the password (default).
-d Force CRYPT encryption of the password.
-p Do not encrypt the password (plaintext).
-s Force SHA encryption of the password.
-b Use the password from the command line rather than prompting for it.
-D Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.
C:\Program Files\Apache Software Foundation\Apache2.2\bin>htpasswd -b passwd clarance 123456
Automatically using MD5 format.
Adding password for user clarance
密码文件内容如下
Administrator:$apr1$Nk5.....$Imjp/Nh2bWJoDZDt/aq6f1
clarance:$apr1$s8......$vbAbPA5cAW.ww188.cPWA.
把密码文件拷贝到d盘的根目录下
4. 创建一个svn的头端,进入
D:\svn>svnadmin create /svn/dataswap
5. 向头端中加入工程
F:\dataswap>svn import . http://127.0.0.1/svn/dataswap --message "Initial repository"
6. 从头端checkout工程
E:\codataswap>svn co http://127.0.0.1/svn/dataswap
7. 提交修改的文件
E:\codataswap\dataswap>svn commit --file dataswap_warn.log
svn: 日志信息文件受版本控制;请使用“--force-log”强制执行
E:\codataswap\dataswap>svn commit --file dataswap_warn.log --force-log
正在发送 dataswap_warn.log
传输文件数据.
提交后的版本为 2。
8. 在windows下把svn创建成一个系统服务
sc create svn binpath= "svnserve.exe --service -r d:\svn" displayname= "Subversion Server" depend= Tcpip start= auto
9. 项目授权
<Location /svn>
DAV svn
SVNParentPath D:\svn
AuthzSVNAccessFile D:\subversion\accessfile
AuthType Basic
AuthName "请输入用户的认证信息"
AuthUserFile D:\subversion\passwd
Require valid-user
</Location>
#give read privilege to everyone for every file
#[/]
#* = r
[groups]
dataswap-developers = pengqs, tany
portal-developers = pengqs, huangql, wujh, xiangzl, shihh
gssz-developers = zhengd, wangjl, pengqs, tany, xuh, xiangm, huangql, shihh, xiangzl, wujh, zhoux
everyone-dev = pengqs, wangjl, tany, xuh, xiangzl, zhengd, xiangm, wujh, huangql, shihh, zhoux, meis, liuy, chenbf
stbc-dev = huangql, wujh, zhengd, pengqs, shihh, xiangzl, zhoux, liuwf, tany
geo-administrators = wangjl, pengqs, clarance, Administrator
[dataswap:/]
@dataswap-developers = rw
clarance = rw
zhengd = rw
@geo-administrators = rw
[portal:/]
@portal-developers = rw
clarance = rw
@geo-administrators = rw
@everyone-dev = rw
[gssz:/]
@everyone-dev = rw
@geo-administrators = rw
[gssz:/trunk]
@gssz-developers = rw
clarance = rw
@geo-administrators = rw
[gssz:/tags]
@everyone-dev = r
clarance = rw
@geo-administrators = rw
[subversion:/]
@everyone-dev = r
pengqs = rw
@geo-administrators = rw
[portalprj:/]
clarance = rw
@geo-administrators = rw
[stbc:/]
clarance = rw
@everyone-dev = r
@geo-administrators = rw
@stbc-dev = rw
[stbc-webservice:/]
@everyone-dev = r
@geo-administrators = rw
@stbc-dev = rw
[stbc-mobileclient:/]
@everyone-dev = r
@geo-administrators = rw
@stbc-dev = rw
[slopMonitor:/]
@everyone-dev = r
@geo-administrators = rw
[stbcservice:/]
@everyone-dev = r
@geo-administrators = rw
@stbc-dev = rw