doc/book/en/admin/setup.rst
author Nicolas Chauvat <nicolas.chauvat@logilab.fr>
Sat, 18 Jul 2009 16:00:14 +0200
branchstable
changeset 2393 6190852af97f
parent 2239 0f12f1ebf27c
child 2458 4d114865098f
permissions -rw-r--r--
[doc] add list of dependencies in appendix
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     1
.. -*- coding: utf-8 -*-
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     2
1224
a9da8a8f0b19 [doc] Change id to english.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 221
diff changeset
     3
.. _SetUpEnv:
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     4
106
fa179de1a787 [doc] Adjust TOC for this particular chapter to get the content and not list of links.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 104
diff changeset
     5
===================================================
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2172
diff changeset
     6
Installation and set-up of a *CubicWeb* environment
98
f756ead5746a [doc] Initial translation of first two section in installation chapter.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 93
diff changeset
     7
===================================================
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
     8
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
     9
Installation of `Cubicweb` and its dependencies
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    10
-----------------------------------------------
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    11
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2172
diff changeset
    12
*CubicWeb* is packaged for Debian and Ubuntu, but can be installed from source
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    13
using a tarball or the Mercurial version control system.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    14
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    15
.. _DebianInstallation:
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    16
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    17
Debian and Ubuntu packages
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    18
```````````````````````````
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    19
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    20
Depending on the distribution you are using, add the appropriate line to your list
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    21
of sources (for example by editing ``/etc/apt/sources.list``).
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    22
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    23
For Debian Lenny::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    24
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    25
  deb http://ftp.logilab.org/dists/ lenny/
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    26
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    27
For Debian Sid::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    28
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    29
  deb http://ftp.logilab.org/dists/ sid/
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    30
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    31
For Ubuntu Hardy::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    32
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    33
  deb http://ftp.logilab.org/dists/ hardy/
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    34
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    35
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    36
You can now install the required packages with the following command::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    37
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1714
diff changeset
    38
  apt-get update
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    39
  apt-get install cubicweb cubicweb-dev
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    40
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    41
`cubicweb` installs the framework itself, allowing you to create
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    42
new applications.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    43
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    44
`cubicweb-dev` installs the development environment allowing you to
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    45
develop new cubes.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    46
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    47
There is also a wide variety of cubes listed on http://www.cubicweb.org/Project available as debian packages and tarball.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    48
2239
0f12f1ebf27c add note about logilab key file / apt-get
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2175
diff changeset
    49
The repositories are signed with `Logilab's gnupg key`_. To avoid warning on "apt-get update":
2393
6190852af97f [doc] add list of dependencies in appendix
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2239
diff changeset
    50
1. become root using sudo
2239
0f12f1ebf27c add note about logilab key file / apt-get
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2175
diff changeset
    51
2. download http://ftp.logilab.org/dists/logilab-dists-key.asc using e.g. wget
0f12f1ebf27c add note about logilab key file / apt-get
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2175
diff changeset
    52
3. run "apt-key add logilab-dists-key.asc"
0f12f1ebf27c add note about logilab key file / apt-get
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2175
diff changeset
    53
4. re-run apt-get update (manually or through the package manager, whichever you prefer)
0f12f1ebf27c add note about logilab key file / apt-get
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 2175
diff changeset
    54
2393
6190852af97f [doc] add list of dependencies in appendix
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2239
diff changeset
    55
.. _`Logilab's gnupg key`: http://ftp.logilab.org/dists/logilab-dists-key.asc
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    56
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    57
Install from source
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    58
```````````````````
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    59
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    60
You can download the archive containing the sources from our `ftp site`_ at::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    61
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    62
  http://ftp.logilab.org/pub/cubicweb/
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    63
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    64
.. _`ftp site`: http://ftp.logilab.org/pub/cubicweb/
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    65
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    66
or keep up to date with on-going development by using Mercurial and its forest
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    67
extension::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    68
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    69
  hg fclone http://www.logilab.org/hg/forests/cubicweb
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    70
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    71
See :ref:`MercurialPresentation` for more details about Mercurial.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    72
2393
6190852af97f [doc] add list of dependencies in appendix
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2239
diff changeset
    73
In both cases, make sure you have installed the dependencies (see appendixes for
6190852af97f [doc] add list of dependencies in appendix
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2239
diff changeset
    74
the list).
6190852af97f [doc] add list of dependencies in appendix
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2239
diff changeset
    75
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    76
Postgres installation
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    77
`````````````````````
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    78
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    79
Please refer to the `Postgresql project online documentation`_.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    80
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    81
.. _`Postgresql project online documentation`: http://www.postgresql.org/
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    82
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    83
You need to install the three following packages: `postgres-8.3`,
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    84
`postgres-contrib-8.3` and `postgresql-plpython-8.3`.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    85
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    86
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    87
Then you can install:
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    88
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    89
* `pyro` if you wish the repository to be accessible through Pyro
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    90
  or if the client and the server are not running on the same machine
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    91
  (in which case the packages will have to be installed on both
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    92
  machines)
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    93
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    94
* `python-ldap` if you plan to use a LDAP source on the server
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    95
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    96
.. _ConfigurationEnv:
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    97
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    98
Environment configuration
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
    99
