Trying to setup SVN to use HTTP, with the user/auth user access files.
I have开发者_开发技巧 the following in the subversion.conf for the Apache Server:
<Location /repos>
DAV svn
SVNPath /apps/CollegeDir/CollegeRepository/
AuthzSVNAccessFile /asvn/svnAccessAuthz
AuthType Basic
# AuthName "Subversion Repository"
AuthUserFile /asvn/svnUserAuthz
Require valid-user
#
# # Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
# AuthType Basic
# AuthName "Authorization Realm"
# AuthUserFile /path/to/passwdfile
# Require valid-user
# </LimitExcept>
</Location>
I have the following in the user/password auth files (each file is set to apache/apache/766 as a test)
/asvn/svnAccessAuthz
[/]
* = rw
[/repos]
* = rw
[/repos/trunk]
* = rw
[repos:/]
* = rw
[repos:/trunk]
* = rw
[/trunk]
* = rw
/asvn/svnUserAuthz
bill:$apr1$NsGWbE/9$695MXkrm8x06hMabC3Hu71
the svnUserAuthz file was create using:
htpasswd -mb /etc/svnUserAuthz bill qqqqqq
When I try to access the repos, using the following i get the Internal 500 error, with the "Need Authname /foo" in the apache err logs.
svn list --username bill --password qqqqqq http://192.168.1.45/repos
svn: Server sent unexpected return value (500 Internal Server Error)
in response to OPTIONS request for 'http://192.168.1.45/repos'
the error_log is:
[Thu Mar 17 21:08:38 2011] [error] [client 192.168.1.45] need AuthName: /repos/
[Thu Mar 17 21:08:43 2011] [error] [client 192.168.1.45] need AuthName: /repos/trunk
if I comment out the
# AuthzSVNAccessFile /asvn/svnAccessAuthz
# AuthType Basic
# AuthName "Subversion Repository"
# AuthUserFile /asvn/svnUserAuthz
# Require valid-user
then I can easily access the repos, so I'm screwing up something with the user/passwd access process.
i've set the access on the /asvn and the svn files to be:
chmod 766
chown apache.apache
so the files are completely accessible to the apache server...
I've tried numerous combinations in the auth file to try to get it to allow access for a test user, but I'm completely stumped.
Thoughts/comments/pointers would be greatly appreciated.
Thanks
Uff I have a bash script for this which I could sell :) It even creates my svn hooks :) I think you should not comment out the auth name
Here I give you some working configs from one of my svns.
<Location />
DAV svn
SVNPath '/var/svn/web1339/reproname'
SVNAutoversioning on
AuthType Basic
AuthName 'svn - reproname'
AuthUserFile '/var/svn/web1339/reproname/dav_svn.passwd'
Require valid-user
</Location>
the repro is owned by the apache user, it can be either apache or www-data depends on your system. apache on centos. www-data on debian.
With the tool htpasswd you can edit your password file.
htpasswd -bcs "${reprofolder}/dav_svn.passwd" "$3" "$4"
$3 should be username $4 is the password.
Have fun and good luck.
One possibility (from the snippets in your question) is svnUserAuthz
file is present in /etc
and not /asvn
as expected by the apache configuration.
精彩评论