1 VisualSVN Server 1.7.1互联网在线安装
为了不干扰机器的正常功能和造成系统垃圾,可以从虚拟机中进行在线安装。
安装过程如下:
1.1 第一步:VisualSVN Server的安装及修正
由于VisualSVN Server 1.7.1发布中基于的Apache 2.2版本集成的ssleay32.dll和libeay32.dll与最新的svn dll不兼容,也和python绑定模块不兼容,因此会造成Trac访问错误,提示DLL加载失败。
为了解决这个问题,需要对VisualSVN Server 1.7.1的安装进行openssl和apache修正。
1.1.1 VisualSVN Server 1.7.1
下载并安装VisualSVN Server 1.7.1,假定安装到了C:/Program Files/VisualSVN Server目录。
要在C:/Program Files/VisualSVN Server目录中建一个modules子目录,mod_python模块的安装需要。
1.1.2 Openssl和apache修正
从Apache官方网站最新稳定版本,要集成openssl的。目前下载的是apache_2.2.11-win32-x86-openssl-0.9.8i.msi,安装后提取其中的ssleay32.dll和libeay32.dll 文件代替VisualSVN Server 1.7.1安装目录中的相应文件即可。
也可以用apache_2.2.11目录bin中的文件替换所有VisualSVN Server 1.7.1安装目录bin中的对应文件,apache中的libapriconv-1.dll,在替换VisualSVN Server目录中libaprutil-1.dll后也需要拷贝过去。
apache_2.2.11在提取完文件后,可以卸载掉。为了给VisualSVN Server集成更多的功能,将apache_2.2.11安装后的目录可以保留一份,以便于随时可以提取相应的so文件。
上面两步完成了VisualSVN Server 1.7.1的安装,并保证了所有dll版本的正确(bug修正)。
1.2 第二步:与Trac集成。
与Trac集成是比较复杂的过程,必须格外小心。
下面的各步操作,需要将VisualSVN Server停止。
1.2.1 python-2.5
下载并安装python-2.5到C:/Python25,记着是2.5,不要2.5.x,否则会提示版本错误。
设置PYTHONHOME环境变量,值为C:/Python25。
将C:/Python25添加到系统PATH末尾。
注销当前用户并重新登录系统。
1.2.2 Setuptools
下载最新的http://peak.telecommunity.com/dist/ez_setup.py到C:/temp,这是python包的下载&安装工具。
也可以从网页中浏览其源代码,在本地编辑保存一个ez_setup.py副本。
执行python ez_setup.py,安装setuptools。
1.2.3 GenShi
用svn命令或TSVN获取Genshi的最新源代码(http://svn.edgewall.org/repos/genshi/trunk)到C:/temp/genshi,并在C:/temp/genshi的命令行下,执行setup.py install安装genshi。
1.2.4 SVN的Python绑定
下载并安装svn-python 1.6.1 for Apache2_2_x,去subversion官方网站下载即可。
1.2.5 pysqlite
从http://pysqlite.org/下载pysqlite-2.5.5.win32-py2.5,并安装。
1.2.6 Trac
用svn命令或TSVN获取Trac的最新源代码()到c:/temp/trac,并在C:/temp/trac的命令行下,执行setup.py install安装trac。
1.2.7 Apache的python加载器
下载并安装mod_python-3.3.1.win32-py2.5-Apache2.2。
默认它将mod_python.so文件拷贝到C:/Program Files/VisualSVN Server/modules目录下,需要移动到C:/Program Files/VisualSVN Server/bin目录中。
1.3 配置VisualSVN Server的Apache服务器
1.3.1 添加SVN Server远程密码修改功能。
采用与VisualSVN Server对应的Apache22Passwd.rar中的cgi脚本(Apache版本一致),将其解压缩到C:/Program Files/VisualSVN Server/cgi-bin目录即可。
1.3.2 配置svn模块和cgi模块
修改C:/Program Files/VisualSVN Server/conf目录下的httpd.conf文件添加svn模块信息,修改后的内容如下:
# # This is configuration file for Apache HTTP server which is # part of VisualSVN Server. # # DO NOT EDIT THIS FILE IT WILL BE REGENERATED AUTOMATICALLY BY VISUALSVN SERVER # # Contact with VisualSVN Ltd. (support@visualsvn.com) if you have suggestions and # improvements. #
ThreadsPerChild 64 MaxMemFree 100 MaxRequestsPerChild 0 Win32DisableAcceptEx
ServerRoot "C:/Program Files/VisualSVN Server" ServerName "abcdefg:3268" ServerSignature Off ServerTokens Prod DocumentRoot "htdocs"
PidFile "D:/ROOT4SVN/server.pid"
Listen "3268"
LoadModule alias_module bin/mod_alias.so LoadModule auth_basic_module bin/mod_auth_basic.so LoadModule authn_file_module bin/mod_authn_file.so LoadModule authn_visualsvn_module bin/mod_authnz_visualsvn.so LoadModule authz_visualsvn_module bin/mod_authnz_visualsvn.so LoadModule authz_host_module bin/mod_authz_host.so LoadModule authz_svn_module bin/mod_authz_svn.so LoadModule autoindex_module bin/mod_autoindex.so
LoadModule cgi_module bin/mod_cgi.so
LoadModule dir_module bin/mod_dir.so LoadModule deflate_module bin/mod_deflate.so LoadModule mime_module bin/mod_mime.so LoadModule setenvif_module bin/mod_setenvif.so
LoadModule dav_module bin/mod_dav.so LoadModule dav_svn_module bin/mod_dav_svn.so # LoadModule ssl_module bin/mod_ssl.so
<Directory /> Options FollowSymLinks AllowOverride None </Directory>
<Location /svn/> DAV svn
SVNListParentPath on SVNParentPath "D:/ROOT4SVN/" SVNIndexXSLT "/svnindex.xsl" SVNPathAuthz on
AuthName "SVN-1.7.1" AuthType Basic AuthBasicProvider file AuthUserFile "D:/ROOT4SVN/htpasswd" AuthzSVNAccessFile "D:/ROOT4SVN/authz"
require valid-user </Location>
<IfModule dir_module> DirectoryIndex index.html </IfModule>
ErrorLog "D:/ROOT4SVN/server.log"
LogLevel warn
<IfModule log_config_module> # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # LogFormat "%h %l %u %t /"%r/" %>s %b /"%{Referer}i/" /"%{User-Agent}i/"" combined LogFormat "%h %l %u %t /"%r/" %>s %b" common
<IfModule logio_module> # You need to enable mod_logio.c to use %I and %O LogFormat "%h %l %u %t /"%r/" %>s %b /"%{Referer}i/" /"%{User-Agent}i/" %I %O" combinedio </IfModule>
# # The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a <VirtualHost> # container, they will be logged here. Contrariwise, if you *do* # define per-<VirtualHost> access logfiles, transactions will be # logged therein and *not* in this file. # CustomLog "D:/ROOT4SVN/access.log" common
# # If you prefer a logfile with access, agent, and referer information # (Combined Logfile Format) you can use the following directive. # #CustomLog "D:/ROOT4SVN/access.log" combined </IfModule>
DefaultType text/plain
<IfModule mime_module> TypesConfig conf/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl </IfModule>
<IfModule ssl_module> SSLEngine on
SSLRandomSeed startup builtin SSLRandomSeed connect builtin SSLPassPhraseDialog builtin SSLSessionCache "shm:D:/ROOT4SVN/ssl_scache" SSLSessionCacheTimeout 300 SSLMutex default SSLCertificateFile conf/server.pem SSLCertificateKeyFile conf/server.pem SSLProtocol -ALL +SSLv3 +TLSv1 SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM
SetEnvIf User-Agent ".*MSIE.*" / nokeepalive ssl-unclean-shutdown / downgrade-1.0 force-response-1.0
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "C:/Program Files/VisualSVN Server/cgi-bin/"
</IfModule>
<Directory "C:/Program Files/VisualSVN Server/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory>
Include conf/httpd-custom.conf
|
1.3.3 配置trac模块
修改httpd-custom.conf文件添加trac信息。
# python LoadModule python_module bin/mod_python.so LoadModule authz_user_module bin/mod_authz_user.so
<Location /trac> SetHandler mod_python PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir "D:/ROOT4Trac" PythonOption TracUriRoot /trac
AuthName "Trac" AuthType Basic AuthBasicProvider file AuthUserFile "D:/ROOT4SVN/htpasswd" Require valid-user </Location> |
1.4 Svn版本库的建立及Trac的使用
完成前述操作后,启动VisualSVN Server服务,就可以建立一个svn版本库、建立trac库并进行访问测试了。
至于svn版本库的建立,trac项目的初始化、同步等,网上这方面的信息很充足了,就不赘述了。