doc/book/en/admin/setup.rst
branchstable
changeset 7230 edd2a575a8e7
parent 7226 e88c57c10b34
child 7633 ab1385ee7caa
equal deleted inserted replaced
7226:e88c57c10b34 7230:edd2a575a8e7
     3 .. _SetUpEnv:
     3 .. _SetUpEnv:
     4 
     4 
     5 Installation of a *CubicWeb* environment
     5 Installation of a *CubicWeb* environment
     6 ========================================
     6 ========================================
     7 
     7 
     8 There are different simple ways to install |cubicweb| and its
     8 Official releases are available from the `CubicWeb.org forge`_ and from
     9 dependencies depending on your requirements:
     9 `PyPI`_. Since CubicWeb is developed using `Agile software development
    10 
    10 <http://en.wikipedia.org/wiki/Agile_software_development>`_ techniques, releases
    11 * `Distribution-specific installation`. This option shows you how to
    11 happen frequently. In a version numbered X.Y.Z, X changes after a few years when
    12   easily install |cubicweb| and its requirements on your system:
    12 the API breaks, Y changes after a few weeks when features are added and Z
    13 
    13 changes after a few days when bugs are fixed.
    14   - `Installation on Debian/Ubuntu`_ 
    14 
    15   - `Installation on Windows`_
    15 Depending on your needs, you will chose a different way to install CubicWeb on
    16   - `Install in a virtualenv`_
    16 your system:
    17 
    17 
    18 * `Official release installation`. This options is the best approach
    18 - `Installation on Debian/Ubuntu`_
    19   for those who want a flexible and up-to-date stable
    19 - `Installation on Windows`_
    20   version. |cubicweb| is published on `PyPI`_:
    20 - `Installation in a virtualenv`_
    21 
    21 - `Installation with pip`_
    22   - `Installation with pip`_
    22 - `Installation with easy_install`_
    23   - `Installation with easy_install`_
    23 - `Installation from tarball`_
    24 
    24 
    25 * `Lastest development version installation`. This option is
    25 If you are a power-user and need the very latest features, you will
    26   dedicated for power-users who want the very lastest
    26 
    27   features (|cubicweb| is an `Agile software <http://en.wikipedia.org/wiki/Agile_software_development>`_).
    27 - `Install from version control`_
    28 
    28 
    29   - `Installation from tarball`_
    29 Once the software is installed, move on to :ref:`ConfigEnv` for better control
    30   - `Installation from version control`_
       
    31 
       
    32 Once installed, you can have a look to :ref:`ConfigEnv` for better control
       
    33 and advanced features of |cubicweb|.
    30 and advanced features of |cubicweb|.
    34 
    31 
    35 .. _`Installation on Debian/Ubuntu`: DebianInstallation_
    32 .. _`Installation on Debian/Ubuntu`: DebianInstallation_
    36 .. _`Installation on Windows`: WindowsInstallation_
    33 .. _`Installation on Windows`: WindowsInstallation_
    37 .. _`Install in a virtualenv`: VirtualenvInstallation_
    34 .. _`Installation in a virtualenv`: VirtualenvInstallation_
    38 .. _`Installation with pip`: PipInstallation_
    35 .. _`Installation with pip`: PipInstallation_
    39 .. _`Installation with easy_install`: EasyInstallInstallation_
    36 .. _`Installation with easy_install`: EasyInstallInstallation_
    40 .. _`Installation from tarball`: TarballInstallation_
    37 .. _`Installation from tarball`: TarballInstallation_
    41 .. _`Installation from version control`: MercurialInstallation_
    38 .. _`Install from version control`: MercurialInstallation_
    42 
    39 
    43 
    40 
    44 .. _DebianInstallation:
    41 .. _DebianInstallation:
    45 
    42 
    46 Debian/Ubuntu install
    43 Debian/Ubuntu install
    47 ---------------------
    44 ---------------------
    48 
    45 
    49 |cubicweb| is packaged for Debian/Ubuntu (and derived
    46 |cubicweb| is packaged for Debian/Ubuntu (and derived
    50 distributions). Their integrated package-management systems make
    47 distributions). Their integrated package-management system make
    51 installation and upgrading much easier for users since
    48 installation and upgrade much easier for users since
    52 dependencies/recommends (like databases) are automatically installed.
    49 dependencies (like databases) are automatically installed.
    53 
    50 
    54 Depending on the distribution you are using, add the appropriate line to your
    51 Depending on the distribution you are using, add the appropriate line to your
    55 `list of sources` (for example by editing ``/etc/apt/sources.list``).
    52 `list of sources` (for example by editing ``/etc/apt/sources.list``).
    56 
    53 
    57 For Debian Squeeze (stable)::
    54 For Debian Squeeze (stable)::
    82 
    79 
    83 ``cubicweb`` installs the framework itself, allowing you to create new
    80 ``cubicweb`` installs the framework itself, allowing you to create new
    84 instances. ``cubicweb-dev`` installs the development environment
    81 instances. ``cubicweb-dev`` installs the development environment
    85 allowing you to develop new cubes.
    82 allowing you to develop new cubes.
    86 
    83 
    87 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can acces a
    84 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can access a
    88 list of availble cubes using ``apt-cache search cubicweb`` or at the
    85 list of available cubes using ``apt-cache search cubicweb`` or at the
    89 `CubicWeb.org Forge`_.
    86 `CubicWeb.org forge`_.
    90 
    87 
    91 .. note::
    88 .. note::
    92 
    89 
    93   `cubicweb-dev` will install basic sqlite support. You can easily setup
    90   `cubicweb-dev` will install basic sqlite support. You can easily setup
    94   :ref:`cubicweb with other database <DatabaseInstallation>` using the following virtual packages :
    91   :ref:`cubicweb with other database <DatabaseInstallation>` using the following
    95 
    92   virtual packages :
    96   * `cubicweb-postgresql-support` contains necessary dependency for
    93 
       
    94   * `cubicweb-postgresql-support` contains the necessary dependency for
    97     using :ref:`cubicweb with postgresql datatabase <PostgresqlConfiguration>`
    95     using :ref:`cubicweb with postgresql datatabase <PostgresqlConfiguration>`
    98 
    96 
    99   * `cubicweb-mysql-support` contains necessary dependency for using
    97   * `cubicweb-mysql-support` contains the necessary dependency for using
   100     :ref:`cubicweb with mysql database <MySqlConfiguration>`.
    98     :ref:`cubicweb with mysql database <MySqlConfiguration>`.
   101 
    99 
   102 .. _`list of sources`: http://wiki.debian.org/SourcesList
   100 .. _`list of sources`: http://wiki.debian.org/SourcesList
   103 .. _`Logilab's gnupg key`: http://download.logilab.org/logilab-dists-key.asc
   101 .. _`Logilab's gnupg key`: http://download.logilab.org/logilab-dists-key.asc
   104 .. _`CubicWeb.org Forge`: http://www.cubicweb.org/project/
   102 .. _`CubicWeb.org Forge`: http://www.cubicweb.org/project/
   108 Windows Install
   106 Windows Install
   109 ---------------
   107 ---------------
   110 
   108 
   111 You need to have `python`_ version >= 2.5 and < 3 installed.
   109 You need to have `python`_ version >= 2.5 and < 3 installed.
   112 
   110 
   113 Then your best option is probably the :ref:`EasyInstallInstallation`.
   111 If you want an automated install, your best option is probably the
   114 In fact it is a pure python packages manager which lacks in Windows.
   112 :ref:`EasyInstallInstallation`. EasyInstall is a tool that helps users to
   115 It helps users to install python packages along with dependencies,
   113 install python packages along with their dependencies, searching for suitable
   116 searching for suitable pre-compiled binaries on the
   114 pre-compiled binaries on the `The Python Package Index`_.
   117 `The Python Package Index`_.
   115 
   118 
   116 If you want better control over the process as well as a suitable development
   119 Moreover, if you want better control over the process as well as
   117 environment or if you are having problems with `easy_install`, read on to
   120 a suitable development environment or if you are having problems with
   118 :ref:`SetUpWindowsEnv`.
   121 `easy_install`, move right away to :ref:`SetUpWindowsEnv`.
       
   122 
   119 
   123 .. _python:  http://www.python.org/
   120 .. _python:  http://www.python.org/
   124 .. _`The Python Package Index`: http://pypi.python.org
   121 .. _`The Python Package Index`: http://pypi.python.org
   125 
   122 
   126 .. _VirtualenvInstallation:
   123 .. _VirtualenvInstallation:
   127 
   124 
   128 `Virtualenv` install
   125 `Virtualenv` install
   129 --------------------
   126 --------------------
   130 
   127 
   131 Since version 3.9, |cubicweb| can be safely installed, used and contained inside
   128 Since version 3.9, |cubicweb| can be safely installed, used and contained inside
   132 a `virtualenv`_. You can use either 
   129 a `virtualenv`_. You can use either :ref:`pip <PipInstallation>` or
   133 :ref:`pip <PipInstallation>` or
       
   134 :ref:`easy_install <EasyInstallInstallation>` to install |cubicweb| inside an
   130 :ref:`easy_install <EasyInstallInstallation>` to install |cubicweb| inside an
   135 activated virtual environment.
   131 activated virtual environment.
   136 
   132 
   137 .. _PipInstallation:
   133 .. _PipInstallation:
   138 
   134 
   139 `pip` install
   135 `pip` install
   140 -------------
   136 -------------
   141 
   137 
   142 Using pip_ is the recommended way to install |cubicweb|. pip_ is a
   138 pip_ is a python utility that helps downloading, building, installing, and
   143 smart python utility that lets you automatically download, build,
   139 managing python packages and their dependencies. It is fully compatible with
   144 install, and manage python packages and their dependencies. It is full
   140 `virtualenv`_ and installs the packages from sources published on the
   145 compatible with `virtualenv`_.
   141 `The Python Package Index`_.
   146 
   142 
   147 pip_ install the packages from sources published on the
   143 .. _`pip`: http://pip.openplans.org/
   148 *The Python Package Index* (PyPI_).
   144 .. _`virtualenv`: http://virtualenv.openplans.org/
   149 You need a compilation environment because some dependencies have C
   145 
   150 extensions. If you definitively wont, installing 
   146 A working compilation chain is needed to build the modules that include C
   151 `Lxml <http://codespeak.net/lxml/>`_,
   147 extensions. If you definitively wont, installing `Lxml
   152 `Twisted <http://twistedmatrix.com/trac/>`_ and 
   148 <http://codespeak.net/lxml/>`_, `Twisted <http://twistedmatrix.com/trac/>`_ and
   153 `libgecode <http://www.gecode.org/>`_ will help.
   149 `libgecode <http://www.gecode.org/>`_ will help.
   154 
   150 
   155 To install |cubicweb| and all dependencies just use the following command
   151 To install |cubicweb| and its dependencies, just run::
   156 line::
       
   157 
   152 
   158   pip install cubicweb
   153   pip install cubicweb
   159 
   154 
   160 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can acces a
   155 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can access a
   161 list of availble cubes on
   156 list of available cubes on
   162 `PyPI <http://pypi.python.org/pypi?%3Aaction=search&term=cubicweb&submit=search>`_ 
   157 `PyPI <http://pypi.python.org/pypi?%3Aaction=search&term=cubicweb&submit=search>`_
   163 or at the `CubicWeb.org Forge`_.
   158 or at the `CubicWeb.org forge`_.
   164 
   159 
   165 For example, installing the *blog cube* is achieved by::
   160 For example, installing the *blog cube* is achieved by::
   166 
   161 
   167   pip install cubicweb-blog
   162   pip install cubicweb-blog
   168 
       
   169 .. _`gecode library`: http://www.gecode.org/
       
   170 
       
   171 
   163 
   172 .. _EasyInstallInstallation:
   164 .. _EasyInstallInstallation:
   173 
   165 
   174 `easy_install` install
   166 `easy_install` install
   175 ----------------------
   167 ----------------------
   176 
   168 
   177 If you are not a Windows user and you have a compilation environment,
   169 .. note::
   178 we recommend you to use the PipInstallation_.
   170 
   179 
   171    If you are not a Windows user and you have a compilation environment, we
   180 Install |cubicweb| version >= 3.9 with::
   172    recommend you to use the PipInstallation_.
       
   173 
       
   174 `easy_install`_ is a python utility that helps downloading, installing, and
       
   175 managing python packages and their dependencies.
       
   176 
       
   177 Install |cubicweb| and its dependencies, run::
   181 
   178 
   182   easy_install cubicweb
   179   easy_install cubicweb
   183 
   180 
   184 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can acces a
   181 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can access a
   185 list of availble cubes on `PyPI
   182 list of available cubes on `PyPI
   186 <http://pypi.python.org/pypi?%3Aaction=search&term=cubicweb&submit=search>`_
   183 <http://pypi.python.org/pypi?%3Aaction=search&term=cubicweb&submit=search>`_
   187 or at the `CubicWeb.org Forge`_. 
   184 or at the `CubicWeb.org Forge`_.
   188 
   185 
   189 For example, installing the *blog cube* is achieved by::
   186 For example, installing the *blog cube* is achieved by::
   190 
   187 
   191   easy_install cubicweb-blog
   188   easy_install cubicweb-blog
   192 
   189 
   193 .. note::
   190 .. note::
   194 
   191 
   195   If you encounter problem with :ref:`cubes <AvailableCubes>` installation,
   192   If you encounter problem with :ref:`cubes <AvailableCubes>` installation,
   196   considere using :ref:`PipInstallation` which is more stable
   193   consider using :ref:`PipInstallation` which is more stable
   197   but do not offer binaries installation.
   194   but can not installed pre-compiled binaries.
   198 
   195 
   199 .. _`easy_install`:   http://packages.python.org/distribute/easy_install.html
   196 .. _`easy_install`: http://packages.python.org/distribute/easy_install.html
   200 
   197 
   201 
   198 
   202 .. _SourceInstallation:
   199 .. _SourceInstallation:
   203 
   200 
   204 Install from source
   201 Install from source
   205 -------------------
   202 -------------------
   206 
   203 
   207 .. _TarballInstallation:
   204 .. _TarballInstallation:
   208 
   205 
   209 You can download the archive containing the sources from our download site at
   206 You can download the archive containing the sources from
   210 `http://download.logilab.org/pub/cubicweb/ <http://download.logilab.org/pub/cubicweb/>`_.
   207 `http://download.logilab.org/pub/cubicweb/ <http://download.logilab.org/pub/cubicweb/>`_.
   211 
   208 
   212 Make sure you also have all the :ref:`InstallDependencies`.
   209 Make sure you also have all the :ref:`InstallDependencies`.
   213 
   210 
   214 Once uncompressed, you can install the framework from inside the uncompressed
   211 Once uncompressed, you can install the framework from inside the uncompressed
   218 
   215 
   219 Or you can run |cubicweb| directly from the source directory by
   216 Or you can run |cubicweb| directly from the source directory by
   220 setting the :ref:`resource mode <RessourcesConfiguration>` to `user`. This will
   217 setting the :ref:`resource mode <RessourcesConfiguration>` to `user`. This will
   221 ease the development with the framework.
   218 ease the development with the framework.
   222 
   219 
   223 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can acces a
   220 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can access a
   224 list of availble cubes at the `CubicWeb.org Forge`_.
   221 list of availble cubes at the `CubicWeb.org Forge`_.
   225 
   222 
   226 
   223 
   227 .. _MercurialInstallation:
   224 .. _MercurialInstallation:
   228 
   225 
   229 Install from version control system
   226 Install from version control system
   230 -----------------------------------
   227 -----------------------------------
   231 
   228 
   232 To install the lastest stable development version from our Mercurial
   229 To keep-up with on-going development, clone the :ref:`Mercurial
   233 repository, you can use `pip` (you need a compilation devlopment to perform
   230 <MercurialPresentation>` repository::
   234 such install)::
       
   235 
       
   236   pip install -e "hg+http://www.logilab.org/hg/cubicweb/@stable#egg=cubicweb"
       
   237 
       
   238 Or, to develop with the framework you can keep up to date with on-going
       
   239 development by cloning our :ref:`Mercurial <MercurialPresentation>`
       
   240 repository::
       
   241 
   231 
   242   hg clone -u stable http://hg.logilab.org/cubicweb # stable branch
   232   hg clone -u stable http://hg.logilab.org/cubicweb # stable branch
   243   hg clone http://hg.logilab.org/cubicweb # very lastest (development branch)
   233   hg clone http://hg.logilab.org/cubicweb # development branch
   244 
   234 
   245 Then a practical way to get many of CubicWeb's dependencies and a nice set
   235 To get many of CubicWeb's dependencies and a nice set of base cubes, run the
   246 of base cubes is to run the `clone_deps.py` script located in
   236 `clone_deps.py` script located in `cubicweb/bin/`::
   247 `cubicweb/bin/`::
       
   248 
   237 
   249   python cubicweb/bin/clone_deps.py
   238   python cubicweb/bin/clone_deps.py
   250 
   239 
   251 (Windows users should replace slashes with antislashes).
   240 (Windows users should replace slashes with antislashes).
   252 
   241 
   256 
   245 
   257 .. note::
   246 .. note::
   258 
   247 
   259   In every cloned repositories, a `hg tags` will display a list of
   248   In every cloned repositories, a `hg tags` will display a list of
   260   tags in reverse chronological order. One reasonnable option is to go to a
   249   tags in reverse chronological order. One reasonnable option is to go to a
   261   taged version: the latest published version or example, as done by
   250   tagged version: the latest published version or example, as done by
   262   the `clone_deps` script)::
   251   the `clone_deps` script)::
   263 
   252 
   264    hg update cubicweb-debian-version-3.10.7-1
   253    hg update cubicweb-version-3.12.2
   265 
   254 
   266 Make sure you also have all the :ref:`InstallDependencies`.
   255 Make sure you also have all the :ref:`InstallDependencies`.
   267 
   256 
   268 .. _`pip`: http://pip.openplans.org/
       
   269 .. _`virtualenv`: http://virtualenv.openplans.org/