You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2009/05/15 02:38:15 UTC

[Couchdb Wiki] Update of "Installing on FreeBSD" by TillKlampaeckel

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 TillKlampaeckel:
http://wiki.apache.org/couchdb/Installing_on_FreeBSD

The comment on the change is:
updated port install instructions, linked start script, etc.

------------------------------------------------------------------------------
- = Installing CouchDB on FreeBSD 7.2 =
+ = Installing CouchDB on FreeBSD 6.x and 7.x =
  
+ == Installation from ports ==
  {{{
  cd /usr/ports/databases/couchdb
  make install clean
  }}}
  
- This installed CouchDB 0.9a from the ports collection.
+ This installed CouchDB 0.9.0 from the ports collection.
  
- We then need a couchdb user:
+ == Post install ==
  
+ We then need to setup a couchdb user:
+ 
- I used the "adduser" command to add a user "couchdb" in group "couchdb".
+ 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
+ 
+ The user in {{{/etc/passwd}}} should look similar to the following:
  {{{
- couchdb:*:1002:1002::0:0:CouchDB Daemon User:/nonexistent:/usr/local/bin/bash
+ couchdb:*:1013:1013:Couchdb, time to relax:/var/lib/couchdb/:/usr/sbin/nologin
  }}}
  
+ To change any of these settings, please refrain from editing {{{/etc/passwd}}} and instead use {{{pw user mod ...}}}. Make sure that the user has no shell, but instead uses {{{/usr/sbin/nologin}}}.
- Please consult
- {{{
- man 5 passwd
- }}}
- on the format of this file and the security implications. 
  
- Under FreeBSD one uses the 
+ == start script ==
+ 
+ On FreeBSD, you use the following to start CouchDB:
  {{{
  /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
+ This script provides the options start, stop, status, rcvar etc..
+ 
+ There's currently no start script included in the port, but a work in progress of the maintainer can be downloaded from [http://github.com/till/couchdb-freebsd/blob/20e20e748339b42e1e5ca6e04c9224ad09ea2557/rc-script/couchdb github].
+ 
+ This start script currently supports the following options for {{{/etc/rc.conf}}}/{{{/etc/rc.conf.local}}}:
  {{{
+ couchdb_enable="NO"
+ couchdb_enablelogs="YES"
+ couchdb_user="couchdb"
+ }}}
+ (Defaults shown.)
+ 
+ The start script will also use settings from the following config files:
+ {{{
+ /usr/local/etc/couchdb/default.ini
- /usr/local/etc/couchdb/couch.ini
+ /usr/local/etc/couchdb/local.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,
+ su login /usr/local/bin/couchdb -b -c ... -p /var/run/couchdb.pid -o ... -e ... -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
@@ -57, +72 @@

  }}} 
  should allow you to look at "http://localhost:5984" and see this JSON doc:
  {{{
- {"couchdb":"Welcome","version":"0.9.0a-incubating"}
+ {"couchdb":"Welcome","version":"0.9.0"}
  }}}
  Then you should try "http://localhost:5984/_utils/" to see the "futon" web interface,
  
@@ -69, +84 @@

  
  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. 
+ = Current TODO =
  
- What next?
+  * Change /var/lib/couchdb/ to /var/db/couchdb/
+  * Create /var/log/couchdb/
+  * Create a couchdb user with port install
  
- 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. And it should be enhanced for the rc.conf mechanism ("couchdb_enable=YES|NO"). 
+ = Questions? =
  
- -- MarcVanWoerkom [[DateTime(2009-05-13T00:30:19Z)]]
+ Please check out the github repository, or email TillKlampaeckel.
  
- = Old instructions =
- 
- If your are installed ports subsystem:
- {{{
- cd /usr/ports/databases/couchdb
- make install
- }}}
- 
- Make sure, you have a recent ports tree because until late summer 2008 FreeBSD came with an acient couchdb-0.7. Usually the following commands should be enough to update the relevant ports:
- 
- {{{
- portsnap fetch
- portsnap extract databases/couchdb
- portsnap extract lang/spidermonkey
- portsnap extract devel/icu
- portsnap extract lang/erlang
- }}}
-