doc/book/admin/setup.rst
changeset 10491 c67bcee93248
parent 10022 927a795bb380
child 10523 f245d865821e
equal deleted inserted replaced
10490:76ab3c71aff2 10491:c67bcee93248
       
     1 .. -*- coding: utf-8 -*-
       
     2 
       
     3 .. _SetUpEnv:
       
     4 
       
     5 Installation of a *CubicWeb* environment
       
     6 ========================================
       
     7 
       
     8 Official releases are available from the `CubicWeb.org forge`_ and from
       
     9 `PyPI`_. Since CubicWeb is developed using `Agile software development
       
    10 <http://en.wikipedia.org/wiki/Agile_software_development>`_ techniques, releases
       
    11 happen frequently. In a version numbered X.Y.Z, X changes after a few years when
       
    12 the API breaks, Y changes after a few weeks when features are added and Z
       
    13 changes after a few days when bugs are fixed.
       
    14 
       
    15 Depending on your needs, you will chose a different way to install CubicWeb on
       
    16 your system:
       
    17 
       
    18 - `Installation on Debian/Ubuntu`_
       
    19 - `Installation on Windows`_
       
    20 - `Installation in a virtualenv`_
       
    21 - `Installation with pip`_
       
    22 - `Installation with easy_install`_
       
    23 - `Installation from tarball`_
       
    24 
       
    25 If you are a power-user and need the very latest features, you will
       
    26 
       
    27 - `Install from version control`_
       
    28 
       
    29 Once the software is installed, move on to :ref:`ConfigEnv` for better control
       
    30 and advanced features of |cubicweb|.
       
    31 
       
    32 .. _`Installation on Debian/Ubuntu`: DebianInstallation_
       
    33 .. _`Installation on Windows`: WindowsInstallation_
       
    34 .. _`Installation in a virtualenv`: VirtualenvInstallation_
       
    35 .. _`Installation with pip`: PipInstallation_
       
    36 .. _`Installation with easy_install`: EasyInstallInstallation_
       
    37 .. _`Installation from tarball`: TarballInstallation_
       
    38 .. _`Install from version control`: MercurialInstallation_
       
    39 
       
    40 
       
    41 .. _DebianInstallation:
       
    42 
       
    43 Debian/Ubuntu install
       
    44 ---------------------
       
    45 
       
    46 |cubicweb| is packaged for Debian/Ubuntu (and derived
       
    47 distributions). Their integrated package-management system make
       
    48 installation and upgrade much easier for users since
       
    49 dependencies (like databases) are automatically installed.
       
    50 
       
    51 Depending on the distribution you are using, add the appropriate line to your
       
    52 `list of sources` (for example by editing ``/etc/apt/sources.list``).
       
    53 
       
    54 For Debian 7.0 Wheezy (stable)::
       
    55 
       
    56   deb http://download.logilab.org/production/ wheezy/
       
    57 
       
    58 For Debian Sid (unstable)::
       
    59 
       
    60   deb http://download.logilab.org/production/ sid/
       
    61 
       
    62 For Ubuntu 12.04 Precise Pangolin (Long Term Support) and newer::
       
    63 
       
    64   deb http://download.logilab.org/production/ precise/
       
    65 
       
    66 The repositories are signed with the `Logilab's gnupg key`_. You can download
       
    67 and register the key to avoid warnings::
       
    68 
       
    69   wget -q http://download.logilab.org/logilab-dists-key.asc -O- | sudo apt-key add -
       
    70 
       
    71 Update your list of packages and perform the installation::
       
    72 
       
    73   apt-get update
       
    74   apt-get install cubicweb cubicweb-dev
       
    75 
       
    76 ``cubicweb`` installs the framework itself, allowing you to create new
       
    77 instances. ``cubicweb-dev`` installs the development environment
       
    78 allowing you to develop new cubes.
       
    79 
       
    80 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can access a
       
    81 list of available cubes using ``apt-cache search cubicweb`` or at the
       
    82 `CubicWeb.org forge`_.
       
    83 
       
    84 .. note::
       
    85 
       
    86   `cubicweb-dev` will install basic sqlite support. You can easily setup
       
    87   :ref:`cubicweb with other database <DatabaseInstallation>` using the following
       
    88   virtual packages :
       
    89 
       
    90   * `cubicweb-postgresql-support` contains the necessary dependencies for
       
    91     using :ref:`cubicweb with postgresql datatabase <PostgresqlConfiguration>`
       
    92 
       
    93   * `cubicweb-mysql-support` contains the necessary dependencies for using
       
    94     :ref:`cubicweb with mysql database <MySqlConfiguration>`.
       
    95 
       
    96 .. _`list of sources`: http://wiki.debian.org/SourcesList
       
    97 .. _`Logilab's gnupg key`: http://download.logilab.org/logilab-dists-key.asc
       
    98 .. _`CubicWeb.org Forge`: http://www.cubicweb.org/project/
       
    99 
       
   100 .. _WindowsInstallation:
       
   101 
       
   102 Windows Install
       
   103 ---------------
       
   104 
       
   105 You need to have `python`_ version >= 2.5 and < 3 installed.
       
   106 
       
   107 If you want an automated install, your best option is probably the
       
   108 :ref:`EasyInstallInstallation`. EasyInstall is a tool that helps users to
       
   109 install python packages along with their dependencies, searching for suitable
       
   110 pre-compiled binaries on the `The Python Package Index`_.
       
   111 
       
   112 If you want better control over the process as well as a suitable development
       
   113 environment or if you are having problems with `easy_install`, read on to
       
   114 :ref:`SetUpWindowsEnv`.
       
   115 
       
   116 .. _python:  http://www.python.org/
       
   117 .. _`The Python Package Index`: http://pypi.python.org
       
   118 
       
   119 .. _VirtualenvInstallation:
       
   120 
       
   121 `Virtualenv` install
       
   122 --------------------
       
   123 
       
   124 |cubicweb| can be safely installed, used and contained inside a
       
   125 `virtualenv`_. You can use either :ref:`pip <PipInstallation>` or
       
   126 :ref:`easy_install <EasyInstallInstallation>` to install |cubicweb|
       
   127 inside an activated virtual environment.
       
   128 
       
   129 .. _PipInstallation:
       
   130 
       
   131 `pip` install
       
   132 -------------
       
   133 
       
   134 `pip <http://pip.openplans.org/>`_ is a python tool that helps downloading,
       
   135 building, installing, and managing Python packages and their dependencies. It
       
   136 is fully compatible with `virtualenv`_ and installs the packages from sources
       
   137 published on the `The Python Package Index`_.
       
   138 
       
   139 .. _`virtualenv`: http://virtualenv.openplans.org/
       
   140 
       
   141 A working compilation chain is needed to build the modules that include C
       
   142 extensions. If you really do not want to compile anything, installing `lxml <http://lxml.de/>`_,
       
   143 `Twisted Web <http://twistedmatrix.com/trac/wiki/Downloads/>`_ and `libgecode
       
   144 <http://www.gecode.org/>`_ will help.
       
   145 
       
   146 For Debian, these minimal dependencies can be obtained by doing::
       
   147 
       
   148   apt-get install gcc python-pip python-dev python-lxml
       
   149 
       
   150 or, if you prefer to get as much as possible from pip::
       
   151 
       
   152   apt-get install gcc python-pip python-dev libxslt1-dev libxml2-dev
       
   153 
       
   154 For Windows, you can install pre-built packages (possible `source
       
   155 <http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_). For a minimal setup, install:
       
   156 
       
   157 - pip http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip
       
   158 - setuptools http://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools
       
   159 - libxml-python http://www.lfd.uci.edu/~gohlke/pythonlibs/#libxml-python>
       
   160 - lxml http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml and
       
   161 - twisted http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
       
   162 
       
   163 Make sure to choose the correct architecture and version of Python.
       
   164 
       
   165 Finally, install |cubicweb| and its dependencies, by running::
       
   166 
       
   167   pip install cubicweb
       
   168 
       
   169 Many other :ref:`cubes <AvailableCubes>` are available. A list is available at
       
   170 `PyPI <http://pypi.python.org/pypi?%3Aaction=search&term=cubicweb&submit=search>`_
       
   171 or at the `CubicWeb.org forge`_.
       
   172 
       
   173 For example, installing the *blog cube* is achieved by::
       
   174 
       
   175   pip install cubicweb-blog
       
   176 
       
   177 .. _EasyInstallInstallation:
       
   178 
       
   179 `easy_install` install
       
   180 ----------------------
       
   181 
       
   182 .. note::
       
   183 
       
   184    If you are not a Windows user and you have a compilation environment, we
       
   185    recommend you to use the PipInstallation_.
       
   186 
       
   187 `easy_install`_ is a python utility that helps downloading, installing, and
       
   188 managing python packages and their dependencies.
       
   189 
       
   190 Install |cubicweb| and its dependencies, run::
       
   191 
       
   192   easy_install cubicweb
       
   193 
       
   194 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can access a
       
   195 list of available cubes on `PyPI
       
   196 <http://pypi.python.org/pypi?%3Aaction=search&term=cubicweb&submit=search>`_
       
   197 or at the `CubicWeb.org Forge`_.
       
   198 
       
   199 For example, installing the *blog cube* is achieved by::
       
   200 
       
   201   easy_install cubicweb-blog
       
   202 
       
   203 .. note::
       
   204 
       
   205   If you encounter problem with :ref:`cubes <AvailableCubes>` installation,
       
   206   consider using :ref:`PipInstallation` which is more stable
       
   207   but can not installed pre-compiled binaries.
       
   208 
       
   209 .. _`easy_install`: http://packages.python.org/distribute/easy_install.html
       
   210 
       
   211 
       
   212 .. _SourceInstallation:
       
   213 
       
   214 Install from source
       
   215 -------------------
       
   216 
       
   217 .. _TarballInstallation:
       
   218 
       
   219 You can download the archive containing the sources from
       
   220 `http://download.logilab.org/pub/cubicweb/ <http://download.logilab.org/pub/cubicweb/>`_.
       
   221 
       
   222 Make sure you also have all the :ref:`InstallDependencies`.
       
   223 
       
   224 Once uncompressed, you can install the framework from inside the uncompressed
       
   225 folder with::
       
   226 
       
   227   python setup.py install
       
   228 
       
   229 Or you can run |cubicweb| directly from the source directory by
       
   230 setting the :ref:`resource mode <RessourcesConfiguration>` to `user`. This will
       
   231 ease the development with the framework.
       
   232 
       
   233 There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can access a
       
   234 list of availble cubes at the `CubicWeb.org Forge`_.
       
   235 
       
   236 
       
   237 .. _MercurialInstallation:
       
   238 
       
   239 Install from version control system
       
   240 -----------------------------------
       
   241 
       
   242 To keep-up with on-going development, clone the :ref:`Mercurial
       
   243 <MercurialPresentation>` repository::
       
   244 
       
   245   hg clone -u stable http://hg.logilab.org/cubicweb # stable branch
       
   246   hg clone http://hg.logilab.org/cubicweb # development branch
       
   247 
       
   248 To get many of CubicWeb's dependencies and a nice set of base cubes, run the
       
   249 `clone_deps.py` script located in `cubicweb/bin/`::
       
   250 
       
   251   python cubicweb/bin/clone_deps.py
       
   252 
       
   253 (Windows users should replace slashes with antislashes).
       
   254 
       
   255 This script will clone a set of mercurial repositories into the
       
   256 directory containing the ``cubicweb`` repository, and update them to the
       
   257 latest published version tag (if any).
       
   258 
       
   259 .. note::
       
   260 
       
   261   In every cloned repositories, a `hg tags` will display a list of
       
   262   tags in reverse chronological order. One reasonnable option is to go to a
       
   263   tagged version: the latest published version or example, as done by
       
   264   the `clone_deps` script)::
       
   265 
       
   266    hg update cubicweb-version-3.12.2
       
   267 
       
   268 Make sure you also have all the :ref:`InstallDependencies`.
       
   269