-------------------------
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   100
2175
16d3c37c5d28 [doc] improvements
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 2172
diff changeset
   101
If you installed *CubicWeb* by cloning the Mercurial forest, then you
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1714
diff changeset
   102
will need to update the environment variable PYTHONPATH by adding
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   103
the path to the forest ``cubicweb``:
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   104
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   105
Add the following lines to either `.bashrc` or `.bash_profile` to configure
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   106
your development environment ::
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1714
diff changeset
   107
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   108
  export PYTHONPATH=/full/path/to/cubicweb-forest
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   109
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   110
If you installed the debian packages, no configuration is required.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   111
Your new cubes will be placed in `/usr/share/cubicweb/cubes` and
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   112
your applications will be placed in `/etc/cubicweb.d`.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   113
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   114
To use others directories then you will have to configure the
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   115
following environment variables as follows::
93
9c919a47e140 [doc] total file reorganisation - phase 1 complete
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
diff changeset
   116
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   117
    export CW_CUBES_PATH=~/lib/cubes
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   118
    export CW_REGISTRY=~/etc/cubicweb.d/
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   119
    export CW_INSTANCE_DATA=$CW_REGISTRY
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   120
    export CW_RUNTIME=/tmp
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   121
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   122
.. note::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   123
    The values given above are our suggestions but of course
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   124
    can be different.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   125
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   126
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   127
Databases configuration
1464
09afa1f808c4 [doc] Fix ReST pb.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1460
diff changeset
   128
-----------------------
09afa1f808c4 [doc] Fix ReST pb.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1460
diff changeset
   129
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   130
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   131
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   132
.. _ConfigurationPostgres:
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   133
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   134
Postgres configuration
1464
09afa1f808c4 [doc] Fix ReST pb.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1460
diff changeset
   135
``````````````````````
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   136
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   137
.. note::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   138
    If you already have an existing cluster and postgres server
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   139
    running, you do not need to execute the initilization step
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   140
    of your Postgres database.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   141
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   142
* First, initialize the database Postgres with the command ``initdb``.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   143
  ::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   144
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   145
    $ initdb -D /path/to/pgsql
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   146
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1714
diff changeset
   147
  Once initialized, start the database server Postgres
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   148
  with the command::
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1714
diff changeset
   149
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   150
    $ postgres -D /path/to/psql
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   151
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   152
  If you cannot execute this command due to permission issues, please
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   153
  make sure that your username has write access on the database.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   154
  ::
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1714
diff changeset
   155
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   156
    $ chown username /path/to/pgsql
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   157
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   158
* The database authentication can be either set to `ident sameuser`
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1714
diff changeset
   159
  or `md5`.
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   160
  If set to `md5`, make sure to use an existing user
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   161
  of your database.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   162
  If set to `ident sameuser`, make sure that your
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   163
  client's operating system user name has a matching user in
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   164
  the database. If not, please do as follow to create a user::
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1714
diff changeset
   165
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   166
    $ su
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   167
    $ su - postgres
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   168
    $ createuser -s -P username
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   169
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   170
  The option `-P` (for password prompt), will encrypt the password with
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1714
diff changeset
   171
  the method set in the configuration file ``pg_hba.conf``.
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   172
  If you do not use this option `-P`, then the default value will be null
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   173
  and you will need to set it with::
2172
cf8f9180e63e delete-trailing-whitespace
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1714
diff changeset
   174
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   175
    $ su postgres -c "echo ALTER USER username WITH PASSWORD 'userpasswd' | psql"
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   176
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   177
  This login/password will be requested when you will create an
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   178
  instance with `cubicweb-ctl create` to initialize the database of
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   179
  your application.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   180
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   181
.. note::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   182
    The authentication method can be configured in ``pg_hba.conf``.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   183
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   184
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   185
.. FIXME Are these steps really necessary? It seemed to work without.
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   186
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   187
* Installation of plain-text index extension ::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   188
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   189
    cat /usr/share/postgresql/8.3/contrib/tsearch2.sql | psql -U username template1
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   190
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   191
* Installation of plpythonu language by default ::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   192
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   193
    createlang -U pgadmin plpythonu template1
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   194
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   195
MySql configuration
1464
09afa1f808c4 [doc] Fix ReST pb.
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1460
diff changeset
   196
```````````````````
1460
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   197
Yout must add the following lines in /etc/mysql/my.cnf file::
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   198
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   199
    transaction-isolation = READ-COMMITTED
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   200
    default-storage-engine=INNODB
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   201
    default-character-set=utf8
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   202
    max_allowed_packet = 128M
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   203
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   204
Pyro configuration
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   205
------------------
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   206
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   207
If you use Pyro, it is required to have a name server Pyro running on your
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   208
network (by default it is detected by a broadcast request).
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   209
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   210
To do so, you need to :
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   211
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   212
* launch the server manually before starting cubicweb as a server with
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   213
  `pyro-nsd start`
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   214
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   215
* edit the file ``/etc/default/pyro-nsd`` so that the name server pyro
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   216
  will be launched automatically when the machine fire up
6520efef1824 [doc] C011 content moved to C010
Sandrine Ribeau <sandrine.ribeau@logilab.fr>
parents: 1444
diff changeset
   217