Subversion on OS X Leopard Server
I’ve found various links to Subversion setup on OS X Server, but most of them leverage a lot of manual file editing rather than using the built-in features of OS X Server. Additionally, they didn’t discuss integrating OS X OpenDirectory.
That said, here is how I got my subversion repository up and running with the built in Apache 2 and OpenDirectory.
Step 1 – Create a Subversion repository
Since Leopard already has Subversion (1.4.4 as of this post), no software installation is required.
svnadmin create /usr/local/svn_repository
We also need to ensure that the repository is editable by the webserver user.
chown -R www /usr/local/svn_repository
You can create additional directories based on your preferred strategy, but you don’t need to in order to complete this setup.
Step 2 – Configure the server via Server Admin
Enable Apache modules
- Click Web in the Sidebar
- Click Settings in the top bar
- Select the Modules tab
- Check the following modules:
Enable WebDAV on your site
Upon reflection, you may be able to skip this step, but I haven’t gone back and undone my changes to try it again. In any case, it can’t hurt.
- Click Sites in the top bar
- Select your site
- Click the WebDAV checkbox
Create a Realm
This will set up the OpenDirectory based security. There are options for Kerberos and Digest as well, but I haven’t tried setting those up.
- Select the Realms tab
- Click “+” under the Realms box and enter the following:
- Realm Name:
/svn(Note: You have to change the dropdown)
- Realm Name:
- Click “+” under the Users & Groups box, and drag/drop the users/groups that you want to give access to. Also be sure to give them read/write privileges.
Click the Save button.
Step 3 – Tweak the config file
Note — I’m using virtual sites. I suppose it would be similar if you’re not.
I couldn’t find any “Apple-ish” way to do this, so this is the only bit you have to manually edit.
Edit the file under
/etc/apache2/sites that corresponds to your site. This should be a file starting with
000x. In the
<Location "/svn"> section, add the following two lines:
Step 4 – Restart the web server
You can do this from Server Admin.
That’s it. You should be able to access your repository at http://yourserver.com/svn – Please let me know if I’ve made any errors or omissions.