1. 下载subversion for mac osx,建议下载dmg镜像安装.安装完后,svn会将分布文件到多个路径中,情况如下:
/usr/local/bin: This is where the Subversion executables will be installed.
/usr/local/lib: This is where Subversion and it's dependency libraries will be installed.
/usr/local/lib/svn-apache: This is where the Subversion Apache modules will be installed.
/usr/local/lib/svn-javahl: This is where the Subversion Java bindings (JavaHL) will be installed.
/usr/local/lib/svn-perl: This is where the Subversion Perl bindings will be installed.
/usr/local/lib/svn-python: This is where the Subversion Python bindings will be installed.
/usr/local/lib/svn-ruby: This is where the Subversion Ruby bindings will be installed.
/usr/share/man: This is where the Subversion and it's dependency man pages will be installed.
2. 用sudo vi /etc/profile命令,将/usr/local/bin目录追加到PATH系统环境变量中去,此时执行:
$ svn --version
svn, version 1.4.4 (r25188)
compiled Jun , 14:23:02
Copyright (C) CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository access (RA) modules are available:
* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
- handles 'http' scheme
- handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
/usr/local/svn_installer_backup: This is where the Subversion installer will move any files that needed to be "overwritten".
3. copy /usr/local/lib/ svn-apache下的*.so到 /Library/Apache2/modules目录下,
$ cp /usr/lib/svn-apache/*.so /Library/Apache2/modules
4. 修改/Library/Apache2/conf/httpd.conf文件,如下:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
DAV svn
SVNParentPath "/Users/minggui/data/svn-repos"
SVNListParentPath on
# 认证信息,即限制访问身份配置
AuthType Basic
AuthName "SVN repository"
AuthUserFile /Users/minggui/data/svn-repos/repos1/conf/svn-auth
Require valid-user
5.初始化svn源码库
$ svnadmin create --fs-type fsfs /Users/zhangminggui/data/svn-repos/repos1
$ svn import /Users/minggui/data/projects/testGrailsApp file:/Users/minggui/data/svn-repos/repos1 -m "init test grails app"
6. 设置svn账号及密码
$ htpasswd -cm svn-auth jacky
New password:
Re-type new password:
Adding password for user jacky
$ htpasswd -m svn-auth zhang
New password:
Re-type new password:
Adding password for user zhang
$ ls
authz passwd svn-auth svnserve.conf
6. 最后启动apache服务,在浏览器地址栏中输入url即可访问svn源码库
$sudo apachectl start
URL访问: http://localhost/svn