1. 它可以穿过防火墙
2. 可以直接用browser浏览代码(TRAC更直观方便:P)
参照svn的帮助文档:
http://svnbook.red-bean.com/nightly/en/svn.serverconfig.httpd.html
需要给apache2增加三个modules: mod_dav, mod_dav_svn, mod_authz_svn
我用的是Ubuntu,只要:
1. apt-get install libapache2-svn
这样就OK了
接下了配置,一般配置是在apache2.conf,但是ubuntu对每个modules的配置独立放在不同的文件中,呵呵
编辑一下 /etc/apache2/mods-enabled/dav_svn.conf
我的是这样的:
<Location /svn>
# Uncomment this to enable the repository,
DAV svn
SVNParentPath /svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /trac/repos/trac.htpasswd
# The following three lines allow anonymous read, but make
# committers authenticate themselves.
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
这样匿名用户可以浏览,check out代码,但是不能commit, 认证用户有commit权限,当然你可以设置
AuthzSVNAccessFile来配置每一个文件夹的权限,具体看上面提到的文档。
AuthUserFile和配置TRAC提到的作用是一样的,呵呵
apache2 restart一下,
浏览一下http://server/svn/repos,应该可以看到东西了,
svn co http://server/svn/repos
也该可以check out了,
如果要commit的话,check out时加用户名:
svn co http://felix@server/svn/repos
这里设置SVNParentPath而不是SVNPath的好处是可以几个repository同时访问:P
https方式我还没去看,下次吧
