使用MySQL身份validation设置SVN服务器

最近几天,我一直在尝试使用MySQL身份validation来设置我的家庭SVN服务器。 我相信我已经安装了所有的应用程序,并希望一切都configuration正确…但它仍然无法正常工作。

我正在运行一个Debian服务器,svn 1.5.1和apache2。 这是我的dav_svn.conf文件:

<Location /svn> DAV svn SVNParentPath /var/svn-repos AuthBasicAuthoritative Off # our access control policy AuthzSVNAccessFile /var/svn-access/accessfile AuthMYSQL on AuthMySQL_Authoritative on AuthMySQL_DB svn AuthMySQL_Password_Table users AuthMySQL_Username_Field login AuthMySQL_Password_Field pass AuthMySQL_Empty_Passwords off AuthMySQL_Encryption_Types Crypt_MD5 # try anonymous access first, resort to real # authentication if necessary. Satisfy Any Require valid-user AuthType Basic AuthName "Subversion repository" #AuthUserFile /var/www/svn-access/htpasswdsvnrepos </Location> 

我真的不知道我应该把什么放入我的“accessfile”,但也许有人可以为我解释。

我的日志中出现以下错误:

 ==> access.log <== 10.0.1.1 - - [25/Aug/2010:17:20:00 +0200] "GET /svn/project_wombat HTTP/1.1" 401 384 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8" ==> error.log <== [Wed Aug 25 17:20:00 2010] [error] [client 10.0.1.1] Failed to load the AuthzSVNAccessFile: An authz rule refers to group '@project_wombat', which is undefined ==> access.log <== 10.0.1.1 - paulp [25/Aug/2010:17:20:03 +0200] "GET /svn/project_wombat HTTP/1.1" 401 384 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8" ==> error.log <== [Wed Aug 25 17:20:03 2010] [error] Internal error: pcfg_openfile() called with NULL filename [Wed Aug 25 17:20:03 2010] [error] [client 10.0.1.1] (9)Bad file descriptor: Could not open password file: (null) 

在这些问题之上,我想在一个mysql数据库中定义哪些用户可以访问哪些存储库。

这是我的数据库设置:

 CREATE TABLE IF NOT EXISTS `groups` ( `gid` int(10) unsigned NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', PRIMARY KEY (`gid`), UNIQUE KEY `name` (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; CREATE TABLE IF NOT EXISTS `usergroup` ( `uid` int(10) unsigned NOT NULL default '0', `gid` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`uid`,`gid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE IF NOT EXISTS `users` ( `uid` int(10) unsigned NOT NULL auto_increment, `login` varchar(20) NOT NULL default '', `pass` varchar(60) NOT NULL default '', `firstname` varchar(255) NOT NULL default '', `lastname` varchar(255) NOT NULL default '', `email` varchar(255) NOT NULL default '', PRIMARY KEY (`uid`), UNIQUE KEY `login` (`login`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; 

任何人可以帮助我,也许把我放在正确的方向?

问候,保罗Peelen

现在,我得到了它的工作。

我还没有得到项目组的工作,但这是以后的问题。

我使用了drupal的用户表格布局(不要问我为什么);)这是我的dav_svn.conf:

 <Location /svn> DAV svn SVNParentPath /var/svn-repos Order Deny,Allow Allow from All # basic settings AuthType Basic AuthName "Stare SVN Server" Auth_MySQL On Auth_MySQL_Authoritative On # work-around for "Bad file descriptor" AuthUserFile /dev/null AuthBasicAuthoritative Off #MySQL DB Auth_MySQL_Host localhost Auth_MySQL_DB "svn" Auth_MySQL_User "root" Auth_MySQL_Password "password" #User Tables Auth_MySQL_Password_Table "users" Auth_MySQL_Username_Field "name" Auth_MySQL_Password_Field "pass" Auth_MySQL_Encryption_Types PHP_MD5 Auth_MySQL_Empty_Passwords off #Group Tables Auth_MySQL_Group_Table "users, users_roles" Auth_MySQL_Group_Field users_roles.rid #WHERE Clauses Auth_MySQL_Password_Clause " AND status = 1" Auth_MySQL_Group_Clause " AND users_roles.uid = users.uid" #read access <Limit GET PROPFIND OPTIONS REPORT> Require valid-user </Limit> #write access <LimitExcept GET PROPFIND OPTIONS REPORT> # change this to the rid of the role you allow to commit Require group 4 </LimitExcept> </Location> 

/ P