Skip to main content

SVN - Permission Denied


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.


Source: Tips4allCCNA FINAL EXAM

Comments

  1. 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!

    ReplyDelete
  2. It's permission problem. But not "clasic" read/write permissions of apache user, but selinux one.

    Apache cannot write to files labeled as httpd_sys_content_t they can be only read by apache.

    You have 2 possibilities:


    label svn repository files as httpd_sys_content_rw_t:

    chcon -R -t httpd_sys_content_rw_t /path/to/your/svn/repo

    set selinux boolean httpd_unified --> on

    setsebool -P httpd_unified=1



    I prefer 2nd possibility. You can play also with other selinux booleans connected with httpd:

    getsebool -a | grep httpd

    ReplyDelete
  3. 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

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

    ReplyDelete
  5. for example on debian

    sudo gpasswd -a svn-admin www-data
    sudo chgrp -R www-data svn/
    sudo chmod -R g=rwsx svn/

    ReplyDelete
  6. In addition to repository permissions, /tmp must also be writeable (by all)

    ReplyDelete

Post a Comment

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex