doc/book/en/admin/config.rst
author Julien Jehannet <julien.jehannet@logilab.fr>
Thu, 16 Jun 2011 12:31:27 +0200
branchstable
changeset 7529 2fdc310be7cd
parent 7230 edd2a575a8e7
child 7597 c6cf2a9b2331
permissions -rw-r--r--
[book] add autoload section from code and fix sphinx warnings * drop misleading faq entry since clear explanation can be found in internationalization chapter * use autodata sphinx directive instead of raw text * fill empty chapter with autodoc: - devweb/httpcaching.rst - devweb/resource.rst - devweb/views/idownloadable.rst - devweb/views/wdoc.rst * use shebang in excerpt to denote shell code * fix some bad indented docstrings in javascript files
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
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    73
.. Note::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    74
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    75
    If you already have an existing cluster and PostgreSQL server running, you do
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    76
    not need to execute the initilization step of your PostgreSQL database unless
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    77
    you want a specific cluster for |cubicweb| databases or if your existing
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    78
    cluster doesn't use the UTF8 encoding (see note below).
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    79
7230
edd2a575a8e7 [doc] update of the update
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 7226
diff changeset
    80
* First, initialize a PostgreSQL cluster with the command ``initdb``::
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    81
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    82
    $ initdb -E UTF8 -D /path/to/pgsql
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    83
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    84
  Notice the encoding specification. This is necessary since |cubicweb| usually
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    85
  want UTF8 encoded database. If you use a cluster with the wrong encoding, you'll
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    86
  get error like::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    87
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    88
    new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    89
    HINT:  Use the same encoding as in the template database, or use template0 as template.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    90
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    91
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    92
  Once initialized, start the database server PostgreSQL with the command::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    93
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    94
    $ postgres -D /path/to/psql
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    95
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    96
  If you cannot execute this command due to permission issues, please make sure
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    97
  that your username has write access on the database.  ::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    98
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
    99
    $ chown username /path/to/pgsql
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   100
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   101
* The database authentication can be either set to `ident sameuser` or `md5`.  If
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   102
  set to `md5`, make sure to use an existing user of your database.  If set to
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   103
  `ident sameuser`, make sure that your client's operating system user name has a
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   104
  matching user in the database. If not, please do as follow to create a user::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   105
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   106
    $ su
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   107
    $ su - postgres
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   108
    $ createuser -s -P username
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   109
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   110
  The option `-P` (for password prompt), will encrypt the password with the
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   111
  method set in the configuration file :file:`pg_hba.conf`.  If you do not use this
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   112
  option `-P`, then the default value will be null and you will need to set it
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   113
  with::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   114
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   115
    $ su postgres -c "echo ALTER USER username WITH PASSWORD 'userpasswd' | psql"
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   116
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   117
.. Note::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   118
    The authentication method can be configured in file:`pg_hba.conf`.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   119
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
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   153
.. _MySqlConfiguration:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   154
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   155
MySql
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
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   158
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
   159
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   160
    transaction-isolation=READ-COMMITTED
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   161
    default-storage-engine=INNODB
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   162
    default-character-set=utf8
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   163
    max_allowed_packet = 128M
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   164
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   165
.. Note::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   166
    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
   167
    not.
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
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   170
.. _SQLServerConfiguration:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   171
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   172
SQLServer
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
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   175
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
   176
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
   177
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
   178
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
   179
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   180
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
   181
shown)::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   182
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   183
  [system]
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   184
  db-driver=sqlserver2005
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   185
  db-user=someuser
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   186
  # database password not needed
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   187
  #db-password=toto123
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   188
  #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
   189
  db-extra-arguments=Trusted_Connection
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   190
  db-encoding=utf8
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   191
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   192
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   193
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   194
.. _SQLiteConfiguration:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   195
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   196
SQLite
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   197
~~~~~~
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   198
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
   199
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
   200
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
   201
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   202
.. Note::
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   203
  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
   204
  production environments.
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   205
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   206
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   207
.. _PyroConfiguration:
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   208
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   209
Pyro configuration
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   210
------------------
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   211
7529
2fdc310be7cd [book] add autoload section from code and fix sphinx warnings
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7230
diff changeset
   212
Pyro name server
2fdc310be7cd [book] add autoload section from code and fix sphinx warnings
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7230
diff changeset
   213
~~~~~~~~~~~~~~~~
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   214
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
   215
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
   216
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
   217
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
   218
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   219
To do so, you need to :
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   220
7529
2fdc310be7cd [book] add autoload section from code and fix sphinx warnings
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7230
diff changeset
   221
* 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
   222
7226
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   223
* 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
   224
e88c57c10b34 [doc] major update of the install documentation
Alain Leufroy <alain.leufroy@logilab.fr>
parents:
diff changeset
   225
* 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
   226
  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
   227
7529
2fdc310be7cd [book] add autoload section from code and fix sphinx warnings
Julien Jehannet <julien.jehannet@logilab.fr>
parents: 7230
diff changeset
   228
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
   229
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
   230