1.yum install subversion mysql-server httpd mod_dav_svn mod_perl sendmail wget gcc-c++ make unzip perl* ntsysv vim-enhancedmysql
2.mkdir /home/svn//新建一個目錄用於存儲SVN全部文件c++
3.svnadmin create /home/svn/project//新建一個版本倉庫sql
4.mkdir project project/server project/client project/test//(創建臨時目錄)vim
svn import project/ file:///home/svn/project -m "初始化SVN目錄"服務器
rm -rf project (刪除臨時創建的目錄)ide
5.添加用戶svn
要添加SVN用戶很是簡單,只需在/home/svn/project/conf/passwd文件添加一個形如「username=password"的條目就能夠了.爲了測試,我添加了以下內容:測試
[users]spa
# harry = harryssecretserver
# sally = sallyssecret
pm = pm_pw
server_group = server_pw
client_group = client_pw
test_group = test_pw
6.修改用戶訪問策略
/home/svn/project/conf/authz記錄用戶的訪問策略,如下是參考:
[groups]
project_p = pm
project_s = server_group
project_c = client_group
project_t = test_group
[project:/]
@project_p = rw
* =
[project:/server]
@project_p = rw
@project_s = rw
* =
[project:/client]
@project_p = rw
@project_c = rw
* =
[project:/doc]
@project_p = rw
@project_s = rw
@project_c = rw
@project_t = rw
* =
以上信息表示,只有pm有根目錄的讀寫權,server_group能訪問server目錄,client_group能訪問client目錄,全部人均可以訪問doc目錄.
7.修改svnserve.conf文件,讓用戶和策略配置升效.
svnserve.conf內容以下:
[general]
anon-access = none
auth-access = write
password-db = /home/svn/project/conf/passwd
authz-db = /home/svn/project/conf/authz
8.
啓動服務器
# svnserve -d -r /home/svn
9.測試服務器
# svn co svn://192.168.119.142/project