Skip to content

Instantly share code, notes, and snippets.

@craigminihan
Last active February 7, 2017 11:28
Show Gist options
  • Save craigminihan/389e5ff6c4d945c2e4698c756528ed55 to your computer and use it in GitHub Desktop.
Save craigminihan/389e5ff6c4d945c2e4698c756528ed55 to your computer and use it in GitHub Desktop.
Build CouchDB 2.0 on FreeBSD 11
# install bash (optional)
# pkg install bash
# run as root
pkg install erlang-19.2_1,3 spidermonkey185 icu-58.2,1 gmake curl wget
# run as a user
wget http://www.mirrorservice.org/sites/ftp.apache.org/couchdb/source/2.0.0/apache-couchdb-2.0.0.tar.gz
tar xf apache-couchdb-2.0.0.tar.gz
cd apache-couchdb-2.0.0
./configure
gmake release
# run as root (ideally under bash or sh)
PREFIX="/usr/local"
COUCHDB_ROOT="${PREFIX}/couchdb"
pw useradd -n couchdb
cp -R rel/couchdb ${PREFIX}
mkdir -p "${COUCHDB_ROOT}/var/lib/couchdb"
chown -R couchdb:couchdb "${COUCHDB_ROOT}/etc"
chown -R couchdb:couchdb "${COUCHDB_ROOT}/var"
printf "\n[couchdb]\ndatabase_dir = ${COUCHDB_ROOT}/var/lib/couchdb\nview_index_dir = ${COUCHDB_ROOT}/var/lib/couchdb\n" >> "${COUCHDB_ROOT}/etc/local.ini"
printf "\n[chttpd]\nbind_address = 0.0.0.0\n" >> "${COUCHDB_ROOT}/etc/local.ini"
printf "\n[httpd]\nbind_address = 0.0.0.0\n" >> "${COUCHDB_ROOT}/etc/local.ini"
printf "\n[cluster]\nn = 1\n" >> "${COUCHDB_ROOT}/etc/local.ini"
printf "\n[log]\nwriter = file\nfile= ${COUCHDB_ROOT}/var/log/couch.log" >> "${COUCHDB_ROOT}/etc/local.ini"
# run couchdb as the couchdb user, then configure your node or cluster using the Fauxton UI
su -m couchdb -c "nohup \"${COUCHDB_ROOT}/bin/couchdb\" &"
tail -f "${COUCHDB_ROOT}/var/log/couch.log"
@craigminihan
Copy link
Author

craigminihan commented Feb 6, 2017

Simple build steps for CouchDB 2.0 on FreeBSD 11 since ports don't include 2.0 yet. Run under sh or bash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment