Home

Hello. My name is Noemi Millman, and Triopter is my web development agency. We handcraft beautiful, dynamic websites.

See what I can do for you.

Noemi Millman: Triopter: Six Steps to a Subversion Server on OS X with Darwinports

Six Steps to a Subversion Server on OS X with Darwinports

I’ve tried on at least three separate occasions to set up a CVS repository on my computer, but each time I’ve completely given up, mostly because getting the darn thing configured properly just seems to be beyond my abilities.

But besides that, CVS is really obsolete at this point, and Subversion has really taken over its status as the de facto standard for free, open-source revision control software.

Installation was yet another project that turned out to be super-easy with a little help from Darwinports.

Here’s the full set of steps to install:

  1. Grab Apache 2 off Darwinports and get it running separately from the default OS X Apache 1.3 installation (PHP, MySQL, et al entirely optional). Darwinports’ Apache automatically includes mod_dav, which you’ll need.

  2. Install Subversion and Apache’s dav_svn_module:

    sudo port install subversion +mod_dav_svn

    Darwinports’ Subversion conveniently includes both server and client. Spiffy.

  3. Decide where your repository is going to live. I set up a directory under my user directory, with the full path /Users/myusername/svn

  4. Configure Apache to work with Subversion. First, add the following to the bottom of the list of LoadModule directives in httpd.conf:

    LoadModule dav_svn_module modules/mod_dav_svn.so

    Then add the following to the end of httpd.conf:

    <Location /svn ># I think you can change "/svn" to whatever you want the path to be on your server.
    DAV svn
    SVNPath /Users/myusername/svn/ # Change this to the path you chose in Step 3, of course
    </Location>

    If you want to keep your repository private — i.e. only accessible from the machine it’s hosted on, you can add a few lines, like so:

    <Location /svn ># I think you can change "/svn" to whatever you want the path to be on your server.
    DAV svn
    SVNPath /Users/myusername/svn/ # Change this to the path you chose in Step 3, of course

    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    </Location>

  5. Create your repository:

    svnadmin create --fs-type fsfs /Users/myusername/svn

  6. Restart Apache

Whee, that was easy.

Browse to http://localhost:81/svn (substitute the appropriate port, of course, if you configured Apache differently) — and if you get something that looks like a really simple webpage, you’re set.

I’m kind of in love with Darwinports right now, in case you haven’t noticed. Next challenge: actually configuring a Subversion repository. I’m seriously crossing my fingers that this is easier than CVS.

Post a Comment

Your email is never published nor shared. Required fields are marked *

Comments may be held for moderation to prevent spam: your comment may not appear immediately.