Changes between Version 2 and Version 3 of ZooWorkshop/FOSS4GJapan/UsingZooFromOSGeoLiveVM


Ignore:
Timestamp:
Oct 15, 2010, 2:03:18 PM (14 years ago)
Author:
djay
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ZooWorkshop/FOSS4GJapan/UsingZooFromOSGeoLiveVM

    v2 v3  
    44
    55OSGeoLive is a live DVD and virtual machine based on Xubuntu that allows you to try a wide variety of open source geospatial software without installing anything. It is composed entirely of free software and include ZOO 1.0 this year, for testing purpose.
    6 As already said in introduction, an OSGeoLive virtual machine image disk has been installed on your computer, allowing you to use ZOO Kernel in a development environment directly. Using a virtual machine image disk seems to be the simplest way to use ZOO Kernel and to develop ZOO Services locally, as we can ensure that everything requested for compile C Services and run Python Services is available and ready to use. Every ZOO related material and source code have been placed in /home/user/zoows directory. We will work inside it during this workshop. As the binary version of ZOO Kernel is already compiled and stored in /home/user/zoows/sources/zoo-kernel, you only have to copy two important files inside the/usr/lib/cgi-bindirectory :zoo_loader.cgiandthemain.cfginordertomakeZOOKernel available, using the following commands:
     6
     7As already said in introduction, an OSGeoLive virtual machine image disk has been installed on your computer, allowing you to use ZOO Kernel in a development environment directly. Using a virtual machine image disk seems to be the simplest way to use ZOO Kernel and to develop ZOO Services locally, as we can ensure that everything requested for compile C Services and run Python Services is available and ready to use. Every ZOO related material and source code have been placed in {{{/home/user/zoows}}} directory. We will work inside it during this workshop. As the binary version of ZOO Kernel is already compiled and stored in {{{/home/user/zoows/sources/zoo-kernel}}}, you only have to copy two important files inside the{{{/usr/lib/cgi-bin}}} directory : {{{zoo_loader.cgi}}} and the {{{main.cfg}}} in order to make ZOO Kernel available, using the following commands :
    78
    89{{{
     
    1213}}}
    1314
    14 Please note that we will talk about ZOO Kernel or zoo_loader.cgi script without any distinction during this workshop .
    15 The main.cfg file contains metadata informations about the identification and provider but also some important settings. The file is composed of various sections, namely main, identification and provider per default. Obviously, you are free to add new sections to the files if you need them for a specific Service. Nevertheless, you have to know that the env section name is used in a specific way. It lets you define environment variables that your Service requires during its runtime. For instance, if your Service requires to access to a X server running on framebuffer, you can add DISPLAY=:1 line in your env section to take this specificity into account.
     15Please note that we will talk about ZOO Kernel or {{{zoo_loader.cgi}}} script without any distinction during this workshop.
     16
     17The {{{main.cfg}}} file contains metadata informations about the identification and provider but also some important settings. The file is composed of various sections, namely {{{main}}}, {{{identification}}} and {{{provider}}} per default. Obviously, you are free to add new sections to the file if you need them for a specific Service. Nevertheless, you have to know that the {{{env}}} section name is used in a specific way. It lets you define environment variables that your Service requires during its runtime. For instance, if your Service requires to access to a X server running on framebuffer, you can add {{{DISPLAY=:1}}} line in your env section to take this specificity into account.
    1618
    1719Please have a look to this file. Three important parameters are commented bellow:
    18  * serverAddress : The url to access to the ZOO Kernel
    19  * tmpPath : The full path to store temporary files
    20  * tmpUrl : The url path relative to serverAddress to access temporary directory.
     20 * {{{serverAddress}}} : The url to access to the ZOO Kernel
     21 * {{{tmpPath}}} : The full path to store temporary files
     22 * {{{tmpUrl}}} : The url path relative to serverAddress to access temporary directory.
    2123
    22 The values of the main.cfg file used from the running virtual machine are the following :
     24The values of the {{{main.cfg}}} file used from the running virtual machine are the following :
    2325
    2426{{{
     
    2931}}}
    3032
    31 You could have noticed that the tmpUrl is a relative url from serverAddress, so it must be a directory. Even if ZOO Kernel can be used with the full url of the zoo_loader.cgi script, for better readability and fully functional ZOO Kernel, you have to modify the default Apache configuration in order to be able to use the http://localhost/zoo/ url directly.
     33You could have noticed that the {{{tmpUrl}}} is a relative url from {{{serverAddress}}}, so it must be a directory. Even if ZOO Kernel can be used with the full url of the {{{zoo_loader.cgi}}} script, for better readability and fully functional ZOO Kernel, you have to modify the default Apache configuration in order to be able to use the http://localhost/zoo/ url directly.
    3234
    33 First, please create a zoo directory in the existing /var/www which is used by Apache as the DirectoryIndex. Then, please edit the /etc/apache2/sites-available/default configuration file and add the following lines after the Directory block related to /var/www directory :
     35First, please create a zoo directory in the existing {{{/var/www}}} which is used by Apache as the {{{DocumentRoot}}}. Then, please edit the {{{/etc/apache2/sites-available/default}}} configuration file and add the following lines after the {{{Directory}}} block related to {{{/var/www}}} directory :
    3436
    3537{{{
     
    4244}}}
    4345
    44 Now create a small .htaccess file in the /var/www/zoo containing the following lines:
     46Now create a small {{{.htaccess}}} file in the {{{/var/www/zoo}}} containing the following lines:
    4547
    4648{{{
     
    5759}}}
    5860
     61Or using the {{{a2enmod}}} tool this way :
     62
     63
     64{{{
     65#!sh
     66a2enmod rewrite
     67}}}
     68
    5969Now you should be able to access the ZOO Kernel using a simplified by restarting your Apache Web server :
    6070
     
    6474}}}
    6575
    66 Two other softwares form the OSGeoLive environment will be used during this workshop. Geoserver will first be used to provide WFS input data for the ZOO Services we are going to develop. The Geoserver sample dataset (United States polygons) will be passed to our service during section 3. So please start the Geoserver using the corresponding launcher in the Servers folder, as illustrated in the following screenshot :
     76Two other softwares form the OSGeoLive environment will be used during this workshop. Geoserver will first be used to provide WFS input data for the ZOO Services we are going to develop. The Geoserver sample dataset (United States polygons) will be passed to our service during section 3. So please start the Geoserver using the corresponding launcher in the {{{Servers}}} folder, as illustrated in the following screenshot :
    6777
    6878[[Image(Practical introduction to ZOO - 1.png,width=400px,align=center)]]
     
    7282As we planned to use OGR C-API and Python module of the GDAL library, we will need the corresponding header files, libraries and associated files. Hopefully everything was already available per default and so ready to use on the OSGeoLive packaging.
    7383
    74 == Testing the ZOO installation with GetCapabilities ==
     84== Testing the ZOO installation with !GetCapabilities ==
    7585
    7686You can now simply query ZOO Kernel using the following request from your Internet browser:
     
    7888[http://localhost/cgi-bin/zoo_loader.cgi?Request=GetCapabilities&Service=WPS]
    7989
    80 You should then get a valid Capabilities XML document, as the following :
     90You should then get a valid {{{Capabilities}}} XML document, as the following :
    8191
    82 Please note that no Process node is returned in the ProcessOfferings section, as no ZOO Service is available yet. You can also proceed to a GetCapabilities request from the command line, using the following command:
     92[[Image(Practical introduction to ZOO - 2.png,width=550px,align=center)]]
     93
     94Please note that no {{{Process}}} node is returned in the {{{ProcessOfferings}}} section, as no ZOO Service is available yet. You can also proceed to a {{{GetCapabilities}}} request from the command line, using the following command:
    8395
    8496{{{
     
    90102The same result as in your browser will be returned, as shown in the following screenshot:
    91103
    92 == Preparing your ZOO ServiceProvider directory ==
     104[[Image(Practical introduction to ZOO - 3.png,width=400px,align=center)]]
     105
     106Invoking ZOO Kernel from command line can be helpful during development process of new Services.
     107
     108== Preparing your ZOO Services Provider directory ==
    93109
    94110In order to simplify the task, we will first comment the directory structure which should be used when creating a new Services Provider :
    95111
    96112 * The main Services Provider directory including :
    97   * A cgi-env directory which will contain all the zcfg metadata files and the service shared
     113  * A {{{cgi-env}}} directory which will contain all the zcfg metadata files and the service shared
    98114object (C Shared Library or Python module)
    99   * The Makefile and the *c files needed to compile your Services Provider.
     115  * The {{{Makefile}}} and the {{{*c}}} files needed to compile your Services Provider.
    100116
    101 Please create a ws_sp main Services Provider directory in the existing zoo-services one located in /home/user/zoows/sources/, respecting the tree above .
     117Please create a ws_sp main Services Provider directory in the existing zoo-services one located in {{{/home/user/zoows/sources/}}}, respecting the tree above .
    102118
    103119{{{
     
    106122}}}
    107123
    108 The Makefile and the code of the C and Python Service Shared Object will be detailed in the next sections.
     124The {{{Makefile}}} and the code of the C and Python Service Shared Object will be detailed in the next sections.
    109125

Search

Context Navigation

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