SUBSCRIBE VIA RSS


Subscribe to our feed

Status Updates

  • First iPhone app nearly complete! I've been waiting for 3 weeks for Apple to finish "conducting company identity verification."
    2 days ago
  • Rainy day! Staying indoors. Creating computerized players in a simulation game that models cooperation in the work place.
    74 days ago
  • Up at 8AM, with a hot cup of coffee brought back from Cafe Lola in Ann Arbor. Will I succeed in putting in 8 billable hours in one day?
    99 days ago
  • full scale irish band outside my window playing the pipes for the past 20 minutes. pretty fun.
    108 days ago
  • listening to Kristin on Maxim Radio!
    114 days ago
  • back from an amazing meal at ouest with even more amazing company.
    115 days ago
  • wondering how so many online tshirt companies stay in business--ones that sell shirts with funny messages, i never see them in real life
    121 days ago

Topics

TWITTER

The old fashioned way

RECENT TUNES

January 21, 2008 – 9:50am svn, apache2, os x leopard 10.5

Mac OS 10.5 Leopard ships with Apache2 and SVN. However, if you want to keep a local svn repository and not use an external svn server (only really useful if you have projects which you will be the only developer), you have to set up the repository yourself. Here is a quick cheat-sheet to help you do just that.

Make the repository

Substitute REPOSNAME with the name of your repository (aka the project name).

$ sudo mkdir /usr/local/svn
$ sudo mkdir /usr/local/REPOSNAME
$ sudo svnadmin create /usr/local/svn/REPOSNAME
$ sudo chown -R www:www /usr/local/svn/REPOSNAME

Configure Apache

I used textmate to edit a new text file named svn.conf, you can use vi or whatever you want.

$ cd /etc/apache2/other
$ mate svn.conf

Inside /etc/apache2/other/svn.conf:

LoadModule dav_svn_module /usr/libexec/apache2/mod_dav_svn.so
<Location /svn>
  DAV svn
  SVNParentPath /usr/local/svn
</Location>

And now restart apache…

$ sudo apachectl graceful

Finally, check out your repository to make sure it worked: http://localhost/svn/REPOSNAME.

svn apache2 leopard

Final notes

You may want to secure access to your repository through a password file. In a nutshell, you can use something like sudo htpasswd -cm /etc/apache2/auth/svn USERNAME (you can create this file anywhere but I like to keep all my auth files in a custom “auth” directory). Then edit your svn.conf file and add these lines right before the closing ‘Location’ tag:

Inside /etc/apache2/other/svn.conf:

AuthType Basic
AuthName "SVN"
AuthUserFile /etc/apache2/auth/svn
Require valid-user

If you need more detailed instructions you should head over here.

Posted in  OS X Web Development   |     |  delicious  Digg

8 Responses to “svn, apache2, os x leopard 10.5”

  1. Short and greatful description! It works after one minute. Is it also easy to use https://? I’m a beginner with Mac OS and with Apache - but not with Subversion (luckily!).

    Lars

    By Lars on Apr 20, 2008

  2. I’ve never done this before, however these resources may help:
    1. Configure Apache to use SSL: http://developer.apple.com/internet/serverside/modssl.html

    2. Set up SVN: http://svnbook.red-bean.com/en/1.0/ch06s04.html#id2734751

    By Scott Meves on Apr 20, 2008

  3. i still can’t get this to work. whenever i try to get to the “localhost/svn/foo” it says page not found. do i need “web sharing” on (tried it both ways) - i’m assuming i’m missing something easy here…

    By jason on Aug 7, 2008

  4. Jason, yes you will need to enable web sharing. Basically, web sharing starts Apache up for you.

    By Chris on Aug 29, 2008

  5. hi jason, I am getting the same error as you. i am not sure why. one thing i noticed in the “make repository” section is that the 2nd line is pointing to a different path than the 3rd and 4th lines. is that on purpose?

    By lockheartmac on Sep 9, 2008

3 Trackback(s)

  1. Dec 10, 2008: Stereo Interactive & Design » Starting a new symfony project: SVN externals
  2. Dec 17, 2008: Java, Mac et parfois plus … » Subversion sur Mac OS X Léopard
  3. Mar 5, 2009: Xeon Xai » Blog Archive » Subversion + Mac OS X Leopard + XCode 3 = Faster Coding

Post a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word