我最喜欢使用的OS就是FreeBSD,并且如今恰好有一台FreeBSD服务器,因此我想把个人SVN服务器迁移到FreeBSD上,再配合hudson和ant就能够自动编译了。数据库
第一步:安装svn:apache
在安装它以前先使用命令pkg_delete -f libtool\* 把libtool里的东西去掉让它自动更新到最新的,不然安装时会出错的。windows
使用ports安装:服务器
cd /usr/ports/devel/subversion/less
#make install WITHOUT_BDB=yes WITH_MOD_DAV_SVN=yes APXS=/usr/local/sbin/apxs
说明:WITHOUT_BDB=yes 这是不使用BerkleyDB才加上的,你愿意使用能够去掉,WITH_MOD_DAV_SVN=yes APXS=/usr/local/sbin/apxs 两个参数是为了支持Apache的WebDAV方式
若是不使用apache的话就能够把对它的支持选项所有去掉。
第二步:建库:
mkdir /usr/svn #把它作为svn的要目录
svnadmin create /usr/svn/projectOne #projectOne就是建的第一个库
第三步:配置权限:
在projectOne下的conf文件夹下有一个conf文件夹,要修改它下面的三个文件:
一、增长一个用户,打开passwd文件,加入一个用户名与密码:如
[users]
# harry = harryssecret
# sally = sallyssecret
test = test #这里加入一个test用户,而且密码是test
二、修改用户权限:
打开authz文件,配置以下:(只要修改groups节点)
[groups]
admin = test #这里表示有一个admin用户组,这个用户组中用一个叫test的用户
[/] #这里是特别须要注意,若是启动时是指定的svn的要目录就用/,好比启动是指定的是
#svnserve -r -d /usr/svn/, 若是启动时指定的是 -r -d /usr/svn/projectOne 这里就要 用 [/projectOne]b
@admin = rw #表示admin组中的用户都有读写权限
* = r
# [repository:/baz/fuz]
三、修改svnserver.conf文件,配置以下:
anon-access = none #表示不容许匿名用户访问
auth-access = write #经过认证的用户能够写
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd #指定密码文件
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz #指写权限分配文件
第三步:启动svn服务:
svn默认启动的是IPV6的,因此在启动时须要加一些参数:
svnserve -d -r /usr/svn/ --listen-host=0.0.0.0 --listen-port=3690
这样就能够了。tcp
好了,开始使用吧,先创建数据库文件存放位置。我这里创建/usr/local/svn_data文件夹,而后输入:svn