From ArchWiki
Revision as of 20:04, 27 January 2012 by Action owl (talk | contribs) (Configuring: Added note about running couch on port 80)
Jump to: navigation, search

"Apache CouchDB is a document-oriented database that can be queried and indexed in a MapReduce fashion using JavaScript." - CouchDB homepage


Install the Template:Package Official package:

# pacman -S couchdb


Start Couch

# rc.d start couchdb

To launch on startup add it to your DAEMONS array in rc.conf:

DAEMONS=(syslog-ng network netfs crond sshd httpd couchdb)

Using Futon

You can now access the Futon admin interface by going to http://localhost:5984/_utils


Change the default port, bind address, log-level and other useful nuggets in Template:Filename. Note that if you want to run CouchDB on port 80 you will have to run the daemon as root.

Note: Do not modify Template:Filename as it gets overwritten whenever couchdb is updated, copy any values you would like to change and put them in your local.ini. Also be sure to restart couchdb after changes to this file.

If you would like to use ssl with a self-signed certificate you can create one like this:

 # cd /etc/couchdb
 # openssl genrsa -des3 -out server.key 1024
 # openssl req -new -key server.key -out server.csr
 # cp server.key
 # openssl rsa -in -out server.key
 # openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

Then uncomment httpsd and update the path in the [ssl] section

 httpsd = {couch_httpd, start_link, [https]}
 cert_file = /etc/couchdb/server.crt
 key_file = /etc/couchdb/server.key

Futon can be accessed over ssl on port 6984 via https://localhost:6984/_utils/

Admin users can be created in your Template:Filename file. Add the username and password in plaintext, next time couch is restarted it will hash the password. See create a read-only database for locking down databases and further security.

 admin = magicalunicorns

More Resources