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 2008/08/31 21:03:38 UTC

[Couchdb Wiki] Update of "Contributing" by ChrisAnderson

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

The comment on the change is:
updated Running From Source for runtimeconfig

------------------------------------------------------------------------------
  
  From the checkout directory, first perform the `./bootstrap`, `./configure`, and `make` steps so that everything gets built properly.
  
- Then create a configuration file that you'll use for running CouchDB directly from the source directory. We'll call it `couch_dev.ini` and drop it directly into the checkout directory, with the following content:
+ Then create a configuration file that you'll use for running CouchDB directly from the source directory. We'll call it `couch_dev.ini` and drop it directly into the checkout directory, with the following content: (Note that we have CouchDB running on port 5985, so that it doesn't conflict with any existing running instance on the standard port.)
  
  {{{
- [Couch]
+ [CouchDB]
- DbRootDir=/tmp/couchdb/dbroot
- Port=5984
+ 
+ RootDirectory=.
+ UtilDriverDir=./src/couchdb/.libs/
+ AllowRemoteRestart=true
+ 
+ [HTTPd]
+ 
+ DocumentRoot=./share/www
  BindAddress=127.0.0.1
+ Port=5985
- DocumentRoot=share/www
- LogFile=/tmp/couchdb/couch.log
- UtilDriverDir=src/couchdb/.libs
- LogLevel=debug
  
+ [Log]
+ Level=debug
+ 
- [Couch Query Servers]
+ [CouchDB Query Servers]
- javascript=src/couchdb/couchjs share/server/main.js
+ javascript=./bin/couchjs ./share/server/main.js
+ 
  }}}
  
  Note that we use relative paths for anything that's in the checkout (such as the static resources and the Javascript view server). For the database directory and the log file, we're using a temporary path here, but it could really be anything you'd like.
  
- Now you can fire up an Erlang shell as follows. Do this from the top of the checkout directory so that the relative paths we put in the configuration file work correctly.
+ Now you can fire up CouchDB as follows. Do this from the top of the checkout directory so that the relative paths we put in the configuration file work correctly.
  
  {{{
- erl -pa src/couchdb src/mochiweb -couchini couch_dev.ini
+ ./bin/couchdb -c couch_dev.ini
  }}}
  
- Here we're adding the source directories `src/couchdb` and `src/mochiweb` to the Erlang code search path, and we're telling CouchDB to look for the configuration file we created earlier by using the `-couchini` option.
+ Note the runtime configurations will be written to the last file specified after a `-c` directive, so if you'd like to write changes back to an ini file, append something like `-c local_dev.ini` to the above command line.
  
- Now you can run all the CouchDB (and MochiWeb) code from the interactive shell, but you probably want to actually start CouchDB first:
+ When CouchDB starts, you should see:
  
  {{{
- Erlang (BEAM) emulator version 5.6.2 [source] [smp:2] [async-threads:0] [kernel-poll:false]
- 
- Eshell V5.6.2  (abort with ^G)
- 1> couch_server:dev_start().
- Apache CouchDB 0.0.0 (LogLevel=debug)
- Apache CouchDB is starting.
- 
+ Apache CouchDB 0.9.0a-incubating (LogLevel=debug) is starting.
+ Configuration Settings ["couch_dev.ini"]:
+   [CouchDB] AllowRemoteRestart="true"
+   [CouchDB] RootDirectory="."
+   [CouchDB] UtilDriverDir="./src/couchdb/.libs/"
+   [CouchDB Query Servers] javascript="./bin/couchjs ./share/server/main.js"
+   [HTTPd] BindAddress="127.0.0.1"
+   [HTTPd] DocumentRoot="./share/www"
+   [HTTPd] Port="5985"
+   [Log] Level="debug"
  Apache CouchDB has started. Time to relax.
- [debug] [<0.30.0>] Config Info /home/johnny/src/couchdb/trunk/couch_dev.ini:
-         CurrentWorkingDir=/home/johnny/src/couchdb/trunk
-         DbRootDir=/tmp/couchdb/dbroot
-         BindAddress="127.0.0.1"
-         Port="5984"
-         DocumentRoot=share/www
-         LogFile=/tmp/couchdb/couch.log
-         UtilDriverDir=src/couchdb/.libs
-         DbUpdateNotificationProcesses=
-         FullTextSearchQueryServer=
-         javascript=src/couchdb/couchjs share/server/main.js
- 
- {ok,<0.51.0>}
- 2> 
  }}}
  
- CouchDB should now be running and you can try accessing the HTTP interface by visiting http://127.0.0.1:5984/.
+ CouchDB should now be running and you can try accessing the HTTP interface by visiting http://127.0.0.1:5985/.
  
- To recompile an Erlang source file while CouchDB is running do `c(module_name)`. So to recompile the `couch_server` module with `c(couch_server)`.
- 
- To end the session and exit the shell, stop CouchDB and use the `q()` function:
- 
- {{{
- 2> couch_server:stop().
- 3> q().
- ok
- 4> 
- }}}
-