Centos – SVN with Apache 2.2 error: “Forbidden You don’t have permission to access /repos on this server”

apache-2.2centospermissionssvn

I have been following this svn installation guide and when I try to access my test repo by going to http://localhost/repos , I authenticate successfully but then I get this:

"Forbidden You don't have permission to access /repos on this server"

Here is my subversion.conf file:

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so


<Location /repos>
   DAV svn
   SVNParentPath /var/www/svn/repos
#
#   # Limit write permission to list of valid users.
#   <LimitExcept GET PROPFIND OPTIONS REPORT>
#      # Require SSL connection for password protection.
#      # SSLRequireSSL
#
      AuthType Basic
      AuthName "Subversion repos"
      AuthUserFile /etc/svn-auth-conf
      Require valid-user
#   </LimitExcept>
</Location>

My path is /var/www/svn/repos and here are my permissions

[root@localhost svn]# ls -la repos/
total 32
drwxr-xr-x. 6 apache apache 4096 Aug 24 11:42 .
drwxr-xr-x. 3 root   root   4096 Aug 24 11:42 ..
drwxr-xr-x. 2 apache apache 4096 Aug 24 13:50 conf
drwxr-sr-x. 6 apache apache 4096 Aug 24 11:42 db
-rwxr-xr-x. 1 apache apache    2 Aug 24 11:42 format
drwxr-xr-x. 2 apache apache 4096 Aug 24 11:42 hooks
drwxr-xr-x. 2 apache apache 4096 Aug 24 11:42 locks
-rwxr-xr-x. 1 apache apache  229 Aug 24 11:42 README.txt

If I go to localhost/repos/README.TXT I get this message.

<D:error><C:error/><m:human-readable errcode="20">
Could not open the requested SVN filesystem
</m:human-readable></D:error>

Any other filename gives errcode ="2" instead.

selinux is set to permissive, I can see the localhost/index.html file located at var/www/html/index.html just fine.

I have read through a couple fozen forum posts with similar issues to no avail.

Any ideas would be appreciated!

EDIT 1:

I edited my subversion.conf file to change SVNParentPath /var/www/svn/repos to SVNParentPath /var/www/svn but it appears to have no effect.

EDIT 2:

brain99 nailed it. Changing to Location /> fixed the problem and now I am getting a repos - Revision 0: /

Powered by Subversion version 1.6.11 (r934486).

Best Answer

It seems you are confusing the SVNPath and SVNParentPath directives.

From what you post, it seems that /var/www/svn/repos contains a single repository. In this case, use

SVNPath /var/www/svn/repos

Only if you have multiple repositories, you should use SVNParentPath. Each individual repository should then be located in a subfolder of the directory you configure here.

So either set it to the parent directory:

SVNParentPath /var/www/svn

Or leave the configuration as is and move your current repository to a subdirectory, e.g. /var/www/svn/repos/myRepo

For more information on the use of mod_dav_svn, check the SVN Book section on mod_dav_svn