Joinclass Inc  
软件开发 软件配置 项目管理 软件工程
公告
  • 本人联系方式: E-mail: tilanmaster@gmail.com msm: J.joy@msn.com
日历
统计
  • 随笔 - 53
  • 文章 - 52
  • 评论 - 67
  • 引用 - 0

导航

常用链接

留言簿(1)

随笔分类(53)

随笔档案(53)

文章分类(61)

相册

JAVA学习链接

搜索

  •  

积分与排名

  • 积分 - 88448
  • 排名 - 77

最新评论

阅读排行榜

评论排行榜

 
前几天写了linux版的,受广大论友的邀请,特写此windows的版本,希望大家能够共同为此论坛作出贡献,也希望越来越多的人能够更加方便地使用SVN。

OS: Windows XP SP2

1) 安装Apache Server
2) 安装SVN
3) 配置邮件通知以及修改log权限

1. 安装apache2.0.59,从这里可以下载到http://apache.justdn.org/httpd/binaries/win32/apache_2.2.3-win32-x86-no_ssl.msi
安装过程中设置以下参数:
Network Domain: localhost
Server name: localhost
Administrator's Emai Address: windymax@126.com
安装到默认路径为C:\Program Files\Apache Group\Apache2

2. 安装subversion1.4.0,从这里下载http://www.iusesvn.com/bbs/download/svn-win32-1.4.0.zip
安装到默认路径为C:\Program Files\Subversion
默认安装后,在apache的配置文件中会自动加入以下两行。
LoadModule dav_svn_module "C:/Program Files/Subversion/bin/mod_dav_svn.so"
LoadModule authz_svn_module "C:/Program Files/Subversion/bin/mod_authz_svn.so"
把这行的注释去掉
LoadModule dav_fs_module modules/mod_dav_fs.so

拷贝C:\Program Files\Subversion\bin下的libdb44.dll到这个目录下C:\Program Files\Apache Group\Apache2\bin
打开apache的配置文件在末尾处加入以下参数:
<Location /svn>
DAV svn
SVNPath d:\svndata\test
AuthType Basic
AuthName "Windy SVN"
AuthUserFile d:\svndata\test\passwd
Require valid-user
</Location>
保存。(在这里权限文件我不多讲了,大家多做实验就明白了)

建立仓库
打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
C:\Documents and Settings\windy> d:   //进入D盘(因为我们要在D盘下创建仓库)
D:\> md svndata   //创建一个名叫svndata的目录
D:\> c:   //进入C盘
C:\Documents and Settings\windy> cd\   //退到C盘根目录
C:\Documents and Settings\windy> cd C:\Program Files\Subversion\bin  //进入subversion/bin目录
C:\Program Files\Subversion\bin> svnadmin create d:\svndata\test   //用svnadmin命令创建名为test的仓库(这条命令成功后,在test下会出现很多文件夹和文件)
C:\Program Files\Subversion\bin> cd C:\Program Files\Apache Group\Apache2\bin   //进入apache\bin目录
C:\Program Files\Apache Group\Apache2\bin> htpasswd -cm d:\svndata\test\passwd user1   //用htpasswd命令创建第一个用户(user1),同时生成密码认证文件,c参数为create,m参数为MD5加密方式
New password: ******
Re-type new password: ******
Adding password for user user1   //加入用户成功
C:\Program Files\Apache Group\Apache2\bin> htpasswd -m d:\svndata\test\passwd user2   //用htpasswd命令创建第二个用户(user2),注意如果在这时加入c参数会覆盖掉之前创建的用户及文件。
New password: ******
Re-type new password: ******
Adding password for user user2   //加入用户成功

重新启动apache,进行测试。
用IE打开http://localhost/svn,这时应该可以看到
Revision 0: /
--------------------------------------------------------------------------------
Powered by Subversion version 1.4.0 (r21228).    //说明我们已经配置成功了

3. 配置邮件通知以及修改log权限
下载所需要的软件包
--在这里下载http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.819-MSWin32-x86-267479.msi到D盘根目录下。
--下载http://download.microsoft.com/download/vc15/patch/1.52/w95/en-us/nmake15.exe到D盘根目录下。
--下载http://search.cpan.org/CPAN/authors/id/K/KW/KWILLIAMS/Module-Build-0.2805.tar.gz到D盘根目录下,将Module-Build-0.2805.tar.gz解压到D盘。
--下载http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Authen-SASL-2.10.tar.gz到D盘根目录下,将Authen-SASL-2.10.tar.gz解压到D盘。
--下载http://search.cpan.org/CPAN/authors/id/A/AP/APLEINER/Net-SMTP_auth-0.08.tar.gz到D盘根目录下,将Net-SMTP_auth-0.08.tar.gz解压到D盘。
--下载http://search.cpan.org/CPAN/authors/id/D/DW/DWHEELER/SVN-Notify-2.64.tar.gz到D盘根目录下,将SVN-Notify-2.64.tar.gz解压到D盘。

开始安装Perl以及模块
--安装Active Perl,一路默认安装,默认路径为C:\Perl
--测试perl是否正常工作(这步很关键)
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
   C:\Documents and Settings\windy> perl   //如果没有报错,说明已经正常工作,因为安装perl时,安装程序会自动设置好环境perl(如果在系统环境变量中没有自动添加,需手动添加perl变量环境),具体做法是:
  "回到桌面" -> "鼠标右键我的电脑" -> "属性" -> "高级" -> "环境变量" -> "系统变量中Path最前面中添加C:\Perl\bin\;" ->"完成"。   //测试,如果报错,请重新启动电脑后进行测试。
--将nmake15.exe改名为nmake.exe后拷贝到c:\windows\system32目录下。
--测试nmake是否是否正常工作(这步很关键)
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
   C:\Documents and Settings\windy> nmake   
  Microsoft (R) Program Maintenance Utility   Version 1.50
  Copyright (c) Microsoft Corp 1988-94. All rights reserved.   //说明nmake已经正常工作
--安装Module-Build模块
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
  C:\Documents and Settings\windy> d:
  D:\> cd Module-Build-0.2805
  D:\Module-Build-0.2805> perl Build.PL   //收集系统环境变量
  D:\Module-Build-0.2805> Build   //进行编译
  D:\Module-Build-0.2805> Build test   //测试
  D:\Module-Build-0.2805> Build install   //编译后安装  
--安装Perl模块Authen::SASL,进入Authen-SASL-2.10目录,首先开打Makefile.PL
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
  C:\Documents and Settings\windy> d:
  D:\> cd Authen-SASL-2.10
  D:\Authen-SASL-2.10> perl Makefile.PL   //收集系统环境变量
  出现选择安装提示,y和n先后安装一次
  D:\Authen-SASL-2.10> nmake   //进行编译
  D:\Authen-SASL-2.10> nmake test  //进行测试
  D:\Authen-SASL-2.10> nmake install   //编译后安装
--安装Perl模块Net::SMTP_auth
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
  C:\Documents and Settings\windy> d:
  D:\> cd Net-SMTP_auth-0.08
  D:\Net-SMTP_auth-0.08> perl Makefile.PL   //收集系统环境变量
  D:\Net-SMTP_auth-0.08> nmake   //进行编译
  D:\Net-SMTP_auth-0.08> nmake test   //测试
  D:\Net-SMTP_auth-0.08> nmake install   //编译后安装
--安装Perl模块SVN::Notify
  打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
  C:\Documents and Settings\windy> d:
  D:\> cd SVN-Notify-2.64
  D:\SVN-Notify-2.64> perl Build.PL   //收集系统环境变量
  D:\SVN-Notify-2.64> Build   //进行编译
  D:\SVN-Notify-2.64> Build test   //测试
  D:\SVN-Notify-2.64> Build installl   //编译后安装  
