1 .. -*- coding: utf-8 -*- |
|
2 |
|
3 .. _CubicWebInstallation: |
|
4 |
|
5 Installation |
|
6 ============ |
|
7 |
|
8 Installation of `Cubicweb` and its dependencies |
|
9 ----------------------------------------------- |
|
10 |
|
11 `CubicWeb` is packaged for Debian and Ubuntu, but can be installed from source |
|
12 using a tarball or the Mercurial version control system. |
|
13 |
|
14 Debian and Ubuntu packages |
|
15 ``````````````````````````` |
|
16 Depending on the distribution you are using, add the appropriate line to your list |
|
17 of sources (for example by editing ``/etc/apt/sources.list``). |
|
18 |
|
19 For Debian Lenny:: |
|
20 |
|
21 deb http://ftp.logilab.org/dists/ lenny/ |
|
22 |
|
23 For Debian Sid:: |
|
24 |
|
25 deb http://ftp.logilab.org/dists/ sid/ |
|
26 |
|
27 For Ubuntu Hardy:: |
|
28 |
|
29 deb http://ftp.logilab.org/dists/ hardy/ |
|
30 |
|
31 |
|
32 You can now install the required packages with the following command:: |
|
33 |
|
34 apt-get update |
|
35 apt-get install cubicweb |
|
36 apt-get install cubicweb-dev |
|
37 |
|
38 `cubicweb` installs the framework itself, allowing you to create |
|
39 new applications. |
|
40 |
|
41 `cubicweb-dev` installs the development environment allowing you to |
|
42 develop new cubes. |
|
43 |
|
44 There is also a wide variety of cubes listed on http://www.cubicweb.org/Project available as debian packages and tarball. |
|
45 |
|
46 |
|
47 Install from source |
|
48 ``````````````````` |
|
49 |
|
50 You can download the archive containing the sources from our `ftp site`_ at:: |
|
51 |
|
52 http://ftp.logilab.org/pub/cubicweb/ |
|
53 |
|
54 .. _`ftp site`: http://ftp.logilab.org/pub/cubicweb/ |
|
55 |
|
56 or keep up to date with on-going development by using Mercurial and its forest |
|
57 extension:: |
|
58 |
|
59 hg fclone http://www.logilab.org/hg/forests/cubicweb |
|
60 |
|
61 See :ref:`MercurialPresentation` for more details about Mercurial. |
|
62 |
|
63 Postgres installation |
|
64 ````````````````````` |
|
65 |
|
66 Please refer to the `Postgresql project online documentation`_. |
|
67 |
|
68 .. _`Postgresql project online documentation`: http://www.postgresql.org/ |
|
69 |
|
70 You need to install the three following packages: `postgres-8.3`, |
|
71 `postgres-contrib-8.3` and `postgresql-plpython-8.3`. |
|
72 |
|
73 |
|
74 Then you can install: |
|
75 |
|
76 * `pyro` if you wish the repository to be accessible through Pyro |
|
77 or if the client and the server are not running on the same machine |
|
78 (in which case the packages will have to be installed on both |
|
79 machines) |
|
80 |
|
81 * `python-ldap` if you plan to use a LDAP source on the server |
|
82 |
|
83 .. _ConfigurationEnv: |
|
84 |
|
85 Environment configuration |
|
86 ------------------------- |
|
87 |
|
88 If you installed `CubicWeb` by cloning the Mercurial forest, then you |
|
89 will need to update the environment variable PYTHONPATH by adding |
|
90 the path to the forest ``cubicweb``: |
|
91 |
|
92 Add the following lines to either `.bashrc` or `.bash_profile` to configure |
|
93 your development environment :: |
|
94 |
|
95 export PYTHONPATH=/full/path/to/cubicweb-forest |
|
96 |
|
97 If you installed the debian packages, no configuration is required. |
|
98 Your new cubes will be placed in `/usr/share/cubicweb/cubes` and |
|
99 your applications will be placed in `/etc/cubicweb.d`. |
|
100 |
|
101 To use others directories then you will have to configure the |
|
102 following environment variables as follows:: |
|
103 |
|
104 export CW_CUBES_PATH=~/lib/cubes |
|
105 export CW_REGISTRY=~/etc/cubicweb.d/ |
|
106 export CW_INSTANCE_DATA=$CW_REGISTRY |
|
107 export CW_RUNTIME=/tmp |
|
108 |
|
109 .. note:: |
|
110 The values given above are our suggestions but of course |
|
111 can be different. |
|
112 |
|
113 .. _ConfigurationPostgres: |
|
114 |
|
115 Postgres configuration |
|
116 ---------------------- |
|
117 |
|
118 .. note:: |
|
119 If you already have an existing cluster and postgres server |
|
120 running, you do not require to execute the initilization step |
|
121 of your Postgres database. |
|
122 |
|
123 * First you have to initialize the database Postgres with the command ``initdb``. |
|
124 :: |
|
125 |
|
126 $ initdb -D /path/to/pgsql |
|
127 |
|
128 Once initialized, you can launch the database server Postgres |
|
129 with the command:: |
|
130 |
|
131 $ postgres -D /path/to/psql |
|
132 |
|
133 If you cannot execute this command due to permission issues, please |
|
134 make sure that your username has write access on the database. |
|
135 :: |
|
136 |
|
137 $ chown username /path/to/pgsql |
|
138 |
|
139 * The database authentication can be either set to `ident sameuser` |
|
140 or `md5`. |
|
141 If set to `md5`, make sure to use an existing user |
|
142 of your database. |
|
143 If set to `ident sameuser`, make sure that your |
|
144 client's operating system user name has a matching user in |
|
145 the database. If not, please do as follow to create a user:: |
|
146 |
|
147 $ su |
|
148 $ su - postgres |
|
149 $ createuser -s username |
|
150 |
|
151 If created with the options -P (for password prompt, |
|
152 ``createuser -s -P username``), the password will be encrypted with |
|
153 the method set in the configuration file ``pg_hba.conf``. |
|
154 If you do not use this option, then the default value will be null |
|
155 and this require to set the password in the database itself. |
|
156 To do so: :: |
|
157 |
|
158 $ su |
|
159 $ su - postgres |
|
160 $ psql |
|
161 |
|
162 And then execute de following query:: |
|
163 |
|
164 ALTER USER username WITH PASSWORD `password` |
|
165 |
|
166 This login/password will be requested when you will create an |
|
167 instance with `cubicweb-ctl create` to initialize the database of |
|
168 your application. |
|
169 |
|
170 .. note:: |
|
171 The authentication method can be configured in ``pg_hba.conf``. |
|
172 |
|
173 |
|
174 .. FIXME Are these steps really necessary? It seemed to work without. |
|
175 |
|
176 * Installation of plain-text index extension :: |
|
177 |
|
178 cat /usr/share/postgresql/8.3/contrib/tsearch2.sql | psql -U username template1 |
|
179 |
|
180 * Installation of plpythonu language by default :: |
|
181 |
|
182 createlang -U pgadmin plpythonu template1 |
|
183 |
|
184 |
|
185 Pyro configuration |
|
186 ------------------ |
|
187 |
|
188 If you use Pyro, it is required to have a name server Pyro running on your |
|
189 network (by default it is identified by a broadcast request). |
|
190 |
|
191 To do so, you need to : |
|
192 |
|
193 * launch the server manually before starting cubicweb with `pyro-ns` |
|
194 |
|
195 * launch the server manually before starting cubicweb as a server with |
|
196 `pyro-nsd start` |
|
197 |
|
198 * edit the file ``/etc/default/pyro-nsd`` so that the name server pyro |
|
199 will be launched automatically when the machine fire up |
|
200 |
|
201 |
|