nav-left cat-right
cat-right

Subversion

4.1 Subversion

Subversion is great, but you probably don't want it on a production webserver. Keep it on a development box in-house, or a production server separate from any with essential web services.

4.1.1 Install Subversion

  • sudo su -
  • yum install subversion

The svnserve daemon needs a control script and a chkconfig entry to run as a service. I found a script at http://www.fedoraforum.org/forum/archive/index.php/t-165130.html, but it doesn't work (for CentOS anyway). I modified it to a version that works. Copy it to /etc/init.d/svnserve, then create a file at /etc/sysconfig/subversion that contains:

OPTIONS = "-r /srv/svn"

The init script will use these options when launching the svnserve daemon. Now:

  • chmod 755 /etc/init.d/svnserve
  • chkconfig --add svnserve
  • service svnserve start

4.1.2 Creating a new repository

  • sudo su -
  • cd /srv
  • svnadmin create svn

4.1.3 Importing a backed-up repository

Assuming you're just setting up a fresh repository named svn under /srv, you can just import your old repository:

  • sudo su -
  • svnadmin create svn
  • svnadmin load svn < repository-name.dmp

Set up at least some basic authentication options in /srv/svn/conf/svnserve.conf file:

[general]
anon-access = none
auth-access = write
password-db = passwd

And if you're setting up a new repository, you'll have to create /srv/svn/conf/passwd to go along with that conf file:

[users]
blake = yourpassword
user2 = user2password

Don't forget to set the permissions on this clear-text password file:

  • chmod 600 passwd

If you've just moved the repository between servers, make sure to set your SVN clients to use the new repo!

  • Digg
  • del.icio.us
  • DotNetKicks
  • Slashdot
  • StumbleUpon