Subversion with Apache, Anonymous read, Auth. readwrite?

Hello,

I've been following this guide (http://www.daniel-skinner.co.uk/setup-s … 06/01/2008">http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008) to setup an Subversion repository via apache. (I skipped the Trac part). The repository is accessable via web due the modules 'davsvnmodule' and 'authzsvnmodule'.

I tried editing the svn-acl-conf file to have guests or anonymous users read access only. Since that's what I'm trying to achieve.

I've got three users now, two developers and one guest account. It works as it should, two with read write rights and one with read only.

Only I want the 'guest' account to be used without logging in via web. Is this possible or am I better off with just a normal subversion repository without Apache?

Thanks :)

1 Reply

According to the guide you are following you should have something very similiar to this in your httpd.conf.

<location svn="" <project="">>
    DAV svn
    SVNPath /srv/svn/ <project>AuthType Basic
    AuthName " <project>Repository"
    AuthzSVNAccessFile /srv/svn/svn-acl-conf
    AuthUserFile /srv/svn/<project>.htpasswd
    Require valid-user</project></project></project></location> 

The block requires a valid user for any access to the /svn/ URL. You can enclose the "Require valid-user" statement inside a "Limit" or "LimitExcept" block to control what type of HTTP operations are allowed.

In general for read only access you need to allow GET, PROPFIND, OPTIONS, and REPORT. So we can enclose your "Require" statement inside a "LimitExcept" block.

So you should replace what you have with…

<location svn="" <project="">>
    DAV svn
    SVNPath /srv/svn/ <project>AuthType Basic
    AuthName " <project>Repository"
    AuthzSVNAccessFile /srv/svn/svn-acl-conf
    AuthUserFile /srv/svn/<project>.htpasswd
   # For any operations other than these, require 
   # an authenticated user. 
   <limitexcept get="" propfind="" options="" report=""> 
       Require valid-user
   </limitexcept></project></project></project></location> 

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct