Httpd – ‘txn-current-lock’: Permission denied [500, #13] – Subversion + Apache Configuration Issue

apache-2.2httpdmod-dav-svnsvn

Current Setup

  • Fedora 13 32bit

  • Apache 2.2.16

  • Subversion repositories setup under /var/www/svn

I have two different repositories under this directory so my /etc/httpd/conf.d/subversion.conf setup in this way;

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

<Location /svn>
   DAV svn
   SVNListParentPath on
   SVNParentPath /var/www/svn

   <LimitExcept GET PROPFIND OPTIONS REPORT>
      AuthType Basic
      AuthName "Subversion Repository"
      AuthUserFile /etc/httpd/.htpasswd
      Require valid-user
   </LimitExcept>
</Location>

After copying over my repos and using;

  • chmod 755 -R /var/www/svn

  • chcon -R -t httpd_sys_content_t /var/www/svn

  • chown apache:apache -R /var/www/svn

I can browse my repos fine through the browser, and I can update all my working copies, however when I try to check in from anywhere I get the same error

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

I have been working on this issue for a while now and cant seem to find a solution to my issues. It might be of some use to know that the repo existed on a different server before this, it has been now moved to this new server.

Everything I have read seems to indicate that the permissions for apache are incorrect, however apache is set to run as User apache and Group apache. So as far as I can tell my setup is correct. The behavior is not though.

Any Ideas?

Solution

The only way I was able to get this to work is to disable SELinux, it could also be done by setting the proper booleans with SELinux via setsetbool and getsebool since this is just a home server, I decided to disable SELinux and am reaping the benefits now.

Best Answer

Instead of having the directories owned by apache:apache, use apache:subversion. That is,

chown apache:subversion -R /var/www/svn

Andrew