我最喜歡使用的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