Quispiam

power computing

So I am starting a new application called InBrief, it is a CMS for the Bar Association’s daily news. The old one was written 6 years ago and utilised PHP, Rico (1.12) and MySQL.  I wan’t to funk things up a bit so I am going to re do it in node, express, jade, jQuery and Couch. Yay !

So I go about the regular business of installing couchdb using MacPorts.

Then after a while I get the familiar

---> Activating couchdb @1.1.1_0
########################################################################
# Run the following command to install the CouchDB launchd
# startup item in order to start and re-start service automatically:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.apache.couchdb.plist
########################################################################
---> Cleaning couchdbsudo port install couchdb

And I start up couch:

sudo launchctl load -w /Library/LaunchDaemons/org.apache.couchdb.plist

Sweet, now lets get to futon, so I point my trusty browser to localhost:5984 and receive the following:

Couch 404 FAIL

This sucks, now I’m going to have to find out where it’s breaking.  Luckily like all good *nix products Couch/Erlang does logging.  Opening up the /opt/local/var/log/couchdb/couch.log file yielded nothing except it seems to be looking at two ini files /opt/local/etc/couchdb/default.ini & /opt/local/etc/couchdb/local.ini.

On opening the default.ini file I noticed that there are a heap of files under the [couchdb] heading.  I ran through and checked them all for existance and noticed that the following file and directories didn’t exist

uri_file = /opt/local/var/run/couchdb/couch.uri

Because it doesn’t exist I should create it…

mkdir /opt/local/var/run
mkdir /opt/local/var/run/couchdb/

And give ownership to couchdb

sudo chown -R couchdb:couchdb /opt/local/var/run/couchdb

Now running  

sudo launchctl load -w /Library/LaunchDaemons/org.apache.couchdb.plist

and turning my browser toward localhost:5984 gave me the expected result.

 

Couch FTW

 

TaDah !

 

Thanks go to CouchDB and MacPorts

matt.

Share