[659] | 1 | .. _install-installation: |
---|
| 2 | |
---|
| 3 | Installation on Unix/Linux |
---|
[696] | 4 | ========================== |
---|
[659] | 5 | |
---|
[696] | 6 | To build and install ZOO-Project on your Web Server you will need 4 |
---|
| 7 | steps : |
---|
| 8 | |
---|
[713] | 9 | .. contents:: |
---|
| 10 | :local: |
---|
| 11 | :depth: 1 |
---|
| 12 | :backlinks: top |
---|
[696] | 13 | |
---|
[713] | 14 | |
---|
[696] | 15 | Build cgic |
---|
| 16 | ---------- |
---|
| 17 | |
---|
| 18 | Run the following commands from the ``thirds/cgic`` directory to build |
---|
| 19 | the cgic library. |
---|
| 20 | |
---|
| 21 | :: |
---|
| 22 | |
---|
| 23 | cd thirds/cgic |
---|
| 24 | make |
---|
| 25 | |
---|
| 26 | The cgic library originaly come from `http://www.boutell.com/cgic |
---|
| 27 | <http://www.boutell.com/cgic>`_. |
---|
| 28 | |
---|
| 29 | .. warning:: |
---|
| 30 | |
---|
| 31 | You may need to edit the ``Makefile`` in case you are using a 64 bits |
---|
| 32 | platform for building and your fcgi library is not located in ``/usr/lib64``. |
---|
| 33 | |
---|
[714] | 34 | Install ZOO-Kernel |
---|
| 35 | ------------------ |
---|
[696] | 36 | |
---|
| 37 | |
---|
[659] | 38 | For the impatient |
---|
[696] | 39 | ................. |
---|
[659] | 40 | |
---|
| 41 | Run the following commands from the directory where you :ref:`install-download` and extracted the ZOO Kernel source code in order to build the ``zoo_loader.cgi`` CGI program with default options. |
---|
| 42 | |
---|
| 43 | :: |
---|
| 44 | |
---|
[696] | 45 | cd zoo-project/zoo-kernel |
---|
[659] | 46 | autoconf |
---|
| 47 | ./configure |
---|
| 48 | make |
---|
[696] | 49 | make install |
---|
[659] | 50 | |
---|
[696] | 51 | This should produce executables for the *zoo_loader.cgi* CGI program |
---|
| 52 | (located per default in ``/usr/lib/cgi-bin/``) and a shared library |
---|
| 53 | ``libzoo_service`` (located per default in ``/usr/local/lib``). |
---|
[659] | 54 | |
---|
| 55 | .. warning:: |
---|
| 56 | |
---|
[696] | 57 | Edit ZOO-Kernel installation settings in the ``main.cfg`` file (set |
---|
| 58 | ``tmpPath`` and ``tmpUrl`` to fit your web server configuration). |
---|
[659] | 59 | |
---|
| 60 | |
---|
[696] | 61 | Configure options |
---|
| 62 | ................. |
---|
[659] | 63 | |
---|
[714] | 64 | This section provides information on :ref:`kernel_index` configure options. It is recommanded to also read the :ref:`kernel_config` section for configuration technical details. |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | Here is the list of available options in the same order as returned by |
---|
| 68 | ``./configure --help`` command: |
---|
| 69 | |
---|
[713] | 70 | .. contents:: |
---|
| 71 | :local: |
---|
| 72 | :depth: 2 |
---|
| 73 | :backlinks: top |
---|
| 74 | |
---|
| 75 | Specific CGI Directory |
---|
| 76 | ********************** |
---|
[659] | 77 | |
---|
[713] | 78 | In the case your ``cgi-bin`` is not located in ``/usr/lib/`` as it is |
---|
| 79 | assumed per default, then you can specify a specific target location |
---|
| 80 | by using the following option: |
---|
[659] | 81 | |
---|
[713] | 82 | .. code:: |
---|
[659] | 83 | |
---|
[713] | 84 | ./configure --with-cgi-dir=/Lbrary/WebServer/CGI-Executables |
---|
[659] | 85 | |
---|
[713] | 86 | This way, when you will run the ``make install`` command, the |
---|
| 87 | ZOO-Kernel will be deployed in the specified directory (so, |
---|
| 88 | `/Lbrary/WebServer/CGI-Executables`` in this example). |
---|
[659] | 89 | |
---|
[711] | 90 | .. _zoo_install_db_backend: |
---|
| 91 | |
---|
[700] | 92 | Use a Database Backend (Optional) |
---|
[713] | 93 | ********************************** |
---|
[659] | 94 | |
---|
[700] | 95 | If you want to share the ongoing informations of running services |
---|
[713] | 96 | between various ZOO-Kernel instances then you should use this |
---|
| 97 | option: ``--with-db-backend``. This way, both the *GetStatus*, |
---|
| 98 | *GetResult* and *Dismiss* requests can be run from any host accessing |
---|
| 99 | the same database. Obviously, this will require that the ZOO-Kernel is |
---|
| 100 | able to access the Database server. To learn how to configure this |
---|
| 101 | connection and how to create this database please refer to :ref:`[1] |
---|
| 102 | <zoo_activate_db_backend>` and :ref:`[2] <zoo_create_db_backend>` |
---|
| 103 | respectively. |
---|
[700] | 104 | |
---|
| 105 | .. note:: |
---|
| 106 | By now, the ZOO-Kernel is not able to handle correctly the |
---|
| 107 | *Dismiss* request from any host. Nevertheless, it will provide |
---|
| 108 | valid response from any host, but only the host which is really |
---|
| 109 | handling the service will be able to stop it and remove all the |
---|
| 110 | linked files. |
---|
| 111 | |
---|
[722] | 112 | .. _zoo_create_db_backend: |
---|
| 113 | |
---|
| 114 | To create a new database to be used by the ZOO-Kernel, you have |
---|
| 115 | to load the `schema.sql |
---|
| 116 | <http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-kernel/sql/schema.sql>`_ |
---|
| 117 | file. For instance, you may run the following: |
---|
| 118 | |
---|
| 119 | .. code:: |
---|
| 120 | |
---|
| 121 | createdb zoo_project |
---|
| 122 | psql zoo_project -f zoo-project/zoo-kernel/sql/schema.sql |
---|
| 123 | |
---|
| 124 | .. note:: |
---|
| 125 | You can choose another schema to store ZOO-Kernel specific |
---|
| 126 | informations. In such a case, you would need to edit the |
---|
| 127 | schema.sql file to uncomment line `33 |
---|
| 128 | <http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-kernel/sql/schema.sql#L33>`_ |
---|
| 129 | and `34 |
---|
| 130 | <http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-kernel/sql/schema.sql#L34>`_. |
---|
| 131 | |
---|
| 132 | |
---|
| 133 | |
---|
[714] | 134 | YAML Support (Optional) |
---|
| 135 | ************************ |
---|
[700] | 136 | |
---|
[714] | 137 | If ``yaml.h`` file is not found in your ``/usr/include`` directory and |
---|
| 138 | ``libyaml.so`` is not found in ``/usr/lib``, a ``--with-yaml`` option |
---|
| 139 | can be used to specify its location. For instance, if the headeer file |
---|
| 140 | lies in ``/usr/local/include`` and the shared library is located in |
---|
| 141 | ``/usr/local/lib``, you may use the following command: |
---|
[700] | 142 | |
---|
[714] | 143 | :: |
---|
[713] | 144 | |
---|
[714] | 145 | $ ./configure --with-yaml=/usr/local |
---|
| 146 | |
---|
| 147 | |
---|
| 148 | FastCGI Support (Required) |
---|
| 149 | *************************** |
---|
| 150 | |
---|
| 151 | If your FastCGI library is not available in the default search path, a |
---|
| 152 | ``--with-fastcgi`` option can be used to specify its location. For |
---|
| 153 | instance, if ``libfcgi.so`` lies in ``/usr/local/lib`` which is not in |
---|
| 154 | your ``LD_SEARCH_PATH``, you may use the following command: |
---|
| 155 | |
---|
| 156 | :: |
---|
| 157 | |
---|
| 158 | $ ./configure --with-fastcgi=/usr/local |
---|
| 159 | |
---|
| 160 | |
---|
| 161 | |
---|
[713] | 162 | GDAL Support (Required) |
---|
| 163 | ************************ |
---|
| 164 | |
---|
| 165 | If gdal-config program is not found in your ``PATH``, a |
---|
| 166 | ``--with-gdal-config`` option can be used to specify its location. For |
---|
| 167 | instance, if ``gdal-config`` lies in ``/usr/local/bin`` which is not in |
---|
[714] | 168 | your ``PATH``, you may use the following command: |
---|
[713] | 169 | |
---|
| 170 | :: |
---|
| 171 | |
---|
| 172 | $ ./configure --with-gdal-config=/usr/local/bin/gdal-config |
---|
| 173 | |
---|
[714] | 174 | |
---|
| 175 | GEOS Support (Optional) |
---|
| 176 | ************************ |
---|
| 177 | |
---|
| 178 | If ``geos-config`` program is not found in your ``PATH``, a |
---|
| 179 | ``--with-geosconfig`` option can be used to specify its location. For |
---|
| 180 | instance, if ``geos-config`` lies in ``/usr/local/bin`` which is not in |
---|
| 181 | your ``PATH``, you may use the following command: |
---|
| 182 | |
---|
| 183 | :: |
---|
| 184 | |
---|
| 185 | $ ./configure --with-geosconfig=/usr/local/bin/geos-config |
---|
| 186 | |
---|
| 187 | |
---|
| 188 | CGAL Support (Optional) |
---|
| 189 | ************************ |
---|
| 190 | |
---|
| 191 | If ``CGAL/Delaunay_triangulation_2.h`` program is not found in your |
---|
| 192 | ``/usr/include`` directory, a ``--with-cgal`` option can be used to |
---|
| 193 | specify its location. For instance, if the file lies in |
---|
| 194 | ``/usr/local/include`` which is not in your PATH, you may use the |
---|
| 195 | following command: |
---|
| 196 | |
---|
| 197 | :: |
---|
| 198 | |
---|
| 199 | $ ./configure --with-cgal=/usr/local |
---|
| 200 | |
---|
| 201 | |
---|
| 202 | |
---|
| 203 | MapServer Support (Optional) |
---|
| 204 | ***************************** |
---|
| 205 | |
---|
| 206 | |
---|
| 207 | In order to activate the WMS, WFS and WCS output support using |
---|
| 208 | MapServer, the ``--with-mapserver`` option must be used. The path to |
---|
| 209 | ``mapserver-config`` which is located in the source code of MapServer |
---|
| 210 | must also be set, using the following command: |
---|
| 211 | |
---|
| 212 | :: |
---|
| 213 | |
---|
| 214 | $ ./configure --with-mapserver=/path/to/your/mapserver_config/ |
---|
| 215 | |
---|
| 216 | |
---|
| 217 | Read more about the :ref:`kernel-mapserver`. |
---|
| 218 | |
---|
[713] | 219 | XML2 Support (Required) |
---|
| 220 | ************************ |
---|
| 221 | |
---|
| 222 | If xml2-config program is not found in PATH, a *--with-xml2config* option can be used to specify its location. For instance, if xml2-config is installed in ``/usr/local/bin`` which is not in PATH, you may use the following command: |
---|
| 223 | |
---|
| 224 | :: |
---|
| 225 | |
---|
| 226 | $ ./configure --with-xml2config=/usr/local/bin/xml2-config |
---|
| 227 | |
---|
[696] | 228 | Python Support (Optional) |
---|
[713] | 229 | ************************** |
---|
[659] | 230 | |
---|
[696] | 231 | The ``--with-python=yes`` option is required to activate the :ref:`kernel_index` Python support, using the following command: |
---|
[659] | 232 | |
---|
[696] | 233 | :: |
---|
[659] | 234 | |
---|
[696] | 235 | $ ./configure --with-python=yes |
---|
[659] | 236 | |
---|
[696] | 237 | This assumes that python-config is found in your ``PATH``. If not, |
---|
| 238 | then you can specify the Python installation directory using the |
---|
| 239 | following command (with Python installed in the ``/usr/local`` |
---|
| 240 | directory): |
---|
[659] | 241 | |
---|
[696] | 242 | :: |
---|
[659] | 243 | |
---|
[696] | 244 | $ ./configure --with-python=/usr/local |
---|
[659] | 245 | |
---|
| 246 | |
---|
[696] | 247 | Python Version |
---|
[713] | 248 | ############## |
---|
[659] | 249 | |
---|
[696] | 250 | If multiple Python versions are available and you want to use a |
---|
| 251 | specific one, then you can use the ``--with-pyvers`` option as shown |
---|
| 252 | bellow: |
---|
[659] | 253 | |
---|
[696] | 254 | :: |
---|
[659] | 255 | |
---|
[696] | 256 | $ ./configure --with-pyvers=2.7 |
---|
[659] | 257 | |
---|
| 258 | |
---|
[714] | 259 | .. _js-support: |
---|
| 260 | |
---|
| 261 | JavaScript Support (Optional) |
---|
| 262 | ****************************** |
---|
| 263 | |
---|
| 264 | In order to activate the JavaScript support for ZOO-Kernel, |
---|
| 265 | the ``--with-js=yes`` configure option must be specified. If you are using |
---|
| 266 | a "Debian-like" GNU/Linux distribution then dpkg will be used to |
---|
| 267 | detect if the required packages are installed and you don't have to |
---|
| 268 | specify anything here. The following command is only needed (assuming |
---|
| 269 | that js_api.h and libmozjs.so are found in default directories): |
---|
| 270 | |
---|
| 271 | |
---|
| 272 | :: |
---|
| 273 | |
---|
| 274 | $ ./configure --with-js=yes |
---|
| 275 | |
---|
| 276 | If you want to use a custom installation of `SpiderMonkey |
---|
| 277 | <https://developer.mozilla.org/en/SpiderMonkey>`__ , or if you are not |
---|
| 278 | using a Debian packaging system, then you'll have to specify the |
---|
| 279 | directory where it is installed. For instance, if SpiderMonkey is in |
---|
| 280 | ``/usr/local/``, then the following command must be used: |
---|
| 281 | |
---|
| 282 | :: |
---|
| 283 | |
---|
| 284 | $ ./configure --with-js=/usr/local |
---|
| 285 | |
---|
| 286 | |
---|
[696] | 287 | PHP Support (Optional) |
---|
[713] | 288 | *********************** |
---|
[659] | 289 | |
---|
[696] | 290 | The ``--with-php=yes`` option is required to activate the |
---|
| 291 | :ref:`kernel_index` PHP support`, using the following command: |
---|
[659] | 292 | |
---|
[696] | 293 | :: |
---|
[659] | 294 | |
---|
[696] | 295 | $ ./configure --with-php=yes |
---|
[659] | 296 | |
---|
[696] | 297 | This assumes that ``php-config`` can be found in the ``<PATH>/bin`` |
---|
| 298 | directory . So, supposing the your ``php-config`` can be found in |
---|
| 299 | ``/usr/local/bin``, then use the following command: |
---|
[659] | 300 | |
---|
[696] | 301 | :: |
---|
[659] | 302 | |
---|
[696] | 303 | $ ./configure --with-php=/usr/local |
---|
[659] | 304 | |
---|
[696] | 305 | .. warning:: |
---|
| 306 | ZOO-Kernel optional PHP support requires a local PHP Embedded installation. Read more `here <http://zoo-project.org/trac/wiki/ZooKernel/Embed/PHP>`__. |
---|
[659] | 307 | |
---|
| 308 | |
---|
[696] | 309 | Java Support (Optional) |
---|
[713] | 310 | ************************ |
---|
[659] | 311 | |
---|
[696] | 312 | In order to activate the Java support for ZOO-Kernel, the |
---|
| 313 | `--with-java` configure option must be specified and sets the |
---|
| 314 | installation path of your Java SDK. For instance, if Java SDK is |
---|
| 315 | installed in the ``/usr/lib/jvm/java-6-sun-1.6.0.22/`` directory, |
---|
| 316 | then the following command can be used: |
---|
[659] | 317 | |
---|
[696] | 318 | :: |
---|
[659] | 319 | |
---|
[696] | 320 | $ ./configure --with-java=/usr/lib/jvm/java-6-sun-1.6.0.22/ |
---|
[659] | 321 | |
---|
[696] | 322 | This assumes that the ``include/linux`` and ``jre/lib/i386/client/`` |
---|
| 323 | subdirectories exist in ``/usr/lib/jvm/java-6-sun-1.6.0.22/``, and |
---|
| 324 | that the ``include/linux`` directory contains the ``jni.h`` headers file |
---|
| 325 | and that the ``jre/lib/i386/client/`` directory contains the ``libjvm.so`` |
---|
| 326 | file. |
---|
[659] | 327 | |
---|
| 328 | |
---|
[696] | 329 | .. note:: |
---|
| 330 | With Mac OS X you only have to set *macos* as the value for the |
---|
| 331 | ``--with-java`` option to activate Java support. For example: |
---|
[659] | 332 | |
---|
[696] | 333 | :: |
---|
[659] | 334 | |
---|
[696] | 335 | $ ./configure --with-java=macos |
---|
[659] | 336 | |
---|
| 337 | |
---|
[714] | 338 | Perl Support (Optional) |
---|
| 339 | ************************ |
---|
[659] | 340 | |
---|
[714] | 341 | The ``--with-perl=yes`` option can be used for activating the |
---|
| 342 | ZOO-Kernel Perl support, as follow: |
---|
[659] | 343 | |
---|
[696] | 344 | :: |
---|
[659] | 345 | |
---|
[714] | 346 | $ ./configure --with-perl=yes |
---|
[659] | 347 | |
---|
[714] | 348 | This assumes that perl is found in your PATH. For instance, if Perl is |
---|
| 349 | installed in ``/usr/local`` and ``/usr/local/bin`` is not found in |
---|
| 350 | your ``PATH``, then the following command can be used (this assumes |
---|
| 351 | that ``/usr/local/bin/perl`` exists): |
---|
[659] | 352 | |
---|
[696] | 353 | :: |
---|
[659] | 354 | |
---|
[714] | 355 | $ ./configure --with-perl=/usr/local |
---|
[659] | 356 | |
---|
| 357 | |
---|
[696] | 358 | Orfeo Toolbox Support (Optional) |
---|
[713] | 359 | ********************************* |
---|
[659] | 360 | |
---|
[696] | 361 | In order to activate the optional Orfeo Toolbox support, the |
---|
| 362 | ``--with-otb`` option must be used, using the following command: |
---|
[659] | 363 | |
---|
[696] | 364 | :: |
---|
[659] | 365 | |
---|
[696] | 366 | $ ./configure --with-otb=/path/to/your/otb/ |
---|
[659] | 367 | |
---|
| 368 | |
---|
[696] | 369 | Read more about the :ref:`kernel-orfeotoolbox`. |
---|
[659] | 370 | |
---|
[696] | 371 | .. warning:: |
---|
| 372 | To build the Orfeo Toolbox support you will require ITK, the |
---|
| 373 | default version of ITK is 4.5, in case you use another version, |
---|
| 374 | please make sure to use the ``--with-itk-version`` to specificy |
---|
| 375 | what is the version available on your system. |
---|
[659] | 376 | |
---|
[696] | 377 | SAGA GIS Support (Optional) |
---|
[713] | 378 | **************************** |
---|
[659] | 379 | |
---|
| 380 | |
---|
[696] | 381 | In order to activate the optional SAGA GIS support, the *--with-saga* option must be used, using the following command: |
---|
[659] | 382 | |
---|
| 383 | :: |
---|
| 384 | |
---|
[696] | 385 | $ ./configure --with-saga=/path/to/your/saga/ |
---|
[659] | 386 | |
---|
| 387 | |
---|
[696] | 388 | Read more about the :ref:`kernel-sagagis`. |
---|
[659] | 389 | |
---|
[696] | 390 | .. warning:: |
---|
| 391 | In case wx-config is not in your ``PATH`` please, make sure to use |
---|
| 392 | the ``--with-wx-config`` to specify its location. |
---|
[659] | 393 | |
---|
[717] | 394 | Translation support (Optional) |
---|
| 395 | ****************************** |
---|
| 396 | |
---|
[722] | 397 | The ZOO-Kernel is able to translate the messages it produces in different |
---|
| 398 | natural languages. This requires that you download `the messages file |
---|
| 399 | <https://www.transifex.com/projects/p/zoo-kernel-internationalization/>`_ |
---|
| 400 | translated in your language, if any. Then, for this translation |
---|
| 401 | support to work, you have to generate manually the requested file on |
---|
| 402 | your system. For instance for the French translation, you may use the |
---|
| 403 | following command: |
---|
[717] | 404 | |
---|
| 405 | .. code:: |
---|
| 406 | |
---|
[722] | 407 | msgfmt messagespo_fr_FR.utf8.po -o /usr/share/locale/fr/LC_MESSAGES/zoo-kernel.mo |
---|
[717] | 408 | |
---|
| 409 | The ZOO-Kernel is also able to handle translation of |
---|
| 410 | ZOO-Services. Please, refer to :ref:`this document |
---|
| 411 | <service_translation>` for more details on the procedure to add new |
---|
| 412 | ZOO-Service translation files. |
---|
| 413 | |
---|
| 414 | .. warning:: |
---|
| 415 | The location of the final ``.mo`` file may vary depending on your |
---|
| 416 | system setup. |
---|
| 417 | |
---|
| 418 | |
---|
[696] | 419 | Install ZOO-Services |
---|
| 420 | -------------------- |
---|
[659] | 421 | |
---|
[696] | 422 | .. warning:: |
---|
| 423 | We present here a global installation procedure for basics |
---|
| 424 | ZOO-Services, for details about automatic installation of services |
---|
| 425 | provided by :ref:`kernel-orfeotoolbox` or :ref:`kernel-sagagis`, |
---|
| 426 | please refer to there specific documentations. |
---|
[659] | 427 | |
---|
[696] | 428 | Depending on the programming language used to implement the |
---|
| 429 | ZOO-Services you want to install, you will need to build a |
---|
| 430 | Services Provider. In the case of *C* and *Fotran*, you would create a |
---|
| 431 | shared library exporting the functions corresponding to all the |
---|
| 432 | ZOO-Services provided by this Services Provider. In case of *Java*, |
---|
| 433 | you will need to build a Java Class. In any other programming |
---|
| 434 | language, you should simply have to install the ServiceProvider and |
---|
| 435 | the zcfg files. |
---|
[659] | 436 | |
---|
[696] | 437 | If building a Shared library or a Java class is required, then you |
---|
| 438 | should find a ``Makefile`` in the service directory which is |
---|
| 439 | responsible to help you build this Services Provider. So you should |
---|
| 440 | simply run the `make` command from the Service directory to generate |
---|
| 441 | the required file. |
---|
[659] | 442 | |
---|
[696] | 443 | Then you simply need to copy the content of the ``cgi-env`` directory |
---|
| 444 | in ``cgi-bin``. |
---|
[659] | 445 | |
---|
[696] | 446 | To install the ``ogr/base-vect-ops`` Services Provider, supposing that |
---|
| 447 | your ``cgi-bin`` directory is ``/usr/local/lib`` use the following |
---|
| 448 | commands: |
---|
[659] | 449 | |
---|
[696] | 450 | .. code:: |
---|
[659] | 451 | |
---|
[696] | 452 | cd zoo-project/zoo-services/ogr/base-vect-ops |
---|
| 453 | make |
---|
| 454 | cp cgi-env/*.* /usr/lib/cgi-bin |
---|
[659] | 455 | |
---|
[696] | 456 | .. note:: |
---|
| 457 | You may also run ``make install`` directly after ``make``. |
---|
[659] | 458 | |
---|
| 459 | |
---|
[696] | 460 | To install the hello-py Services Provider, use the following commands: |
---|
[659] | 461 | |
---|
[696] | 462 | .. code:: |
---|
| 463 | |
---|
| 464 | cd zoo-project/zoo-services/hello-py/ |
---|
| 465 | cp cgi-env/* /usr/lib/cgi-bin |
---|
| 466 | |
---|
| 467 | |
---|
| 468 | Testing your installation |
---|
| 469 | ------------------------- |
---|
| 470 | |
---|
| 471 | To test your installation yous should first be able to run the |
---|
| 472 | following command from the ``cgi-bin`` directory: |
---|
| 473 | |
---|
| 474 | .. code:: |
---|
| 475 | |
---|
| 476 | ./zoo_loader.cgi "request=GetCapabilities&service=WPS" |
---|
| 477 | |
---|
| 478 | |
---|