couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "InstallingOnWindows" by NoahSlater
Date Fri, 20 Jun 2008 14:18:00 GMT
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 NoahSlater:
http://wiki.apache.org/couchdb/InstallingOnWindows

The comment on the change is:
`bin

------------------------------------------------------------------------------
- = Install Apache CouchDB on Windows =
+ CouchDB does not natively install on Windows but it is possible install it by hand.
  
- By zhengji.li@t3gt.com
+ Please update this guide as needed, we aim to collect feedback and roll the procedure into
the official build.
  
- Configuration file, installation scripts for setup CouchDB on Unix/Linux or
- alike OS are already there, which makes it totally automatic. But what for
- Windows? Nothing!
  
- "But I DO want to enjoy CouchDB on Windows." Easy. Time to Relax.
+ == Dependancies ==
  
- Note: Below only CouchDB 0.8.0-incubating is covered.
+ You will need the following software installed on your system:
  
- == Step 0. Required Tools ==
-    * Erlang/OTP
-    * Win32 Compiler/Linker (such as Visual C++, required for step 2/3)
-    * make tool (such as nmake from MS, optional for step 2/3)
+   * [http://www.erlang.org/download.html Erlang/OTP]
+   * C Compiler/Linker (such as [http://gcc.gnu.org/ GCC] or [http://msdn.microsoft.com/en-us/visualc/default.aspx
Visual C++])
+   * Make (such as [http://www.gnu.org/software/make/ GNU Make] or [http://msdn.microsoft.com/en-us/library/dd9y37ha(VS.71).aspx
nmake])
+   * [http://www.openssl.org/ OpenSSL]
+   * [http://www.icu-project.org/ ICU]
+   * [http://www.mozilla.org/js/spidermonkey/ SpiderMonkey]
  
+ == Base Installation ==
- To make things FREE, we can use GNU GCC, GNU gmake, but I have not tested
- yet.
  
- == Step 1. Prepare ICU/OpenSSL ==
+ After installing Erlang and you should having something similar to:
  
- Before move to step 2, downloading the latest ICU4C and OpenSSL from
- following sites respectively.
+ {{{
+ C:\Program Files\erl5.6.3
+ }}}
  
+ Copy the whole CouchDB source tree to:
- http://www.icu-project.org
- http://www.openssl.org
  
- == Step 2. Prepare JS Engine ==
+ {{{
+ C:\Program Files\erl5.6.3\lib\couchdb-0.8.0
+ }}}
  
+ Make the following empty directory:
- CouchDB can use multiple scripts to "map" a function onto documents in a
- database. For now, a JavaScript engine is required.
  
+ {{{
+ C:\Program Files\erl5.6.3\lib\mochiweb-0.01\ebin
+ }}}
- Theoretically, any JavaScript engine can be used by CouchDB if it can be
- bridged into Erlang. But there are not many engines available all over the
- world. If you have one, and it can be used as a "port" by Erlang, then this
- step is already done to you. If you do not have, which is more likely to
- happen, please download Mozilla SpiderMonkey engine's source code under
- MPL/GPL/LGPL tri-license from the URL below, and build it following the
- instructions, besides its shell. By doing this, we get js32.dll and
- jsshell.exe.
  
- http://developer.mozilla.org/en/docs/SpiderMonkey_Build_Documentation
+ From ICU copy `icu*.dll` and `libeay32.dll` to:
  
- Note: couch_js.c in CouchDB is actually another shell for SpiderMonkey JS
- engine. It's up to you to choose the default shell or this one.
+ {{{
+ C:\Program Files\erl5.6.3\erts-5.6.2\bin
+ }}}
  
+ From !SpiderMonkey copy `js32.dll` and `jsshell.exe` to:
- To make description easier, let's assume:
-    * Erlang/OTP is installed in:   E:\Program Files\erl5.6.3
-    * CouchDB is extracted into:    E:\Program Files\erl5.6.3\lib\couchdb-0.8.0
-    * Create directory:             E:\Program Files\erl5.6.3\lib\mochiweb-0.01\ebin
  
- == Step 3. Build couch_erl_driver ==
+ {{{
+ C:\Program Files\erl5.6.3\erts-5.6.2\bin
+ }}}
  
- From now on, we will go into CouchDB's source code.
  
+ == C Compilation ==
- couch_erl_driver.c is a link-in port for Erlang, providing ICU features to
- CouchDB. The simplest way to build this DLL is to create a Win32 DLL
- project in an IDE, add couch_erl_driver.c into the project, and change
- project settings to include Erlang ERTS' and ICU4C's header file path.
  
- Rename the DLL to couch_erl_driver.dll if you like.
+ === couchdb/couch_erl_driver.c ===
  
- == Step 4. Build CouchDB & HTTP Server ==
+ This is a wrapper to provide ICU features to CouchDB.
  
- Create a file named "Emakefile" in E:\Program Files\erl5.6.3\lib\couchdb-0.8.0\src. Its
content is:
+ The simplest way to build a DLL is to create a Win32 DLL project in an IDE, add `couch_erl_driver.c`
into the project, and change project settings to include the Erlang ERTS and ICU4C header
paths.
+ 
+ Make the following empty directory:
+ 
+ {{{
+ C:\Program Files\erl5.6.3\lib\couchdb-0.8.0\priv
+ }}}
+ 
+ Copy the DDL to:
+ 
+ {{{
+ C:\Program Files\erl5.6.3\lib\couchdb-0.8.0\priv\couch_erl_driver.dll
+ }}}
+ 
+ === couchdb/couch_js.c ===
+ 
+ This is a wrapper to provide UTF-8 and buffering improvements to !SpiderMonkey.
+ 
+ @@ It is currently unknown how to build this on Windows.
+ 
+ For now, you can use !SpiderMonkey's `jsshell.exe` as the !JavaScript View Server.
+ 
+ == Erlang Compilation ==
+ 
+ Create a the following file:
+ 
+ {{{
+ C:\Program Files\erl5.6.3\lib\couchdb-0.8.0\src\Emakefile
+ }}}
+ 
+ Add the following content:
  
  {{{
  {'./couchdb/*', [{outdir,"../ebin"}]}.
  {'./mochiweb/*', [{outdir,"../../mochiweb-0.01/ebin"}]}.
  }}}
  
- Open erl (or werl), type following command to change directory:
+ Launch `erl` (or `werl`) and execute the following command to change working directory:
  
  {{{
- cd("E:/Program Files/erl5.6.3/lib/couchdb-0.8.0/src").
+ cd("C:/Program Files/erl5.6.3/lib/couchdb-0.8.0/src").
  }}}
- Then type this simple command to make CouchDB.
+ 
+ Execute this command to compile CouchDB:
  
  {{{
  make:all().
  }}}
  
- == Step 5. Configure CouchDB ==
+ == Configuring ==
  
- In "E:\Program Files\erl5.6.3\lib\couchdb-0.8.0\etc\couchdb", you can see couch.ini.tpl.in.
Based on this template, let's create couch.ini in E:\Program Files\erl5.6.3\bin.
+ Copy the following file:
  
  {{{
- ; couch.ini
+ C:\Program Files\erl5.6.3\lib\couchdb-0.8.0\etc\couchdb\couch.ini.tpl.in
+ }}}
  
+ To this location:
+ 
+ {{{
+ C:/Program Files/erl5.6.3/bin/couch.ini
+ }}}
+ 
+ Edit the file to look something like this:
+ 
+ {{{
  [Couch]
  
- ; A welcome string
  ConsoleStartupMsg=Apache CouchDB is starting.
  
+ DbRootDir=C:/Path/To/Database/Directory
- ; Where do you want CouchDB to save databases?
- ; You can config this freely
- DbRootDir= ... this is a secret directory ...
  
- ; CouchDB's HTTP server
  Port=5984
+ 
  BindAddress=127.0.0.1
- DocumentRoot=E:\Program Files\erl5.6.3\lib\couchdb-0.8.0\share\www
  
+ DocumentRoot=C:/Program Files/erl5.6.3/lib/couchdb-0.8.0/share/www
- ; Where do you want CouchDB to log?
- ; You can config this freely, too.
- LogFile= ... this is a secret file ...
  
+ LogFile=C:/Path/To/Log/Directory
- ; So, where is couch_erl_driver.dll?
- UtilDriverDir=E:/Program Files/erl5.6.3/lib/couchdb-0.8.0/priv
  
- ; Which level of log do you need, info, debug, or something else?
+ UtilDriverDir=C:/Program Files/erl5.6.3/lib/couchdb-0.8.0/priv/couch_erl_driver.dll
+ 
  LogLevel=info
  
  [Couch Query Servers]
  
+ ; this should be on one line
- ; This is the JS engine
- ; jsshell is the default shell for SpiderMonkey JS engine provided in its
- source code.
- ; Special note: DO NOT try to include a path for jsshell.
- javascript=jsshell -f "E:/Program Files/erl5.6.3/lib/couchdb-0.8.0/share/server/main.js"
+ javascript=jsshell -f "C:/Program Files/erl5.6.3/lib/couchdb-0.8.0/share/server/main.js"
  }}}
  
- == Step 6. Get Ready to Relax ==
+ Make sure that the `DbRootDir` exists and that the `LogFile` can be created.
  
+ == Running ==
- Have you finished downloading ICU4C and OpenSSL? If not, sorry, you have to
- wait.
  
+ Launch `erl` (or `werl`) and execute the following command:
- Install ICU4C and OpenSSL, if not:
-    * Copy icu*.dll to E:\Program Files\erl5.6.3\erts-5.6.2\bin
-    * Copy libeay32.dll E:\Program Files\erl5.6.3\erts-5.6.2\bin
  
- Then,
-    * Copy js32.dll and jsshell.exe to E:\Program Files\erl5.6.3\erts-5.6.2\bin
-    * Copy couch_erl_driver.dll to E:/Program Files/erl5.6.3/lib/couchdb-0.8.0/priv
+ {{{
+ couch_server:start().
+ }}}
  
- Finally, ensure that DbRootDir exists and LogFile can be created.
+ To check that everything has worked point your web browser to
+ [http://localhost:5984/_utils/index.html] and run the test suite.
  
- == Step 7. Time to Relax ==
- 
- Open a new erl. Type:
- 
- couch_server:start().
- 
- Open http://localhost:5984, and time to relax.
- 
- == Step 8. Time to Fix ==
- 
- Open http://localhost:5984/_utils/, and try to create a database, then
- create some documents and enjoy.
- 
- If not so lucky, database's name is displayed wrongly. We need to fix it.
- Open couch_server.erl, let's try to fix all_databases() function.
- 
- No, let's leave it as homework.
- 
- After the homework is done, make:all() again and time to enjoy!
- 

Mime
View raw message