Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.
The following page has been changed by MarcVanWoerkom: http://wiki.apache.org/couchdb/Installing_on_FreeBSD ------------------------------------------------------------------------------ + = Installation on FreeBSD 7.2 = + + {{{ + cd /usr/ports/databases/couchdb + make install clean + }}} + + This installed CouchDB 0.9a from the ports collection. + + We then need a couchdb user: + + I used the "adduser" command to add a user "couchdb" in group "couchdb". + However this is a bit too much, as we want a daemon user with no login shell etc. + I finally used "vipw" to change the line added by adduser to + {{{ + couchdb:*:1002:1002::0:0:CouchDB Daemon User:/nonexistent:/usr/local/bin/bash + }}} + + Please consult + {{{ + man 5 passwd + }}} + on the format of this file and the security implications. + + Under FreeBSD one uses the + {{{ + /usr/local/etc/rc.d/couchdb + }}} + script to start and stop CouchDB. Try it with no argument or "status" and of course "start" and "stop". + + It will use settings from the config file + {{{ + /usr/local/etc/couchdb/couch.ini + }}} + + Upon the "start" command that script will issue a command like + {{{ + su login /usr/local/bin/couchdb -b -c /usr/local/etc/couchdb/couch.ini -p /var/run/couchdb.pid -o /dev/null -e /dev/null -r 5, + }}} + This "su login .." is the reason why I kept the shell entry (last field) in the passwd config file otherwise it won't work. This is obviously not the FreeBSD way for daemon processes, which should end up with a "/usr/sbin/nologin" there. + + The logfile is configured to be written to + {{{ + /var/log/couchdb/couch.log + }}} + For this to work I used a + {{{ + chown couchdb:couchdb /var/log/couchdb + }}} + command to have the couchdb process own the directory which allows it to write couch.log there. Again I am not happy with this solution. The other directories are "root:wheel" or "root:network". And I expected "/usr/local/var.." as location. + + Starting CouchDB with + {{{ + /usr/local/etc/rc.d/couchdb start + }}} + should allow you to look at "http://localhost:5984" and see this JSON doc: + {{{ + {"couchdb":"Welcome","version":"0.9.0a-incubating"} + }}} + Then you should try "http://localhost:5984/_utils/" to see the "futon" web inteface, + + I tried creating a database "db1" there and got an error. The solution was to + {{{ + chown couchdb:couchdb /var/lib/couchdb + }}} + and yes, this does not really feel FreeBSD style. And indeed "/usr/local/var/couchdb" might be more appropriate too. :-) + + Anyway, after this futon did report OK and I found a /var/lib/couchdb/db1.couch data file. + + This should be enough to start hacking couchdb. + + To improve the port I would start having a look at the Apache Tomcat port, as far as I remember it honored the FreeBSD conventions and might give some hints on how to change the "/usr/local/etc/rc.d/couchdb" script to make it a compliant daemon user. + + -- MarcVanWoerkom [[DateTime(2009-05-13T00:30:19Z)]] + + = Old instructions = + If your are installed ports subsystem: {{{ cd /usr/ports/databases/couchdb
