tags:

views:

8148

answers:

3

I have set up a Linux Server and installed Apache and SVN and dav_svn on it. Now, when I try to upload to https://x.x.x.x:x/svn/repo with Tortoise SVN I get

Can't open file '/server/svn/repo/db/txn-current-lock': Permission denied

I have Set up my SSL correctly (I can checkout, no problems, even remotely due to Port Forwarding).

I'm guessing this has to do with the Linux Ownership of the Repository folders, How must I set this/ what are the commands? I'm using Ubuntu 9.04 Server + Apache2.

+10  A: 

This is a common problem. You're almost certainly running into permissions issues. To solve it, make sure that the apache user has read/write access to your entire repository. To do that, chown -R apache:apache *, chmod -R 664 * for everything under your svn repository.

Also, see here and here if you're still stuck.


Update to answer OP's additional question in comments:

The "664" string is an octal (base 8) representation of the permissions. There are three digits here, representing permissions for the owner, group, and everyone else (sometimes called "world"), respectively, for that file or directory.

Notice that each base 8 digit can be represented with 3 bits (000 for '0' through 111 for '7'). Each bit means something:

  • first bit: read permissions
  • second bit: write permissions
  • third bit: execute permissions

For example, 764 on a file would mean that:

  • the owner (first digit) has read/write/execute (7) permission
  • the group (second digit) has read/execute (6) permission
  • everyone else (third digit) has read (4) permission

Hope that clears things up!

John Feminella
Thanks, this helps. I changed the owner to the www-data user, And was able to commit my changes. Is there a good site to learn how chmod works? I cant seem to find any pattern behind the numbers (664?)
wsd
The man page of chmod explains the octal numbers. You can also use characters at least on Linux distributions since several years -- `chmod -R a+rwx *` is somewhat more understandable to most humans.
bluebrother
Genius! Thanks a lot, I never knew Linux was THAT sophisticated.
wsd
I solved this problem on Windows Server 2003 by giving full control of the repository directory to the svn user.
Jason
+1  A: 

Can't comment yet (not enough karma), but I wanted to correct the following line:

the group (second digit) has read/execute write (6) permission

Olivier Lalonde
A: 

Try to disable SELinux by: "/usr/sbin/setenforce 0". In my case it solved the problem.

vladimir