source: trunk/docs/kernel/configuration.rst @ 737

Last change on this file since 737 was 725, checked in by djay, 9 years ago

Fix issue with rst files displayed from Trac. Fix strings to be translated. Always use the same string in all messages.

  • Property svn:keywords set to Date Author
  • Property svn:mime-type set to text/plain
File size: 7.4 KB
Line 
1.. _kernel_config:
2
3ZOO-Kernel configuration
4========================
5
6Main configuration file
7-----------------------
8
9ZOO-Kernel general settings are defined in a configuration file called
10``main.cfg``. This file is stored in the same directory as ZOO-Kernel
11(``/usr/lib/cgi-bin/`` in most cases). It provides usefull metadata information on your ZOO-Kernel installation.     
12
13.. warning::
14  ZOO-Kernel (``/usr/lib/cgi-bin/zoo_loader.cgi``) and its
15  configuration file (``/usr/lib/cgi-bin/main.cfg``) must be in the
16  same directory.
17 
18.. note::
19  Information contained by ``/usr/lib/cgi-bin/main.cfg`` is accessible from WPS Services at runtime, so when *Execute* requests are used.
20
21Default main.cfg
22...............................
23
24An example *main.cfg* file is given here as reference.
25
26.. code-block:: guess
27    :linenos:
28   
29    [headers]
30    X-Powered-By=ZOO@ZOO-Project
31   
32    [main]
33    version=1.0.0
34    encoding=utf-8
35    dataPath=/var/data
36    tmpPath=/var/www/temp
37    cacheDir=/var/www/cache
38    sessPath=/tmp
39    serverAddress=http://localhost/cgi-bin/zoo_loader.cgi
40    lang=fr-FR,ja-JP
41    language=en-US
42    mapserverAddress=http://localhost/cgi-bin/mapserv.cgi
43    msOgcVersion=1.0.0
44    tmpUrl=http:/localhost/temp/
45   
46    [identification]
47    keywords=t,ZOO-Project, ZOO-Kernel,WPS,GIS
48    title=ZOO-Project demo instance
49    abstract= This is ZOO-Project, the Open WPS platform.
50    accessConstraints=none
51    fees=None
52   
53    [provider]
54    positionName=Developer
55    providerName=GeoLabs SARL
56    addressAdministrativeArea=False
57    addressDeliveryPoint=1280, avenue des Platanes
58    addressCountry=fr
59    phoneVoice=+33467430995
60    addressPostalCode=34970
61    role=Dev
62    providerSite=http://geolabs.fr
63    phoneFacsimile=False
64    addressElectronicMailAddress=gerald@geolabs.fr
65    addressCity=Lattes
66    individualName=Gerald FENOY
67
68
69Main section
70...............................
71
72The main.cfg ``[main]`` section parameters are explained bellow.
73
74 * ``version``: Supported WPS version.
75 * ``encoding``: Default encoding of WPS Responses.
76 * ``dataPath``: Path to the directory where data files are stored (used to store mapfiles and data when MapServer support is activated).
77 * ``tmpPath``: Path to the directory where temporary files are stored (such as *ExecuteResponse* when *storeExecuteResponse* is set to true).
78 * ``cacheDir``: Path to  the directory where cached request files [#f1]_ are stored (optional).
79 * ``serverAddress``: URL to the ZOO-Kernel instance.
80 * ``tmpUrl``: URL of the temporary files directory.
81 * ``mapservAddress``: URL to the MapServer instance (optional).
82 * ``msOgcVersion``: Version of all supported OGC Web Services output [#f2]_
83   (optional).
84 * ``lang``: Supported natural languages separated by a coma (the first is the default one),
85
86
87Identification and Provider
88..........................................
89
90The ``[identification]`` and ``[provider]`` sections are not ZOO-Project
91specific. They provide OGC metadata [#f3]_ and should be set according
92to the `XML Schema Document
93<http://schemas.opengis.net/ows/1.1.0/ows19115subset.xsd>`__ which
94encodes the parts of ISO 19115 used by the common
95*ServiceIdentification* and *ServiceProvider* sections of the
96*GetCapabilities* operation response, known as the service metadata
97XML document.
98
99Details of the common OWS 1.1.0 *ServiceIdentification* section can be
100found in this `XML Schema Document
101<http://schemas.opengis.net/ows/1.1.0/owsServiceIdentification.xsd>`__.
102
103Details of the common OWS 1.1.0 *ServiceProvider* section can be
104found in this `XML Schema Document
105<http://schemas.opengis.net/ows/1.1.0/owsServiceProvider.xsd>`__.
106
107
108Additional sections
109--------------------------------
110
111Headers section
112...............................
113
114The ``[headers]`` section can be set in order to define a specific HTTP
115Response header, which will be used for every response. As an example,
116you can check http://zoo-project.org using *curl* command line tool
117and notice the specific header *X-Powered-By: Zoo-Project@Trac*.
118
119env section
120...............................
121
122The ``[env]`` section can be used to store specific environment
123variables to be set prior the loading of *Services Provider* and Service execution.
124
125A typical example is when a Service requires the access to a X server
126running on *framebuffer*, which takes to set the DISPLAY environnement
127variable, as follow:
128
129.. code-block:: guess
130    :linenos:
131   
132    [env]
133    DISPLAY=:1
134
135lenv section
136...............................
137
138The ``lenv`` can be used to store runtime informations automatically
139set by ZOO-Kernel before and during the execution of a WPS service,
140with the following parameters:
141
142 * ``sid`` (r): The WPS Service unique identifier,
143 * ``status`` (rw): The current progress value ( a value between 0 and
144   100 in percent (**%**) ),
145 * ``cwd`` (r): The current working directory of ZOO-Kernel,
146 * ``message`` (rw): An error message used when ``SERVICE_FAILED`` is returned (optional),
147 * ``cookie`` (rw): The cookie to be returned to the client (for
148   example for authentication purpose).
149
150senv section
151...............................
152
153The ``senv`` section can be used to store sessions information on the
154server side. Such information can then be accessed automatically from
155the Service if the server is requested using a valid cookie (as
156defined in ``lenv`` section). ZOO-Kernel will store the values set in the
157``senv`` maps on disk, load it and dynamically replace its content to
158the one in the ``main.cfg``. The ``senv`` section must contain the
159following parameter at least:
160
161 * ``XXX``: The session unique identifier where ``XXX`` is the name
162   included in the cookie which is returned.
163
164.. _cookie_example:
165
166For instance, adding the following in the Service source code  :
167
168.. code:: python
169   
170    conf["lenv"]["cookie"]="XXX=XXX1000000; path=/"
171    conf["senv"]={"XXX": "XXX1000000","login": "demoUser"}
172
173means that ZOO-Kernel will create a file named ``sess_XXX1000000.cfg``
174in the ``cacheDir`` directory, and will return the specified cookie to the client. Each time the client will
175request ZOO-Kernel using this cookie, it will automatically load the
176value stored before the Service execution.
177
178.. _zoo_activate_db_backend:
179
180Database section
181...............................
182
183The database section allows to configure the
184:ref:`ZOO-Kernel optional database support <zoo_install_db_backend>`.
185
186.. code-block:: guess
187
188        [database]
189        dbname=zoo_project
190        port=5432
191        user=username
192        host=127.0.0.1
193        type=PG
194        schema=public
195
196This will generate strings to be passed to GDAL to connect the
197database server:
198
199.. code-block:: guess
200   
201    <type>:host=<host> port=<port>  user=<user> dbname=<dbname>
202
203
204With the previous database section, it will give the following:
205
206.. code-block:: guess
207
208    PG:"dbname=zoo_project host=127.0.0.1 port=5432 user=username"
209
210Please refer to this `section <zoo_create_db_backend>`_ to learn how
211to setup the database.
212
213     
214.. rubric:: Footnotes
215
216.. [#f1] If GET requests are passed through ``xlink:href`` to the ZOO-Kernel , the latter will execute the request the first time and store the result  on disk. The next time the same request is executed, the cached file will be used and this will make your process run much faster. If ``cachedir`` was not specified in the ``main.cfg`` then the ``tmpPath`` value will be used.
217.. [#f2] Usefull when the :ref:`kernel-mapserver` is activated (available since ZOO-Project version 1.3.0).
218.. [#f3] ZOO-Kernel and MapServer are sharing the same metadata for OGC Web Services if the :ref:`kernel-mapserver` is activated.
219
220   
Note: See TracBrowser for help on using the repository browser.

Search

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png