I’ve set up a Ubuntu Server for Subversion with Apache/WebDAV interface to share repositories with other developers. My question is, how can I make Subversion use the linux system accounts for authentication? This would lead to very easy Subversion account management. Subversion with Apache/WebDAV is currently working with this configuration:
Contents of /etc/apache2/mods-available/dav_svn.conf:
<Location /svn>
DAV svn
SVNParentPath /home/svn
SVNListParentPath On
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
I have tried changing AuthUserFile /etc/apache2/dav_svn.passwd with AuthUserFile /etc/shadow with no success. This makes the server to respond with a error 500 internal server error. It’s logical, why the Web service should have access to system authentication file?
Thanks a lot in advance!
Ok! I did it! And I thought it would be very hard to find the answer!
We have to tell Apache to use an “external authentication provider”, Apache won’t be checking for authentication, but will delegate the task to an external authenticator, in this case, the marvellous pwauth.
So the steps I did to make it work was:
Install Mod_Auth_External module for Apache2 and pwauth
Enabled the new module for Apache:
sudo a2enmod authnz_externalin terminal.Configured my
apache.conf(or you may havehttpd.conf) to add the external authenticator (based on this article):Edited my
/etc/apache2/mods-available/dav_svn.confto set the new external auth provider:Tested and worked fine!