dboettger's Blog

Archive for the ‘Couchdb’ Category

Last year on the PHP Conference in Mainz it was the first time i heard about couchdb. I was quite impressed, but had no use case for this database. In the near future i will need to improve our document handling in the applications. So i want to work with couchdb to improve versioning and searching.

You can find more information about couchdb on http://couchdb.apache.org.

As anybody know, the first step is to install the couchdb on the local system. As i am a apple follower ;-). I looked for a guide to install it on snow leopard.

Original information from http://blog.deadinkvinyl.com/2008/07/12/couchdb-on-macosx-leopard/

I did some corrections for the copy and paste guys like me ;-). But the original post has much more information about the single steps.

# Install needed packages via macports
sudo port install icu erlang spidermonkey

# Download the latest couchdb file
tar xvzf apache-couchdb-0.10.0.tar.gz

sudo make install

# Show all used userId’s
dscl . -list /Users UniqueID | awk ‘{print $2}’ | sort -n

# Show all used groupId’s
dscl . -list /Groups PrimaryGroupID | awk ‘{print $2}’ | sort -n

# We use groupid and userid 103 for the couchdbuser
sudo dseditgroup -o create -i 103 -r “CouchDB Users” couchdb
sudo dscl . -create /Users/couchdb
sudo dscl . -create /Users/couchdb UniqueID 103
sudo dscl . -create /Users/couchdb UserShell /bin/bash
sudo dscl . -create /Users/couchdb RealName “CouchDB Administrator”
sudo dscl . -create /Users/couchdb NFSHomeDirectory \
sudo dscl . -create /Users/couchdb PrimaryGroupID 103
sudo dscl . -create /Users/couchdb Password *

sudo chown -R couchdb:couchdb /usr/local/var/lib/couchdb
sudo chown -R couchdb:couchdb /usr/local/var/log/couchdb

# Startup couchdb

sudo -u couchdb couchdb

Create a copy of the plist file and edit it.

cp /usr/local/Library/LaunchDaemons/org.apache.couchdb.plist \
open /var/tmp/org.apache.couchdb.plist

1. Open Root → EnvironmentVariables
2. Click on Add Child
3. Name: PATH
4. Value: /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin
5. File → Save
6. Quit Property List Editor

sudo cp /var/tmp/org.apache.couchdb.plist \

# To control the database, simply execute
sudo launchctl load \
# to start
# or
sudo launchctl unload \
# to stop the database

# Automatically launch
sudo ln -s /usr/local/Library/LaunchDaemons/org.apache.couchdb.plist \