- 論壇徽章:
- 0
|
我的目標(biāo)是使得用戶:chenwei,fengdongwei,zhouwei,luowei,liuxin
有不同的權(quán)限, 于是按照手冊上配置, 出現(xiàn)了錯誤, 主要的問題出在
手冊上的配置是對于一個目錄下有多個資料庫, 但是我的svn目錄下只有一個資料庫,
所以設(shè)置上有些不同
下面是幾個非常好的文章
http://study.pay500.com/2/s24508.htm
http://man.chinaunix.net/linux/d ... arning/ch09s14.html
另外debian.linuxsir.org 上的http://debian.linuxsir.org/main/?q=node/58
都是非常好的文章, 根據(jù)他們文章里面的配置, 下面是一個標(biāo)準(zhǔn)的配置文件- # dav_svn.conf - Example Subversion/Apache configuration
- #
- # For details and further options see the Apache user manual.
- # <Location URL> ... </Location>
- # URL controls how the repository appears to the outside world.
- # In this example clients access the repository as http://hostname/svn/repos
- <Location /svn>
- # uncomment this to enable the repository
- DAV svn
- # set this to the path to your repository
- SVNParentPath /var/lib/svn
- SVNIndexXSLT "/svnindex.xsl"
- # The following allows for basic http authentication. Basic authentication
- # should not be considered secure for any particularly rigorous definition of
- # secure.
- # to create a passwd file
- # # rm -f /etc/apache2/dav_svn.passwd
- # # htpasswd2 -c /etc/apache2/dav_svn.passwd dwhedon
- # New password:
- # Re-type new password:
- # Adding password for user dwhedon
- # #
- # Uncomment the following 3 lines to enable Basic Authentication
- AuthType Basic
- AuthName "Subversion Repository"
- # AuthLDAPEnabled on
- # AuthLDAPURL ldap://localhost/ou=Users,dc=sczfcpa,dc=com?uid?one
- AuthUserFile /etc/apache2/dav_svn.passwd
- # Uncomment the following line to enable Authz Authentication
- AuthzSVNAccessFile /etc/apache2/dav_svn.authz
- # Uncomment the following three lines allow anonymous read, but make
- # committers authenticate themselves
- # <LimitExcept GET PROPFIND OPTIONS REPORT>
- Require valid-user
- # </LimitExcept>
- </Location>
復(fù)制代碼 另外需要寫權(quán)限文件, 可以參考
[groups] #定義組
admin=jims,ringkee
tests=tester1,tester2
[erp:/] #定義erp儲存庫根目錄的訪問權(quán)限
@admin=rw #admin組有讀寫權(quán)限
tests=r #test用戶只有讀權(quán)限
[oa:/test] #定義oa儲存庫下test目錄的訪問權(quán)限
*= #禁止所有用戶訪問,星號代表所有用戶,權(quán)限為空代表沒有任何權(quán)限
ringkee=rw #打開ringkee用戶的讀寫權(quán)限注意,組用戶的rw必須寫成 @admin 前面有@
用戶的rw沒有@
另外, 由于是多個repo,所以權(quán)限文件里面的目錄是上面那么寫的,
: 前的代表了repo資料庫的名稱,
如果是單獨的資料庫, 那么就一定要沒有: 和他前面的東西。
下面說我的一些經(jīng)驗, 我只有一個svn的repo~,所以配置不一樣:
svn權(quán)限的安裝- <Location /svn>
- DAV svn
- SVNPath G:\svn\repository
- AuthType Basic
- AuthName "Subversion repository"
- AuthUserFile G:\svn\svn-auth-file
- #AuthzSVNAccessFile G:\svn\accessfile
- <LimitExcept GET PROPFIND OPTIONS REPORT>
- Require valid-user
- </LimitExcept>
- </Location>
復(fù)制代碼 上面的代碼可以實現(xiàn)驗證用戶的提交,但是沒法做到按目錄的管理
在accessfile里面
如果是多個respositor, 則寫為[testmgr:/]這樣的目錄, 但是
如果上面用的SVNPath,只有一個res,那么必須寫[/]這樣的目錄
而且 , 如果是rw權(quán)限的話, 必須使用@group=rw才可以
組用戶是@admin=rw
用戶是liuxin=rw
單個項目的話, 目錄是這樣的
[/testmgr/branches/]
以res的名稱開頭
郁悶!
最后的配置文件是- [groups]
- admin=root
- leader=chenwei
- dev=fengdongwei,zhouwei,luowei,liuxin
- [/testmgr/branches/fengdongwei]
- fengdongwei=rw
- [/testmgr/branches/zhouwei]
- zhouwei=rw
- [/testmgr/branches/luowei]
- luowei=rw
- [/testmgr/branches/liuxin]
- liuxin=rw
- [/testmgr]
- *=r
- @admin=rw
- @leader=rw
復(fù)制代碼 幾個比較重要的命令是
svnadmin create d:\svn\repository 在那個目錄下建立repository檔案庫, 如果在這個目錄D:\svn\下建立多個的話,就需要在上面的配置文件里面用SVNParentPath了, 現(xiàn)在svn目錄下只有一個repo,就只能用SVNPath
svn import . http://localhost/svn -m "Initial repository layout" 導(dǎo)入一個目錄 |
|