SUBSCRIBE VIA RSS


Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.

Topics

Stack Overflow


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 by in  OS X Web Development   |  

10 Responses to svn, apache2, os x leopard 10.5

  1. Lars says:

    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

  2. Scott Meves says:

    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

  3. jason says:

    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…

  4. Chris says:

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

  5. lockheartmac says:

    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?

  6. Pingback: Stereo Interactive & Design » Starting a new symfony project: SVN externals

  7. Pingback: Java, Mac et parfois plus … » Subversion sur Mac OS X Léopard

  8. Pingback: Xeon Xai » Blog Archive » Subversion + Mac OS X Leopard + XCode 3 = Faster Coding

  9. John Barrett says:

    Thanks so much! You are my hero`-`
    I spend all day trying to figure this out, and not until I found your wonderful straight forward tutorial could I figure it out.

    Thanks so much`-`
    Johnny

  10. iMick says:

    Wow … you saved my day too! Cool short description, man! So glad, I stumbled over it.