Moved to merjis/tools/wiki.
[cocanwiki.git] / README
1 README for COCANWIKI
2 --------------------
3
4 This is a Wiki, written in Objective CAML by Richard W.M. Jones
5 (rich@merjis.com).
6
7 It is licensed to you under the GNU General Public License (GNU GPL).
8 Please see the file COPYING in this directory for full details.
9
10 Requirements
11 ------------
12
13 * Apache (probably Apache version 1.3, unless you want to build your
14   own version of Apache 2.0 which doesn't include PCRE).
15
16 * Objective CAML 3.07 or above.
17
18 * PCRE library for OCaml.
19
20 * ExtLib for OCaml.
21   http://ocaml-lib.sourceforge.net/
22
23 * mod_caml and DBI libraries for OCaml.
24   http://www.merjis.com/developers/mod_caml/
25
26 * PostgreSQL database 7.3 or above.
27
28 * Postgres bindings for OCaml.
29   http://www.eleves.ens.fr/home/frisch/soft#postgres
30   (Markus Mottl's later version, renamed PostgreSQL, will probably work, but
31   you may need to modify a little bit of the code in scripts/cocanwiki.ml so
32   it connects to the right database using the right driver).
33
34 Installation
35 ------------
36
37 First install all of the above requirements, and check that they're
38 working.
39
40 Type 'make all install' (you don't need to be root).
41
42 Then create a UNICODE database called 'cocanwiki' and load the schema
43 from 'cocanwiki.sql'.
44
45 Create a Wiki site by hand in the database:
46
47   begin work;
48   set constraints "hosts_hostname_cn" deferred;
49   insert into hosts (canonical_hostname) values ('test.cocan.org');
50   -- HOSTID is the value of hosts.id, normally 1
51   insert into hostnames (hostid, name) values (HOSTID, 'test.cocan.org');
52   commit work;
53
54 Create an index page by hand in the database:
55
56   insert into pages (hostid, url, title, description) values (HOSTID, 'index',
57     'Index Page', 'Index Page');
58
59 Modify your Apache configuration, adding:
60
61   CamlLoad ...path/to/html/_bin/cocanwiki.cma
62
63   <VirtualHost test.cocan.org>
64         ServerAdmin you@example.com
65         DocumentRoot ...path/to/html
66         ServerName test.cocan.org
67         Include ....path/to/conf/cocanwiki.conf
68   </VirtualHost>
69
70 (Change 'test.cocan.org' to a suitable local server name, and set the
71 paths as appropriate).
72
73 Set any necessary environment variables and start up the server:
74
75   export COCANWIKI_TEMPLATES=...path/to/templates
76   # The following is not required if the database is running locally:
77   export PGHOST=hostname.of.database
78   # Replace this with however you would normally start your webserver:
79   /usr/bin/apache
80
81 Try connecting to the local server using your browser.  If it doesn't
82 work, look in the Apache error_log file.
83
84 More notes on setting environment variables
85 -------------------------------------------
86
87 You CANNOT use SetEnv to set COCANWIKI_TEMPLATES and/or PGHOST.  This
88 is because SetEnv runs too late in the Apache handler cycle for it to
89 be picked up by the scripts.
90
91 On Debian you must modify /etc/init.d/apache in order to set up
92 environment variables.  On the line which reads:
93
94 ENV="env -i ...."
95
96 remove the -i option from env (Debian bug #252627, marked as WONTFIX).
97
98 Directory layout
99 ----------------
100
101   html/
102
103     Everything visible under the webserver root.
104
105   conf/
106
107     Configuration fragment for Apache.
108
109   scripts/
110
111     CGI scripts.
112
113   templates/
114
115     Templates used by the CGI scripts.