Wednesday, May 14, 2014

Subversion anonymous access for just one directory

In the apache configuration file for the "Location" directive use "Satisfy" before "Require". Note that you might have a second "Require" directive below a "LimitExcept", make sure you *also* use the "Satisfy" there, for example:
# /etc/apache2/sites-available/subversion
<VirtualHost *>
ServerName svn.sample.com
ServerAlias subversion.sample.com
DocumentRoot /var/local/svn/subversion.sample.com
<Location /repos/reporting>
DAV svn
SVNListParentPath off
AuthType Basic
AuthName "Subversion repository"
SVNPath /var/local/svn/subversion.sample.com
AuthzSVNAccessFile /var/local/svn/subversion.sample.com/conf/authz
AuthUserFile /var/local/svn/subversion.sample.com/conf/passwd
Satisfy Any
Require valid-user
<LimitExcept GET PROPFIND OPTIONS REPORT>
Satisfy Any
Require valid-user
</LimitExcept>
</Location>
<Directory "/var/local/svn/subversion.sample.com">
Options -Indexes
</Directory>
</VirtualHost>
# /var/local/svn/subversion.sample.com/conf/authz
[/repo/read/only/path]
$anonymous = r
$authenticated = rw
view raw gistfile1.txt hosted with ❤ by GitHub

No comments:

Followers