Leopard Server

Subscribe to Leopard Server 4 post(s), 2 voice(s)

 
Avatar BM5k 12 post(s)

Installing Warehouse on Leopard Server was relatively painless, the rails svn bindings come pre-installed, and pretty much everything worked “out of the box”. A couple things bit me with SVN config, and it took quite a while to track everything down.

Getting SVN to work in Leopard

This assumes that you want to have seperate repositories for each of multiple projects. You don’t have to create every project just yet. If you know you’re only going to have a single project or a single repository, then things are slightly simpler, but I won’t bother with that.

Create a folder to store your repositories, I used Terminal:

sudo mkdir -p /Library/Subversion/Repository

use svnadmin create your project directories

cd /Library/Subversion/Repository
sudo svnadmin create project1
sudo svnadmin create project2
sudo svnadmin create project3

Set the repository permissions (you must do this after creating new projects)
sudo chown -R www:admin /Library/Subversion
sudo chmod -R 775 /Library/Subversion

Open up Server Admin, and select your server’s web config.

Under settings / modules, select

authz_svn_module
dav_module
dav_fs_module
dav_svn_module

In the settings for your site, enable Dav and add a realm.

I called mine svn_realm, and set it to use basic authentication at the location /svn/

I’ve got a group for webmasters, and have given them read/write access to this realm, and denied everyone else.

The hard part:
You have to modify the /etc/apache2/sites/your-site-here.conf by hand. On my server, this file is /etc/apache2/sites/0000_any_80_.conf

Look for the <location> line, and make sure these two lines are in that location block. I’ve got mine as the first 2 lines.

DAV svn
SVNParentPath /Library/Subversion/Repository

I prefer TextMate, but you can use anything. The problem is that every time you use Server Admin to make ANY changes to your web server, you’ll have to re-open this file, because for some reason Server Admin changes DAV svn to DAV off EVERY FRICKIN TIME!!!

Here’s my entire location directive

<Location "/svn/">
        DAV svn
        SVNParentPath /Library/Subversion/Repository
        <Limit GET HEAD OPTIONS CONNECT POST PROPFIND PUT 
DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
            Require group  webmasters
        </Limit>
        AuthType Basic
        AuthName "svn_realm" 
    </Location>

This lets you check in and out like
svn import project1 <a href="http://your.server.com/svn/project1">http://your.server.com/svn/project1</a> -m "Initial Import"
and
svn checkout <a href="http://your.server.com/svn/project1/trunk/">http://your.server.com/svn/project1/trunk/</a> project1

Sorry about the formatting, it seems to be ignoring the code & pre tags, and inserting links :(

Warehouse

I’ve created a Rails directory in /Library/WebServer where I intend to house all of my rails apps. Warehouse is installed in warehouse/current (thanks to rake warehouse:setup). I’ve got it set up to use directories instead of sub domains. Right now, I’ve just been running it using ruby script/server -e production to test everything, but so far/so good.

I’m using the default post-commit hook for SVN, so I’ve got

#!/bin/sh
cd /Library/WebServer/Rails/warehouse/current
/usr/bin/rake warehouse:post_commit RAILS_ENV=production REPO_PATH=$1 REVISION=$2

In there. I’ve copied this folder into all of my /Library/Subversion/Repositories/project/hooks directories.

It was harder for me to get SVN figured out than it was to get Warehouse up and running. Lots of time on google and countless other people are responsible for all the info above. Hope this saves someone else some time.

 
Avatar BM5k 12 post(s)

Let me know if this works (or doesn’t) for you, I’ve been messing with this off and on for quite a while, and might have forgotten something.

 
Avatar borngraphics 11 post(s)

BM5k,
Let me help you a bit, as I have been through this a few times.
First, don’t edit the 0000_any_80_.conf is the sites directory. Instead create a new directory: /etc/apache2/extra/
In there, make a new conf file like: httpd-subverison.conf. You can just copy the contents of the 0000_any_80_.conf generated for you. Make your changes to the <location> section.

Then edit /etc/apache2/httpd.conf and add to the end of it this:

Include /private/etc/apache2/extra/httpd-subversion.conf

Finaly, from Server Admin, remove the subversion site you setup, or uncheck it to disable it. Now, whenever you make changes to your sites in server admin you will not need to fix the site file again.

 
Avatar BM5k 12 post(s)

Ok, I went ahead and made the changes you recommend, and it seems to be working. Thanks!