Print
Mac Mini, the SubVersion Server, revisited
I finally upgraded my Apple Developer Connection (ADC) Membership to a Select Membership, which comes with the benefit of getting access to Apple software like Mac OS X Server v10.4.

[Related blog entry: Mac Mini, the perfect Project Automation Server]

So I spent last weekend installing OSX Server on the Mac Mini and making it a SubVersion Server. OSX Server come with some cool admin. tools but everything I'm showing here, works on the regular OS X 10.4 Tiger install as well. Therefore, if you want to install SubVersion on your Mac or just want to know how it can be done, follow along.

It took three attempts, to write the DMG to a boot-able DVD.

After downloading the tiger server dmg file, I opened it and burned its content on a DVD. Unfortunately, I used Toast, which quit with an error message 99% through the burning process ... twice! I guess I still have that Windows mentality - if it fails, don't worry just try it again, and again, ..
I needed to use DiskUtility to burn the dmg, to what became a boot-able DVD.


Installing Tiger Server on the Mac Mini is really not much different from installing OSX and after about 30 minutes the basic installation was done in a straight forward process.


VNC - Apple calls it ARD, Apple Remote Desktop

I have one of the now older Mac Minis, running at 1.25 GHz, 167MHz bus, and 512MB RAM.
Since most of the time I don't have a monitor, keyboard, and mouse connected, I enabled Apple Remote Desktop (with VNC Viewer checked) and use the Chicken of the VNC client on my G5 to access Mac Mini's UI. For most things you can use the Terminal and ssh into the Mini, however, sometimes it's just more convenient to use the UI.

Installing SubVersion

Unlike stated on the SubVersion site, one doesn't need to install FINK. Thanks to German countryman Martin Ott, for providing the Subversion-1.2.3 packages containing statically linked binaries built for Mac OS X 10.3 or later on his .Mac site.
Installing SubVersion 1.2.3. is a straight forward process but some additional work is needed, to launch it as a daemon every time the Mini boots (or when svnserve is requested, to be precise).

sudo /usr/local/bin/svnadmin create /usr/local/svn-repos --fs-type fsfs

For later use with ssh, i found it also useful to copy svnserve into the bin directory:
sudo cp /usr/local/bin/svnserve /bin

Creating a Project

Like pointed out in the Pragmatic Version Control (Using Subversion) book my Mike Mason, probably the easiest way to get a project structure into SubVersion, is to create the folder tree on a client first and then import it into the repository.
After creating my Repository at /usr/local/svn-repos, I created the usual sesame demo tree on the Mini and simply imported it into the newly created repository like this:
macmini:~/sesame wolf$ sudo /usr/local/bin/svn import . file:///usr/local/svn-repos/sesame -m "Create folder structure."

A new owner...

Next, I created a user account "svnserver" with the Accounts tool in the System Preferences and used NetInfo Manager to staring out the password and put the account into the daemon group etc. While OS X Server has some other cool GUI tools for doing User and Group Management, for our purpose, NetInfo Manager worked just fine.


Now with the new user in place, it's time to change ownership:

macmini:~/sesame wolf$ ls -ld /usr/local/svn-repos
drwxr-xr-x 9 root wheel 306 Nov 12 22:37 /usr/local/svn-repos

macmini:~/sesame wolf$ sudo chown -R svnserver:daemon /usr/local/svn-repos
macmini:~/sesame wolf$ sudo chmod -R 770 /usr/local/svn-repos
macmini:~/sesame wolf$ sudo chmod g+t /usr/local/svn-repos/db

macmini:~/sesame wolf$ ls -ld /usr/local/svn-repos
drwxrwx--- 9 svnserve daemon 306 Nov 12 22:37 /usr/local/svn-repos

User Access

For simple user / password access, the svnserve.conf file needs to be modified:
sudo pico /usr/local/svn-repos/conf/svnserve.conf
[general]
anon-access=none
auth-access=write
password-db=passwd

sudo pico /usr/local/svn-repos/conf/passwd
[users]
wolf=my_secret

LaunchDaemons

Creating Launch-On-Demand Daemons is explained on Apple's Developer Support site and the Student Computing Lab of the University of Utah has a Quicktime slide show (including audio from James Reynolds) explaining it in great detail.
So here is the svn.plist file that I put into the /Library/LaunchDaemons folder on the Mini. While there exists a /System/Library/LaunchDaemons, for your own launch scripts, it's better to use /Library/LaunchDaemons instead.

svn.plist


If you read through the svn.plist XML document you will notice that UserName svnserver, GroupName daemon, and --root /usr/local/svn-repos, matches exactly what was used to configure SubVersion and the subversion repository.



Using the svnX client on the G5 allows me now to access the SubVersion Mini Server conveniently.


The svnX supports drag and drop nicely, simply dragging a file from Finder into svnX would add a file into the repository.


QR code, to put this blog on your mobile