doc/book/en/03-01-installation.en.txt
author Sandrine Ribeau <sandrine.ribeau@logilab.fr>
Tue, 18 Nov 2008 15:06:33 -0800
changeset 98 f756ead5746a
parent 93 9c919a47e140
child 105 300166b41ea9
permissions -rw-r--r--
[doc] Initial translation of first two section in installation chapter.

.. -*- coding: utf-8 -*-

Installation
============

Installation of `Cubicweb` and its dependancies
-----------------------------------------------

`CubicWeb` is available as a Mercurial repository using the forest extension.
First make sure Mercurial is installed and that the forest extension is
available.

Mercurial installation
``````````````````````

Please refer to the project online documentation Mercurial_.
.. _Mercurial: http://www.selenic.com/mercurial/wiki/

We also provide in this book a quick guide on how to use
Mercurial (:ref:`Mercurial`).


Installation of the forest extension
````````````````````````````````````

Set up the forest extension by getting a copy of the sources 
from http://hg.akoha.org/hgforest/ and adding the following 
lines to your ``~/.hgrc``: ::

   [extensions]
   hgext.forest=
   # or, if forest.py is not in the hgext dir:
   # forest=/path/to/forest.py

Get `CubicWeb` source code
``````````````````````````

Clone the forest in you working directory.

::

  hg fclone http://www.logilab.org/hg/forests/cubicweb

.. note:: 
  We recommand you to create a symbolic link to the command ``cubicweb-ctl``
  as you will use it pretty often.

  ::
    
    $ ln -s /path/to/forest/cubicweb/bin/cubicweb-ctl ~/bin

Postgres installation
`````````````````````

Please refer to the project online documentation Postgres_.

.. _Postgres: http://www.postgresql.org/

You need to install the three following packages: `postgres-8.3`,
`postgres-contrib-8.3` and `postgresql-plpython-8.3`.


Then you can install:

* `pyro` if you wish the repository is accessible through Pyro
  or if the client and the server are not running on the same machine
  (in suche case the packages will have to be isntalled on both
  machines)

* `python-ldap` if you plan to use a LDAP source on the server

.. _ConfigurationEnv:

Environment configuration
-------------------------

[FIXME]
Ces variables ne sont plus requises pour le bon fonctionnement de `CubicWeb`, non?
A part rajouter la foret dans le PYTHONPATH, rien de plus ne doit etre fait?

Update the environment variable PYTHONPATH to add to it the path to
the forest ``cubicweb``.

Add the following lines to either `.bashrc` or `.bash_profile` to configure
your development environment ::
  
  export PYTHONPATH=/full/path/to/cubicweb-forest
  
  //deprecated??
  export ERUDI_REGISTRY=~/etc/erudi.d/
  export ERUDI_TEMPLATES=~/hg/
  export ERUDI_RUNTIME=/tmp/

Cela suppose que le composant erudi que vous développez est dans un
sous-répertoire de *~/hg/* et que vous avez créé le répertoire *~/etc/erudi.d/*
pour que `cubicweb-ctl` y place vos instances de test.

.. _ConfigurationPostgres:

Postgres configuration
----------------------

* First you have to initialize the database Postgres with the command ``initdb``.
  ::

    $ initdb -D /path/to/pgsql

  Once initialized, you can launch the database server Postgres 
  with the command: ::
  
    $ postgres -D /path/to/psql

  If you cannot execute this command due to permission issues, please
  make sure that your username has write access on the database.
  ::
 
    $ chown username /path/to/pgsql

* Create a superuser for `CubicWeb` instance (**root**) ::

    createuser -s username

  Initialize the password of the superuser you juste created with 
  ``su - postgres`` and ``psql``.

  This password will be asked to you later on where you will create an
  instance with `cubicweb-ctl create`

[XXX]
Est-ce que ces etapes sont vraiment necessaires? 
sand : lors de l'installation de ma bdd cela n'a pas ete fait
et il semble que tout aille bien. Doit etre verifie avec les experts.

* installation of plain-text index extension ::

    cat /usr/share/postgresql/8.3/contrib/tsearch2.sql | psql -U username template1

* installation of plpythonu language by default ::

    createlang -U pgadmin plpythonu template1


Pyro configuration
------------------

If you use Pyro, it is required to have a name server Pyro runing on your
network (by default it is identified by a broadcast request).

To do so, you need to :

* launch the server manually before starting cubicweb with `pyro-ns`

* launch the server manually before starting cubicweb as a server with
  `pyro-nsd start`

* edit the file ``/etc/default/pyro-nsd`` so that the name server pyro
  will be launched automatically when the macine fire up