星期二, 10月 24, 2006

Subversion with Windows domain authentication

Subversion是一個 configuration management tools. 我主要的用途是拿這個工具來管理source code。它可以將source code不同的version之間做一個完善的管理。

Subversion提供了兩種伺服器版本,一個是svn protocol,另一個使用Apache Web Server, 使用 http. 其中使用http的方法非常有彈性,可以做到user acess control, directory access control。除了這兩個之外,還有一個重要的功能,就是它可以使用windows domain username & password 來authenticate user。所以使用 Subversion的使用者不必另外再記一套username & password, 可以直接使用windows domain account 來login subversion。

雖然document上說可以用,但是open source 的東西,要裝上到可以正常工作的狀態,還真的是要花費一番功夫的。

首先要注意Apache的版本不能是最新的,請用2.0x的版本就好。然後裝上document的module。這部份都還好。主要是Apache的config檔,要小心。
我最後的工作版本如下


DAV svn
SVNPath YOURSVNPATH
# authentication using sspi, windows domain

AuthName "SVN Server"
AuthType SSPI
SSPIAuth On
SSPIDomain YOURDOMAINNAME
#SSPIOmitDomain On # keey domain name Require valid-user
SSPIOfferBasic On
AuthzSVNAccessFile "YOURACCESSFILECONFIGFILE"




其中access cofig file的內容如下,要注意domain & username大小寫要區分。

#for all of the directory structure can be read
[/]
YOURDOMAIN\USERNAME = rw