From f04f409943b8bd8f4bd2653e368523d1cc0d8246 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 15 Dec 2014 15:55:34 +0100 Subject: [PATCH] [ADD] doc: setup documentation * Odoo installation from packages or source * Deployment instructions for production environments * dbfilter Add missing support for disabling xmlrpc(/http), useful for WSGI deployments which require running cron-only Odoo instances. --- doc/howtos/backend.rst | 4 + doc/howtos/web.rst | 2 +- doc/howtos/website.rst | 2 +- doc/index.rst | 1 + doc/reference/cmdline.rst | 246 +++++++++++++++++++++++++-- doc/setup.rst | 9 + doc/setup/deploy.rst | 246 +++++++++++++++++++++++++++ doc/setup/install.rst | 348 ++++++++++++++++++++++++++++++++++++++ openerp/service/server.py | 11 +- openerp/tools/config.py | 6 +- 10 files changed, 848 insertions(+), 27 deletions(-) create mode 100644 doc/setup.rst create mode 100644 doc/setup/deploy.rst create mode 100644 doc/setup/install.rst diff --git a/doc/howtos/backend.rst b/doc/howtos/backend.rst index e1ba28e3324..fcbc10e3721 100644 --- a/doc/howtos/backend.rst +++ b/doc/howtos/backend.rst @@ -4,6 +4,10 @@ Building a Module ================= +.. warning:: + + This tutorial requires :ref:`having installed Odoo ` + Start/Stop the Odoo server ========================== diff --git a/doc/howtos/web.rst b/doc/howtos/web.rst index ba8337ffd34..2fe16cd3a2d 100644 --- a/doc/howtos/web.rst +++ b/doc/howtos/web.rst @@ -19,7 +19,7 @@ or extend existing business systems of Odoo, see :doc:`backend`. * jQuery_ * `Underscore.js`_ - It also requires an installed Odoo, and Git_. + It also requires :ref:`an installed Odoo `, and Git_. A Simple Module diff --git a/doc/howtos/website.rst b/doc/howtos/website.rst index 5092cac5df6..6ec9fddc76c 100644 --- a/doc/howtos/website.rst +++ b/doc/howtos/website.rst @@ -8,7 +8,7 @@ Building a Website * This guide assumes `basic knowledge of Python `_ - * This guide assumes an installed Odoo + * This guide assumes :ref:`an installed Odoo ` Creating a basic module ======================= diff --git a/doc/index.rst b/doc/index.rst index 45394cdfd58..3bb952e4383 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -11,6 +11,7 @@ Odoo Technical Documentation :maxdepth: 2 tutorials + setup reference api_integration diff --git a/doc/reference/cmdline.rst b/doc/reference/cmdline.rst index e0713410981..269f62ed2eb 100644 --- a/doc/reference/cmdline.rst +++ b/doc/reference/cmdline.rst @@ -11,36 +11,83 @@ Running the server .. program:: odoo.py -.. option:: -d , --database= +.. option:: -d , --database database used when installing or updating modules. -.. option:: --db-filter= - - hides databases that do not match ````. The filter is a - `regular expression`_, with the additions that: - - - ``%h`` is replaced by the whole hostname the request is made on. - - ``%d`` is replaced by the subdomain the request is made on, with the - exception of ``www`` (so domain ``odoo.com`` and ``www.odoo.com`` both - match the database ``odoo``) - -.. option:: -i , --init= +.. option:: -i , --init comma-separated list of modules to install before running the server (requires :option:`-d`). -.. option:: -u , --update= +.. option:: -u , --update comma-separated list of modules to update before running the server (requires :option:`-d`). -.. option:: --addons-path= +.. option:: --addons-path comma-separated list of directories in which modules are stored. These directories are scanned for modules (nb: when and why?) -.. option:: -c , --config= +.. option:: --workers + + if ``count`` is not 0 (the default), enables multiprocessing and sets up + the specified number of HTTP workers (sub-processes processing HTTP + and RPC requests). + + .. note:: multiprocessing mode is only available on Unix-based systems + + A number of options allow limiting and recyling workers: + + .. option:: --limit-request + + Number of requests a worker will process before being recycled and + restarted. + + Defaults to 8196. + + .. option:: --limit-memory-soft + + Maximum allowed virtual memory per worker. If the limit is exceeded, + the worker is killed and recycled at the end of the current request. + + Defaults to 640MB. + + .. option:: --limit-memory-hard + + Hard limit on virtual memory, any worker exceeding the limit will be + immediately killed without waiting for the end of the current request + processing. + + Defaults to 768MB. + + .. option:: --limit-time-cpu + + Prevents the worker from using more than CPU seconds for each + request. If the limit is exceeded, the worker is killed. + + Defaults to 60. + + .. option:: --limit-time-real + + Prevents the worker from taking longer than seconds to process + a request. If the limit is exceeded, the worker is killed. + + Differs from :option:`--limit-time-cpu` in that this is a "wall time" + limit including e.g. SQL queries. + + Defaults to 120. + +.. option:: --max-cron-threads + + number of workers dedicated to cron jobs. Defaults to 2. The workers are + threads in multithreading mode and processes in multiprocessing mode. + + For multiprocessing mode, this is in addition to the HTTP worker + processes. + +.. option:: -c , --config provide an alternate configuration file @@ -50,6 +97,14 @@ Running the server (:file:`{$HOME}/.openerp_serverrc` by default, overridable using :option:`-c`) +.. option:: --proxy-mode + + enables the use of ``X-Forwarded-*`` headers through `Werkzeug's proxy + support`_. + + .. warning:: proxy mode *must not* be enabled outside of a reverse proxy + scenario + .. option:: --test-enable runs tests after installing modules @@ -60,6 +115,140 @@ Running the server automatically starts :mod:`python:pdb` before logging and returning the error +.. _reference/cmdline/server/database: + +database +-------- + +.. option:: -r , --db_user + + database username, used to connect to PostgreSQL. + +.. option:: -w , --db_password + + database password, if using `password authentication`_. + +.. option:: --db_host + + host for the database server + + * ``localhost`` on Windows + * UNIX socket otherwise + +.. option:: --db_port + + port the database listens on, defaults to 5432 + +.. option:: --db-filter + + hides databases that do not match ````. The filter is a + `regular expression`_, with the additions that: + + - ``%h`` is replaced by the whole hostname the request is made on. + - ``%d`` is replaced by the subdomain the request is made on, with the + exception of ``www`` (so domain ``odoo.com`` and ``www.odoo.com`` both + match the database ``odoo``) + +.. option:: --db-template