Bill Bumgarner

2005-2-17

Configuring Subversion & Apache2 as installed by DarwinPorts

Once you have Subversion & Apache2 installed, the next step is to configure it. I have been through this exercise before -- probably even blogged it. I figured I would document it again with a focus on trying to make the commands copy/paste-able. That, and the next step is try and configure SSL based authentication to the repository.

The first step is to create a Subversion repository and set the ownership:

 sudo mkdir /svn
sudo svnadmin create --fs-type fsfs /svn/master
sudo chown -R www /svn

As I have some scars resulting from corrupt Berkeley DB data stores, I chose to use the filesystem-- fsfs-- based backing store for Subversion.

The next step is to configure Apache2.

 cd /opt/local/apache2/conf/
cp httpd-std.conf httpd.conf

I created a patch file that can be applied to httpd.conf. In order, the chunks of the patch make the following changes:

  • Configures Apache2 to listen on port 8000
  • Loads the dav_svn_module
  • Eliminates the standard document root. When done, the server will only respond to Subversion and icon requests.
  • Adds a <Location /svn> block at the end that configures subversion for the previously configured repository located at /svn/master. Requires an authorized user.

At this point, everything is configured. Now it is time to create a user or two. Note that the 'sudo' below (or above) may prompt for "Password:". Keep track of whether you are entering your password or the new user's password.

 cd /svn/
sudo -u www htpasswd -c master-auth <user>
New password:
Re-type new password:
sudo -u www htpasswd <user2>
New password:
Re-type new password:
/opt/local/apache2/bin/apachectl configtest
Syntax OK
sudo /opt/local/apache2/bin/apachectl restart
httpd not running, trying to start

Also, if you have a user or two that you want to add but don't want to deal with typing their password, have them create an htpasswd file and simply send it to you. The file is of the format "user:hash". Just append the "user:hash" to the end of master-auth and restart apache.

At this point, visiting the URL http://svnhost:8000/svn/ should reveal an empty Subversion repository at revision 0.

Thanks to Adam Swift for the excellent article on setting up Subversion. Helped a lot.

Comment on this post [ so far] ... more like this: [DarwinPorts, Mac OS X, Subversion] ... topic exchange: [DarwinPorts, Mac OS X, Subversion]

multitail -- useful tool for dealing with apache

While configuring apache2 and subversion, I ran across the age old problem of needed to monitor both the access and error logs of apache.

A quick check of darwinports shows two promising entries:

 % port list | grep tail
multitail sysutils/multitail 3.0.6 Tail multiple files in one terminal at once
xtail sysutils/xtail 2.1 like 'tail -f' on a bunch of files at once

Google reveals that multitail would be more useful. Unfortunately, 3.0.6 is way out of date and doesn't build via darwinports (or standalone). xtail works, though. No color which leads to a bit of verbosity, but works fine and is more convenient than backgrounding a couple of tail -f processes.

 % xtail /opt/local/apache2/logs/*log

*** /opt/local/apache2/logs/access_log ***
10.10.10.10 - - [17/Feb/2005:23:41:46 -0800] "GET /foobarbazasdfasdf HTTP/1.1" 403 315

*** /opt/local/apache2/logs/error_log ***
[Thu Feb 17 23:41:46 2005] [error] [client 10.10.10.10] client denied by server
   configuration: /opt/local/apache2/htdocs/foobarbazasdfasdf

*** /opt/local/apache2/logs/access_log ***
10.10.10.10 - bbum [17/Feb/2005:23:41:52 -0800] "GET /svn/ HTTP/1.1" 200 271

Comment on this post [ so far] ... more like this: [DarwinPorts, Mac OS X] ... topic exchange: [DarwinPorts, Mac OS X]

OpenTable.com saves Valentines Day

Not only was Monday Christine's first day at Apple, it was also Valentines Day and my parents are in town so babysitting was simply not an issue.

So, silly me, I'm thinking I can make a reservation for a restaurant in the area , oh, a few days in advance.

HA!

Fortunately, several people coincidentally mentioned OpenTable.com over the weekend and, on Sunday afternoon, I was able to score a reservation to Viaggio in Saratoga.

Very good meal, better company, the day was saved.

In any, case Open Table absolutely rocks. I have no doubt that we will probably use them fairly exclusively to find restaurants in the future.

Comment on this post [ so far] ... more like this: [Life] ... topic exchange: [Life]

Installing Subversion via DarwinPorts

Duncan wrote up some excellent instructions for installing Subversion server with Apache2 & Python bindings. Prior to that installation, you'll need to install DarwinPorts:

 cd ~/
cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od login
cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/Volumes/src/cvs/od co -Pdarwinports
cd ~/darwinports/base
./configure
make
sudo make install

Once installed, you'll need to drop the path to darwinport's bin directory into your shell environment. Pick the right one from the following (or do something equivalent):

 export PATH=$PATH:/opt/local/bin
set path=($path /opt/local/bin)

Next up: Configuring this rather blank slate.

Comment on this post [ so far] ... more like this: [Mac OS X, Subversion] ... topic exchange: [Mac OS X, Subversion]