Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 15335 invoked from network); 15 May 2009 00:38:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 May 2009 00:38:49 -0000 Received: (qmail 29981 invoked by uid 500); 15 May 2009 00:38:49 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 29903 invoked by uid 500); 15 May 2009 00:38:48 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 29894 invoked by uid 500); 15 May 2009 00:38:48 -0000 Delivered-To: apmail-incubator-couchdb-commits@incubator.apache.org Received: (qmail 29891 invoked by uid 99); 15 May 2009 00:38:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2009 00:38:48 +0000 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2009 00:38:36 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id B899D118BE for ; Fri, 15 May 2009 00:38:15 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: couchdb-commits@incubator.apache.org Date: Fri, 15 May 2009 00:38:15 -0000 Message-ID: <20090515003815.1181.46503@eos.apache.org> Subject: [Couchdb Wiki] Update of "Installing on FreeBSD" by TillKlampaeckel X-Virus-Checked: Checked by ClamAV on apache.org 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 - }}} -