Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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).

share|improve this question

3 Answers 3

up vote 6 down vote accepted

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

share|improve this answer
    
I edited my subversion file as you ordered and restarted httpd and svnserve, full of youthful hope but the error msg is the same afterwards :( –  gozu Aug 25 '12 at 17:04
1  
I'm actually not sure if you can have SVNParentPath /var/www/svn in a <Location /repos> block where both refer to a different directory. You might want to try changing that into <Location />. Can you post any errors you get in your apache error.log? –  brain99 Aug 25 '12 at 18:48
1  
You 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). Thank you so much! –  gozu Aug 26 '12 at 1:44

At the first, check directory SVNParentPath /var/www/svn/repos exists. next, are there any subdirectories? there should be repositories directori with his own databases. If directory is empty or has no subdirectories, create any repository using svnadmin command (call manual). after creation problem still exists? then comment out all directives AUTH* , and require and restart apache. Access will be anonymous, but you'll check, authorization is or isn't problem. when access is possible, authorization is problem. you must configure this. you must read apache man and learn how to manage AuthUserFile /etc/svn-auth-conf for basic authorization. when problem (with comented out auth) still exist, problem is with file access rights. configure read/write access to username used by apache server. ps auxww tell you what is that user. group number you'll get from /etc/passwd file. group name you'll get from /etc/group file. after this when you'll be able to checkout/update and commit, you can resolve problems with authorization. there are a lot of recipies. I put question "svn create my first repository" into google and I've get a lot of ansvers. The first is for example: http://queens.db.toronto.edu/~nilesh/linux/subversion-howto/ try this one :)

btw. centos is redhat-like linux distro. you can restart apache by /etc/init.d/httpd start/stop . look what is writing into files /etc/apache or /etc/httpd (depended on linux distributio and default apache configuration).

share|improve this answer
    
This question was answered almost 2 years ago :) –  gozu Jul 9 at 14:21
    
I missed this. thanks for pointing this out :) –  Znik Jul 10 at 7:39

try this options: SVNListParentPath on

share|improve this answer
    
It doesn't appear that you fully understood the question. Perhaps you meant to answer a different question? –  Michael Hampton Jul 2 at 15:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.