--安装完毕。

设置邮件通知
--拷贝post-commit.tmpl为post-commit.bat
--删除末尾参数,增加下面参数:
set REPOS=%1
set REV=%2
SET PATH=C:\PERL\BIN;
SET OS=Windows_NT
SET SystemRoot=C:\WINDOWS
svnnotify --repos-path %REPOS% -r %REV% --to windy@126.com --smtp smtp.126.com -H HTML::ColorDiff -d --subject-prefix [Windy SVN]
//--to要跟你要发送给谁的邮件地址,--smtp后跟你自已的邮件服务器地址,比如mail.126.com

设置log可以修改
--拷贝pre-revprop-change.tmpl为pre-revprop-change.bat
--删除末尾参数,增加下面参数:
REM SVN pre-revprop-change hook allows edit of logmessages from TSVN

setlocal
set REPOS=%1
set REV=%2
set USER=%3
set PROPNAME=%4
set ACTION=%5

if  not "%ACTION%"=="M" goto refuse
if  not "%PROPNAME%"=="svn:log" goto refuse
goto OK

:refuse
echo Cann't set %PROPNAME%/%ACTION%, only svn:log is allowed 1>&2
endlocal
exit 1

:OK
endlocal
exit 0

完成所有设置,开始测试。



 

  • 反馈一:
    --安装Perl模块SVN::Notify
      打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
      C:\Documents and Settings\windy> d:
      D:\> cd SVN-Notify-2.64
      D:\SVN-Notify-2.64> perl Build.PL   //收集系统环境变量
      D:\SVN-Notify-2.64> Build   //进行编译
      D:\SVN-Notify-2.64> Build test   //测试
      D:\SVN-Notify-2.64> Build installl   //编译后安装  
    ————这些命令运行不下去啊,报错:'build'不是内部或外部命令,也不是可运行的程序或批处理文件!!!
    反馈二:
    --拷贝post-commit.tmpl为post-commot.bat
    ————应该是必为post-commit.bat
    反馈三:
    设置log可以修改
    --拷贝post-commit.tmpl为post-commot.bat
    ————应该是改 pre-revprop-change.tmp为pre-revprop-change.bat
  •  

    QUOTE:


    反馈一:
    --安装Perl模块SVN::Notify
      打开CMD命令行界面,"开始" -> "运行" -> "cmd" -> "回车"
      C:\Documents and Settings\windy> d:
      D:\> ...
    perl Build.PL 你执行成功了吗?

    D:\SVN-Notify-2.64>perl Build.pl
    Deleting _build
    Creating custom builder _build\lib\My\Builder.pm in _build\lib\My
    Checking whether your kit is complete...
    Looks good

    Checking prerequisites...
    * Optional prerequisite Test:od::Coverage is not installed
    * Optional prerequisite Test:od is not installed

    ERRORS/WARNINGS FOUND IN PREREQUISITES.  You may wish to install the versions
    of the modules indicated above before proceeding with this installation

    Creating new 'Build' script for 'SVN-Notify' version '2.64'

    D:\SVN-Notify-2.64>Build
    lib\SVN\Notify\HTML.pm -> blib\lib\SVN\Notify\HTML.pm
    lib\SVN\Notify\HTML\ColorDiff.pm -> blib\lib\SVN\Notify\HTML\ColorDiff.pm
    lib\SVN\Notify\Alternative.pm -> blib\lib\SVN\Notify\Alternative.pm
    lib\SVN\Notify.pm -> blib\lib\SVN\Notify.pm
    bin\svnnotify -> blib\script\svnnotify
    Manifying blib\script/svnnotify -> blib\bindoc\svnnotify.1
    Manifying blib\lib/SVN/Notify.pm -> blib\libdoc\SVN.Notify.3
    Manifying blib\lib/SVN/Notify/HTML.pm -> blib\libdoc\SVN.Notify.HTML.3
    Manifying blib\lib/SVN/Notify/HTML/ColorDiff.pm -> blib\libdoc\SVN.Notify.HTML
    olorDiff.3
    Manifying blib\lib/SVN/Notify/Alternative.pm -> blib\libdoc\SVN.Notify.Alterna
    ve.3
    HTMLifying blib\script\svnnotify -> blib\binhtml\bin\svnnotify.html
    HTMLifying blib\lib\SVN\Notify.pm -> blib\libhtml\site\lib\SVN\Notify.html
    Build: blib\lib\SVN\Notify.pm: cannot resolve L<perlio|perlio> in paragraph 87
    HTMLifying blib\lib\SVN\Notify\HTML.pm -> blib\libhtml\site\lib\SVN\Notify\HTM
    html
    HTMLifying blib\lib\SVN\Notify\HTML\ColorDiff.pm -> blib\libhtml\site\lib\SVN\
    tify\HTML\ColorDiff.html
    Build: blib\lib\SVN\Notify\HTML\ColorDiff.pm: unknown pod directive 'head1' in
    aragraph 56.  ignoring.
    HTMLifying blib\lib\SVN\Notify\Alternative.pm -> blib\libhtml\site\lib\SVN\Not
    y\Alternative.html
    t\bin\testsvnlook -> t\scripts\testsvnlook
    t\bin\testsendmail -> t\scripts\testsendmail

    D:\SVN-Notify-2.64>Build test
    t\alt..............ok
    t\base.............ok
    t\errors...........ok
    t\html.............ok
    t\htmlcolordiff....ok
    t\options..........ok
    t\pod-coverage.....skipped
            all skipped: Test:od::Coverage 1.06 required for testing POD covera
    t\pod..............skipped
            all skipped: Test:od 1.20 required for testing POD
    t\script...........ok
    t\smtp.............ok
    All tests successful, 2 tests skipped.
    Files=10, Tests=714, 85 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)

    D:\SVN-Notify-2.64>Build install
    Skipping C:\Perl\man\man1\svnnotify.1
    Skipping C:\Perl\html\bin\svnnotify.html
    Skipping C:\Perl\site\lib\SVN\Notify.pm
    Skipping C:\Perl\site\lib\SVN\Notify\HTML.pm
    Skipping C:\Perl\site\lib\SVN\Notify\Alternative.pm
    Skipping C:\Perl\site\lib\SVN\Notify\HTML\ColorDiff.pm
    Skipping C:\Perl\man\man3\SVN.Notify.3
    Skipping C:\Perl\man\man3\SVN.Notify.HTML.3
    Skipping C:\Perl\man\man3\SVN.Notify.HTML.ColorDiff.3
    Skipping C:\Perl\man\man3\SVN.Notify.Alternative.3
    Skipping C:\Perl\html\site\lib\SVN\Notify.html
    Skipping C:\Perl\html\site\lib\SVN\Notify\HTML.html
    Skipping C:\Perl\html\site\lib\SVN\Notify\Alternative.html
    Skipping C:\Perl\html\site\lib\SVN\Notify\HTML\ColorDiff.html
    Skipping C:\Perl\bin\svnnotify
    Skipping C:\Perl\bin\svnnotify.bat
    Writing C:\Perl\site\lib\auto\SVN\Notify\.packlist

posted on 2007-01-15 22:16 Joinclass Inc 阅读(1278) 评论(1)  编辑 收藏 引用 所属分类: 配置管理
评论:
  • # re: windows上安装apache2.0.59 + svn1.4.0 + 自动邮件通知  23401 Posted @ 2007-12-19 02:51
    谢啦,我正要学呢,就看到了,  回复  更多评论   

只有注册用户登录后才能发表评论。
 
Copyright © Joinclass Inc Powered by: 博客园 模板提供:沪江博客