Difference between revisions of "Subversion"

From Briki
Jump to: navigation, search
m (1 revision(s))
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
== Ensuring directory perms for svn repos are correct ==
 +
* Create user/group svn, and ensure svnserve runs as this user/group.
 +
* Add user www-data to group svn:
 +
<pre>
 +
sudo adduser www-data svn
 +
</pre>
 +
* Run:
 +
* Create as a script (eg. '''/usr/local/bin/svnfixperms''') and run:
 +
<pre>
 +
#!/bin/sh
 +
for dir in /var/lib/svn/repositories/*
 +
do
 +
    echo "Fixing perms for $dir..."
 +
    find $dir -exec chown root:root {} \;
 +
    for subdir in $dir/dav $dir/db
 +
    do
 +
        find $subdir -exec chown svn:svn {} \;
 +
        find $subdir -type f -exec chmod 664 {} \;
 +
        find $subdir -type d -exec chmod 2775 {} \;
 +
    done
 +
done
 +
</pre>
 +
 
== Creating a new repository ==
 
== Creating a new repository ==
 
# sudo svnadmin create /var/lib/svn/repositories/''reponame''
 
# sudo svnadmin create /var/lib/svn/repositories/''reponame''

Latest revision as of 10:04, 16 November 2007

Ensuring directory perms for svn repos are correct

  • Create user/group svn, and ensure svnserve runs as this user/group.
  • Add user www-data to group svn:
sudo adduser www-data svn
  • Run:
  • Create as a script (eg. /usr/local/bin/svnfixperms) and run:
#!/bin/sh
for dir in /var/lib/svn/repositories/*
do
    echo "Fixing perms for $dir..."
    find $dir -exec chown root:root {} \;
    for subdir in $dir/dav $dir/db
    do
        find $subdir -exec chown svn:svn {} \;
        find $subdir -type f -exec chmod 664 {} \;
        find $subdir -type d -exec chmod 2775 {} \;
    done
done

Creating a new repository

  1. sudo svnadmin create /var/lib/svn/repositories/reponame
  2. sudo svnfixperms
  3. svn import /var/lib/svn/template svn://localhost/reponame

Authorization failed error

If you're using the svn://... syntax, is svnserve running?