doc/book/en/admin/config.rst
author Nicolas Chauvat <nicolas.chauvat@logilab.fr>
Wed, 28 Nov 2012 11:44:15 +0100
branchstable
changeset 8604 7bacc4f21edc
parent 8331 fada118921d6
child 9285 e7c94121ce9d
permissions -rw-r--r--
[web/views] bugfix: the mime type is text/plain, not text/txt (closes #2526345)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
     1
.. -*- coding: utf-8 -*-
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
     2
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
     3
.. _ConfigEnv:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
     4
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
     5
Set-up of a *CubicWeb* environment
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
     6
==================================
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
     7
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
     8
You can `configure the database`_ system of your choice:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
     9
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    10
  - `PostgreSQL configuration`_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    11
  - `MySql configuration`_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    12
  - `SQLServer configuration`_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    13
  - `SQLite configuration`_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    14
7230
edd2a575a8e7 [doc] update of the update
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7226
diff changeset
    15
For advanced features, have a look to:
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    16
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    17
  - `Pyro configuration`_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    18
  - `Cubicweb resources configuration`_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    19
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    20
.. _`configure the database`: DatabaseInstallation_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    21
.. _`PostgreSQL configuration`: PostgresqlConfiguration_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    22
.. _`MySql configuration`: MySqlConfiguration_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    23
.. _`SQLServer configuration`: SQLServerConfiguration_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    24
.. _`SQLite configuration`: SQLiteConfiguration_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    25
.. _`Pyro configuration`: PyroConfiguration_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    26
.. _`Cubicweb resources configuration`: RessourcesConfiguration_
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    27
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    28
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    29
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    30
.. _RessourcesConfiguration:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    31
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    32
Cubicweb resources configuration
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    33
--------------------------------
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    34
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    35
.. autodocstring:: cubicweb.cwconfig
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    36
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    37
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    38
.. _DatabaseInstallation:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    39
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    40
Databases configuration
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    41
-----------------------
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    42
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    43
Each instance can be configured with its own database connection information,
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    44
that will be stored in the instance's :file:`sources` file. The database to use
7230
edd2a575a8e7 [doc] update of the update
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7226
diff changeset
    45
will be chosen when creating the instance. CubicWeb is known to run with
edd2a575a8e7 [doc] update of the update
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7226
diff changeset
    46
Postgresql (recommended), MySQL, SQLServer and SQLite.
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    47
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    48
Other possible sources of data include CubicWeb, Subversion, LDAP and Mercurial,
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    49
but at least one relational database is required for CubicWeb to work. You do
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    50
not need to install a backend that you do not intend to use for one of your
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    51
instances. SQLite is not fit for production use, but it works well for testing
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    52
and ships with Python, which saves installation time when you want to get
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    53
started quickly.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    54
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    55
.. _PostgresqlConfiguration:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    56
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    57
PostgreSQL
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    58
~~~~~~~~~~
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    59
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    60
For installation, please refer to the `PostgreSQL project online documentation`_.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    61
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    62
.. _`PostgreSQL project online documentation`: http://www.postgresql.org/
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    63
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    64
You need to install the three following packages: `postgresql-8.X`,
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    65
`postgresql-client-8.X`, and `postgresql-plpython-8.X`. If you run postgres
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    66
version prior to 8.3, you'll also need the `postgresql-contrib-8.X` package for
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    67
full-text search extension.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    68
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    69
If you run postgres on another host than the |cubicweb| repository, you should
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    70
install the `postgresql-client` package on the |cubicweb| host, and others on the
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    71
database host.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    72
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    73
Database cluster
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    74
++++++++++++++++
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    75
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    76
If you already have an existing cluster and PostgreSQL server running, you do
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    77
not need to execute the initilization step of your PostgreSQL database unless
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    78
you want a specific cluster for |cubicweb| databases or if your existing
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    79
cluster doesn't use the UTF8 encoding (see note below).
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    80
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    81
To initialize a PostgreSQL cluster, use the command ``initdb``::
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    82
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    83
    $ initdb -E UTF8 -D /path/to/pgsql
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    84
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    85
Notice the encoding specification. This is necessary since |cubicweb| usually
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    86
want UTF8 encoded database. If you use a cluster with the wrong encoding, you'll
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    87
get error like::
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    88
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    89
  new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    90
  HINT:  Use the same encoding as in the template database, or use template0 as template.
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    91
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    92
Once initialized, start the database server PostgreSQL with the command::
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    93
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    94
  $ postgres -D /path/to/psql
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    95
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    96
If you cannot execute this command due to permission issues, please make sure
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    97
that your username has write access on the database.  ::
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    98
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
    99
  $ chown username /path/to/pgsql
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   100
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   101
Database authentication
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   102
+++++++++++++++++++++++
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   103
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   104
The database authentication is configured in `pg_hba.conf`. It can be either set
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   105
to `ident sameuser` or `md5`.  If set to `md5`, make sure to use an existing
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   106
user of your database.  If set to `ident sameuser`, make sure that your client's
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   107
operating system user name has a matching user in the database. If not, please
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   108
do as follow to create a user::
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   109
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   110
  $ su
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   111
  $ su - postgres
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   112
  $ createuser -s -P username
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   113
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   114
The option `-P` (for password prompt), will encrypt the password with the
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   115
method set in the configuration file :file:`pg_hba.conf`.  If you do not use this
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   116
option `-P`, then the default value will be null and you will need to set it
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   117
with::
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   118
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   119
  $ su postgres -c "echo ALTER USER username WITH PASSWORD 'userpasswd' | psql"
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   120
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   121
The above login/password will be requested when you will create an instance with
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   122
`cubicweb-ctl create` to initialize the database of your instance.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   123
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   124
Notice that the `cubicweb-ctl db-create` does database initialization that
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   125
may requires a postgres superuser. That's why a login/password is explicitly asked
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   126
at this step, so you can use there a superuser without using this user when running
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   127
the instance. Things that require special privileges at this step:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   128
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   129
* database creation, require the 'create database' permission
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   130
* install the plpython extension language (require superuser)
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   131
* install the tsearch extension for postgres version prior to 8.3 (require superuser)
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   132
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   133
To avoid using a super user each time you create an install, a nice trick is to
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   134
install plpython (and tsearch when needed) on the special `template1` database,
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   135
so they will be installed automatically when cubicweb databases are created
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   136
without even with needs for special access rights. To do so, run ::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   137
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   138
  # Installation of plpythonu language by default ::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   139
  $ createlang -U pgadmin plpythonu template1
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   140
  $ psql -U pgadmin template1
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   141
  template1=# update pg_language set lanpltrusted=TRUE where lanname='plpythonu';
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   142
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   143
Where `pgadmin` is a postgres superuser. The last command is necessary since by
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   144
default plpython is an 'untrusted' language and as such can't be used by non
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   145
superuser. This update fix that problem by making it trusted.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   146
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   147
To install the tsearch plain-text index extension on postgres prior to 8.3, run::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   148
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   149
    cat /usr/share/postgresql/8.X/contrib/tsearch2.sql | psql -U username template1
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   150
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   151
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   152
.. _MySqlConfiguration:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   153
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   154
MySql
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   155
~~~~~
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   156
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   157
You must add the following lines in ``/etc/mysql/my.cnf`` file::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   158
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   159
    transaction-isolation=READ-COMMITTED
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   160
    default-storage-engine=INNODB
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   161
    default-character-set=utf8
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   162
    max_allowed_packet = 128M
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   163
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   164
.. Note::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   165
    It is unclear whether mysql supports indexed string of arbitrary length or
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   166
    not.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   167
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   168
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   169
.. _SQLServerConfiguration:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   170
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   171
SQLServer
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   172
~~~~~~~~~
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   173
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   174
As of this writing, support for SQLServer 2005 is functional but incomplete. You
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   175
should be able to connect, create a database and go quite far, but some of the
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   176
SQL generated from RQL queries is still currently not accepted by the
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   177
backend. Porting to SQLServer 2008 is also an item on the backlog.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   178
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   179
The `source` configuration file may look like this (specific parts only are
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   180
shown)::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   181
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   182
  [system]
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   183
  db-driver=sqlserver2005
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   184
  db-user=someuser
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   185
  # database password not needed
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   186
  #db-password=toto123
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   187
  #db-create/init may ask for a pwd: just say anything
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   188
  db-extra-arguments=Trusted_Connection
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   189
  db-encoding=utf8
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   190
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   191
7597
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   192
You need to change the default settings on the database by running::
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   193
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   194
 ALTER DATABASE <databasename> SET READ_COMMITTED_SNAPSHOT ON;
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   195
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   196
The ALTER DATABASE command above requires some permissions that your
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   197
user may not have. In that case you will have to ask your local DBA to
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   198
run the query for you.
7597
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   199
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   200
You can check that the setting is correct by running the following
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   201
query which must return '1'::
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   202
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   203
   SELECT is_read_committed_snapshot_on
7597
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   204
     FROM sys.databases WHERE name='<databasename>';
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   205
c6cf2a9b2331 [doc] SQL Server isolation level settings
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents: 7529
diff changeset
   206
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   207
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   208
.. _SQLiteConfiguration:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   209
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   210
SQLite
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   211
~~~~~~
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   212
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   213
SQLite has the great advantage of requiring almost no configuration. Simply
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   214
use 'sqlite' as db-driver, and set path to the dabase as db-name. Don't specify
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   215
anything for db-user and db-password, they will be ignore anyway.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   216
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   217
.. Note::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   218
  SQLite is great for testing and to play with cubicweb but is not suited for
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   219
  production environments.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   220
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   221
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   222
.. _PyroConfiguration:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   223
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   224
Pyro configuration
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   225
------------------
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   226
7529
2fdc310be7cd [book] add autoload section from code and fix sphinx warnings
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7230
diff changeset
   227
Pyro name server
2fdc310be7cd [book] add autoload section from code and fix sphinx warnings
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7230
diff changeset
   228
~~~~~~~~~~~~~~~~
8331
fada118921d6 [doc] add missing section titles
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7597
diff changeset
   229
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   230
If you want to use Pyro to access your instance remotely, or to have multi-source
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   231
or distributed configuration, it is required to have a Pyro name server running
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   232
on your network. By default it is detected by a broadcast request, but you can
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   233
specify a location in the instance's configuration file.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   234
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   235
To do so, you need to :
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   236
7529
2fdc310be7cd [book] add autoload section from code and fix sphinx warnings
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7230
diff changeset
   237
* be sure to have installed it (see :ref:`InstallDependencies`)
2fdc310be7cd [book] add autoload section from code and fix sphinx warnings
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7230
diff changeset
   238
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   239
* launch the pyro name server with `pyro-nsd start` before starting cubicweb
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   240
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   241
* under debian, edit the file :file:`/etc/default/pyro-nsd` so that the name
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   242
  server pyro will be launched automatically when the machine fire up
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   243
7529
2fdc310be7cd [book] add autoload section from code and fix sphinx warnings
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7230
diff changeset
   244
Note that you can use the pyro server without a running pyro nameserver.
2fdc310be7cd [book] add autoload section from code and fix sphinx warnings
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7230
diff changeset
   245
Refer to `pyro-ns-host` server configuration option for details.
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   246