Subversion Server on Mac OS X Leopard Server

Read Time:2 Minute, 56 Second

Subversion and Mac OS X Server image


(This article is from

Nayan Hajratwala over at Agile Shrugged managed to write a really great article describing how he got Subversion repos running on Mac OS X Server.

I got mine working on Mac OS X 10.5.8 but had to make a few different changes in order to get things working. His doesn’t deal with multiple SVN repositories, only with a single one. This isn’t ideal and I highly doubt anyone would go to the trouble of installing a SVN server and only ever need ONE svn repository.

I would suggest using /opt/repos/svn as the master path as the developers recommend doing it this way on Mac OS X.

I’d be interested to know if you could make that an alias to an external drive with svn being a symbolic link inside the /opt/repos folder, which points to a location on an external volume like: /Volumes/External HD/svn. I will try this some day but if anyone knows if this actually works, please leave a comment.
Step 1 – Create a root SVN folder


[code]sudo mkdir -p /opt/repos/svn[/code]

Step 2 – Create your SVN repository

[code]sudo svnadmin create /opt/repos/svn/test
sudo chown -R www:www /opt/repos/svn[/code]

The second line makes Apache own this path and everything inside it including your new repo.
Step 3 – Configure the Apache web server via Server Admin

Server Admin is located in /Applications/Server/Server Admin.

1. Click Web in the Sidebar

2. Click Settings in the top bar

3. Select the Modules tab

4. Check the following modules:

Step 4 – Enable WebDAV on your site

Reading comments, it seems that some people don’t think you need this step. However for my configuration I’m pretty sure you do need to do this.

1. Click Sites in the top bar

2. Select your site

3. Click the WebDAV checkbox
Step 5 – Create a Realm

This will set up the OpenDirectory based security. We will be using Basic authentication only.

1. Select the Realms tab

2. Click “+” under the Realms box and enter the following:

Realm Name: svn_realm
Authentication: Basic
Location: /svn (Note: You have to change the dropdown to ‘Location’, not ‘Folder’).

3. 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…then press the Save button.

Step 6 – Tweak the Apache config file

There is no graphical UI to do this. So you need to use

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 three lines:

[code]DAV svn
SVNParentPath /opt/repos/svn
SVNListParentPath On[/code]

This is what mine looks like:

Step 7 – Restart the web server

You can do this from Server Admin (‘Stop Web’, then ‘Start Web’).

You should be able to access your repository at http://myserver/svn or locally at:http://localhost/svn

Be careful not to change any other settings in the Web portion of Server admin.

If you do it will change DAV svn to DAV Off again.

Free free to leave any comments and suggestions :)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.