| 1 | .. _kernel-installation: |
|---|
| 2 | |
|---|
| 3 | Installation |
|---|
| 4 | ============ |
|---|
| 5 | |
|---|
| 6 | .. contents:: Table of Contents |
|---|
| 7 | :depth: 4 |
|---|
| 8 | :backlinks: top |
|---|
| 9 | |
|---|
| 10 | This page provides documentation on how to compile then install the ZOO Kernel on Unix and Win32 platforms. |
|---|
| 11 | |
|---|
| 12 | Obtaining the ZOO Kernel Source |
|---|
| 13 | ------------------------------- |
|---|
| 14 | |
|---|
| 15 | Use the following command to get the ZOO Kernel source code through Subversion: |
|---|
| 16 | |
|---|
| 17 | :: |
|---|
| 18 | |
|---|
| 19 | svn checkout http://svn.zoo-project.org/svn/trunk zoo-project |
|---|
| 20 | |
|---|
| 21 | For users which get a developer account, use the following: |
|---|
| 22 | |
|---|
| 23 | :: |
|---|
| 24 | |
|---|
| 25 | sed "s:\[tunnels\]:\[tunnels\]\nzoosvn = /usr/bin/ssh -p 1046:g" -i ~/.subversion/config |
|---|
| 26 | svn co svn+zoosvn://svn.zoo-project.org/var/svn/repos/trunk zoo-project |
|---|
| 27 | |
|---|
| 28 | The first line of the instruction above defines a specific tunnel to access the svn server through |
|---|
| 29 | the SSH protocol. Indeed, the ZOO SVN server listens on the 1046 (1024+22) port rather than the default one (22). |
|---|
| 30 | |
|---|
| 31 | Prerequisites |
|---|
| 32 | ------------- |
|---|
| 33 | |
|---|
| 34 | The following libraries are required on your system before you can install the ZOO Kernel: |
|---|
| 35 | |
|---|
| 36 | - autoconf ( http://www.gnu.org/software/autoconf/ ) |
|---|
| 37 | - cgic ( http://www.boutell.com/cgic ) |
|---|
| 38 | - cURL ( http://curl.haxx.se ) |
|---|
| 39 | - FastCGI ( http://www.fastcgi.com ) |
|---|
| 40 | - Flex & Bison ( http://flex.sourceforge.net/ http://www.gnu.org/software/bison/ ) |
|---|
| 41 | - libxml2 ( http://xmlsoft.org ) |
|---|
| 42 | - OpenSSL ( http://www.openssl.org ) |
|---|
| 43 | - Python ( http://www.python.org ) |
|---|
| 44 | |
|---|
| 45 | Optional libraries include: |
|---|
| 46 | |
|---|
| 47 | - PHP Embedded (optional) ( http://www.php.net ) |
|---|
| 48 | - Java SDK (optional) ( http://java.sun.com ) |
|---|
| 49 | - SpiderMonkey (optional) ( http://www.mozilla.org/js/spidermonkey/ ) |
|---|
| 50 | |
|---|
| 51 | Compile libcgic |
|---|
| 52 | --------------- |
|---|
| 53 | |
|---|
| 54 | The first step is to compile libcgic from the ``zoo-project/thirds`` directory. For such a task, please use |
|---|
| 55 | the following command: |
|---|
| 56 | |
|---|
| 57 | :: |
|---|
| 58 | |
|---|
| 59 | cd thirds/cgic206 |
|---|
| 60 | make |
|---|
| 61 | |
|---|
| 62 | Make sure that a ``libcgic.a`` is created in your ``zoo-project/thirds/cgic206`` directory. If yes, then |
|---|
| 63 | you can go to the next step. |
|---|
| 64 | |
|---|
| 65 | On Windows, rather than using the make command, please use: |
|---|
| 66 | |
|---|
| 67 | :: |
|---|
| 68 | |
|---|
| 69 | nmake /f makefile.vc. |
|---|
| 70 | |
|---|
| 71 | .. warning:: |
|---|
| 72 | If you don't compile libcgic first, and try to compile the ZOO Kernel, you will get an error such as *cannot find -lcgic* |
|---|
| 73 | |
|---|
| 74 | Unix |
|---|
| 75 | ---- |
|---|
| 76 | |
|---|
| 77 | For Unix users, the ZOO Kernel comes with a GNU autoconf "configure" script that should take care of (hopefully!) |
|---|
| 78 | all compilation issues for you. |
|---|
| 79 | |
|---|
| 80 | The configure script won't work on Windows. See section :ref:`WIN32 <win32>` for details on compiling |
|---|
| 81 | on Windows systems. |
|---|
| 82 | |
|---|
| 83 | For the impatient |
|---|
| 84 | ***************** |
|---|
| 85 | |
|---|
| 86 | To build the ``zoo_loader.cgi`` CGI program with the default options, cd to the directory |
|---|
| 87 | where you extracted the ZOO Kernel source code package and use the following commands: |
|---|
| 88 | |
|---|
| 89 | :: |
|---|
| 90 | |
|---|
| 91 | $ cd zoo-kernel |
|---|
| 92 | $ autoconf |
|---|
| 93 | $ ./configure |
|---|
| 94 | $ make |
|---|
| 95 | |
|---|
| 96 | Unless something went wrong, you should have executables in the current directory for the ``zoo_loader.cgi`` |
|---|
| 97 | CGI program. You can copy the ``zoo_loader.cgi`` program and the ``main.cfg`` file to your HTTP server's CGI |
|---|
| 98 | directory and start using it. |
|---|
| 99 | |
|---|
| 100 | At this step your ZOO-Kernel should work. Nevertheless, don't forget to correct the main.cfg settings |
|---|
| 101 | to set ``tmpPath`` and ``tmpUrl`` to fit your web server configuration. |
|---|
| 102 | |
|---|
| 103 | Configure Options |
|---|
| 104 | ***************** |
|---|
| 105 | |
|---|
| 106 | Here is the list of available options as returned by *./configure --help*: |
|---|
| 107 | |
|---|
| 108 | :: |
|---|
| 109 | |
|---|
| 110 | --with-gdal-config=FILE specify an alternative gdal-config file |
|---|
| 111 | --with-xml2config=FILE specify an alternative xml2-config file |
|---|
| 112 | --with-python=PATH To enable python support or specify an alternative |
|---|
| 113 | directory for python installation, disabled by |
|---|
| 114 | default |
|---|
| 115 | --with-php=PATH To enable php support or specify an alternative |
|---|
| 116 | directory for php installation, disabled by default |
|---|
| 117 | --with-perl=PATH To enable perl support or specify an alternative |
|---|
| 118 | directory for perl installation, disabled by default |
|---|
| 119 | --with-java=PATH To enable java support, specify a JDK_HOME, |
|---|
| 120 | disabled by default |
|---|
| 121 | --with-js=PATH specify --with-js=path-to-js to enable js support, |
|---|
| 122 | specify --with-js on linux debian like, js support |
|---|
| 123 | is disabled by default |
|---|
| 124 | |
|---|
| 125 | All the options are described in more details below. |
|---|
| 126 | |
|---|
| 127 | (Required) GDAL Support |
|---|
| 128 | ^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 129 | |
|---|
| 130 | If your gdal-config program is not found in your PATH then you can use the |
|---|
| 131 | ``--with-gdal-config`` option to specify its location. For instance, let's suppose that your gdal-config |
|---|
| 132 | was installed in /usr/local/bin and this directory is not in your PATH, then you can use |
|---|
| 133 | the following command: |
|---|
| 134 | |
|---|
| 135 | :: |
|---|
| 136 | |
|---|
| 137 | $ ./configure --with-gdal-config=/usr/local/bin/gdal-config |
|---|
| 138 | |
|---|
| 139 | (Required) XML2 Support |
|---|
| 140 | ^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 141 | |
|---|
| 142 | If your xml2-config program is not found in your PATH then you can use the |
|---|
| 143 | ``--with-xml2config`` option to specify its location. For instance, let's suppose that |
|---|
| 144 | your xml2-config was installed in /usr/local/bin and this directory is not in your PATH, |
|---|
| 145 | then you can use the following command: |
|---|
| 146 | |
|---|
| 147 | :: |
|---|
| 148 | |
|---|
| 149 | $ ./configure --with-xml2config=/usr/local/bin/xml2-config |
|---|
| 150 | |
|---|
| 151 | (Optional) Python Support |
|---|
| 152 | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 153 | |
|---|
| 154 | If you want to activate Python support for the ZOO Kernel then you will have to use the |
|---|
| 155 | ``--with-python`` option. If your python-config program is found in your PATH then you |
|---|
| 156 | don't have to specify the path where Python was installed, such as: |
|---|
| 157 | |
|---|
| 158 | :: |
|---|
| 159 | |
|---|
| 160 | $ ./configure --with-python |
|---|
| 161 | |
|---|
| 162 | This assumes that python-config is found in your PATH. |
|---|
| 163 | |
|---|
| 164 | In the case that your python-config is not found in your PATH, then you can specify the Python |
|---|
| 165 | installation directory you are using. For instance, let's suppose that you installed |
|---|
| 166 | Python in /usr/local, then you can use the following command: |
|---|
| 167 | |
|---|
| 168 | :: |
|---|
| 169 | |
|---|
| 170 | $ ./configure --with-python=/usr/local |
|---|
| 171 | |
|---|
| 172 | This assumes that /usr/local/bin/python-config exists. |
|---|
| 173 | |
|---|
| 174 | (Optional) PHP Support |
|---|
| 175 | ^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 176 | |
|---|
| 177 | To be able to activate PHP support for the ZOO Kernel you'll need to get a local PHP Embedded |
|---|
| 178 | installation; for more information about the required configure options when compiling PHP you |
|---|
| 179 | can refer to this page : |
|---|
| 180 | |
|---|
| 181 | http://zoo-project.org/trac/wiki/ZooKernel/Embed/PHP |
|---|
| 182 | |
|---|
| 183 | If you want to activate the PHP support for the ZOO Kernel then you will have to use the |
|---|
| 184 | ``--with-php`` option. If your php-config program is found in your PATH then you don't have |
|---|
| 185 | to specify the path where PHP was installed, then you can use the following commnd: |
|---|
| 186 | |
|---|
| 187 | :: |
|---|
| 188 | |
|---|
| 189 | $ ./configure --with-php |
|---|
| 190 | |
|---|
| 191 | This assumes that php-config is found in your PATH. |
|---|
| 192 | |
|---|
| 193 | In the case that your php-config is not found in your PATH, then you can specify the PHP installation |
|---|
| 194 | directory you are using. For instance, let's suppose that you installed PHP in /usr/local, |
|---|
| 195 | then you can use the following command: |
|---|
| 196 | |
|---|
| 197 | :: |
|---|
| 198 | |
|---|
| 199 | $ ./configure --with-php=/usr/local |
|---|
| 200 | |
|---|
| 201 | This assumes that /usr/local/bin/php-config exists. |
|---|
| 202 | |
|---|
| 203 | (Optional) Perl Support |
|---|
| 204 | ^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 205 | |
|---|
| 206 | If you want to activate Perl support for the ZOO Kernel then you will have to use the |
|---|
| 207 | ``--with-perl`` option. If you do not set any value to this option, then the perl program will |
|---|
| 208 | be searched in your PATH. So in such a case, you can use the following command: |
|---|
| 209 | |
|---|
| 210 | :: |
|---|
| 211 | |
|---|
| 212 | $ ./configure --with-perl |
|---|
| 213 | |
|---|
| 214 | This assumes that perl is found in your PATH. |
|---|
| 215 | |
|---|
| 216 | In the other case, for custom Perl installations, you can set the installation directory. For instance, |
|---|
| 217 | let's suppose that you installed Perl in /usr/local and /usr/local/bin is not in your PATH, |
|---|
| 218 | then you can use the following command: |
|---|
| 219 | |
|---|
| 220 | :: |
|---|
| 221 | |
|---|
| 222 | $ ./configure --with-perl=/usr/local |
|---|
| 223 | |
|---|
| 224 | This assumes that /usr/local/bin/perl exists. |
|---|
| 225 | |
|---|
| 226 | (Optional) Java Support |
|---|
| 227 | ^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 228 | |
|---|
| 229 | If you want to activate Java support for the ZOO Kernel then you will have to use the |
|---|
| 230 | ``--with-java`` option and set the installation path of your Java SDK. For instance, |
|---|
| 231 | let's suppose that your Java SDK was installed in the /usr/lib/jvm/java-6-sun-1.6.0.22/ directory, |
|---|
| 232 | then you can use the following command: |
|---|
| 233 | |
|---|
| 234 | :: |
|---|
| 235 | |
|---|
| 236 | $ ./configure --with-java=/usr/lib/jvm/java-6-sun-1.6.0.22/ |
|---|
| 237 | |
|---|
| 238 | This assumes that the include/linux and jre/lib/i386/client/ subdirectories exist in |
|---|
| 239 | /usr/lib/jvm/java-6-sun-1.6.0.22/, include/linux contains the jni.h headers file and |
|---|
| 240 | jre/lib/i386/client/ contains the libjvm.so file. |
|---|
| 241 | |
|---|
| 242 | .. note:: |
|---|
| 243 | With Mac OS X you only have to set ``macos`` as the value for the ``--with-java`` option |
|---|
| 244 | to activate Java support. For example: |
|---|
| 245 | |
|---|
| 246 | :: |
|---|
| 247 | |
|---|
| 248 | $ ./configure --with-java=macos |
|---|
| 249 | |
|---|
| 250 | (Optional) JavaScript Support |
|---|
| 251 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 252 | |
|---|
| 253 | If you want to activate JavaScript support for the ZOO Kernel then you will have to use |
|---|
| 254 | the ``--with-js`` option. If you are using a "Debian-like" GNU/Linux distribution then |
|---|
| 255 | dpkg will be used to detect if the required packages are installed and you don't have to |
|---|
| 256 | specify anything here, so you can use the following command: |
|---|
| 257 | |
|---|
| 258 | :: |
|---|
| 259 | |
|---|
| 260 | $ ./configure --with-js |
|---|
| 261 | |
|---|
| 262 | This assumes that js_api.h and libmozjs.so are found in default directories. |
|---|
| 263 | |
|---|
| 264 | If you have a custom installation of SpiderMonkey or you are not using a Debian packaging |
|---|
| 265 | system, then you'll have to specify the directory where you installed it. For |
|---|
| 266 | instance, let's suppose that you installed your SpiderMonkey in /usr, then you'll |
|---|
| 267 | have to use the following command: |
|---|
| 268 | |
|---|
| 269 | :: |
|---|
| 270 | |
|---|
| 271 | $ ./configure --with-js=/usr |
|---|
| 272 | |
|---|
| 273 | This assumes that the /usr/include/js exists and contains the js_api.h headers file and |
|---|
| 274 | /usr/lib contains libmozjs.so file. |
|---|
| 275 | |
|---|
| 276 | .. _win32: |
|---|
| 277 | |
|---|
| 278 | OpenSUSE |
|---|
| 279 | ******** |
|---|
| 280 | |
|---|
| 281 | Zoo-Kernel is maintained as a package in `OpenSUSE Build Service (OBS) <https://build.opensuse.org/package/show?package=zoo-kernel&project=Application%3AGeo>`__. |
|---|
| 282 | This way, rpm's are provided for all versions of openSUSE Linux (11.2, 11.3, 11.4, Factory). |
|---|
| 283 | |
|---|
| 284 | Stable Releases |
|---|
| 285 | ^^^^^^^^^^^^^^^ |
|---|
| 286 | |
|---|
| 287 | For installing Zoo-Kernel in openSUSE there are 3 ways available: |
|---|
| 288 | |
|---|
| 289 | One Click Installer |
|---|
| 290 | ################### |
|---|
| 291 | |
|---|
| 292 | One-click installer that can be found `here <http://software.opensuse.org/search?q=zoo-kernel&baseproject=openSUSE%3A11.4&lang=en&exclude_debug=true>`__. |
|---|
| 293 | For openSUSE 11.4 this is the direct `link <http://software.opensuse.org/ymp/Application:Geo/openSUSE_11.4/zoo-kernel.ymp?base=openSUSE%3A11.4&query=zoo-kernel>`__. |
|---|
| 294 | |
|---|
| 295 | Yast Software Manager using a GUI |
|---|
| 296 | ################################# |
|---|
| 297 | |
|---|
| 298 | The `Application:Geo <http://download.opensuse.org/repositories/Application:/Geo/>`__ repository has to be added |
|---|
| 299 | to the Software Repositories and then Zoo-kernel can be found in Software Management through search. |
|---|
| 300 | |
|---|
| 301 | Command line (as root for openSUSE 11.4) |
|---|
| 302 | ######################################## |
|---|
| 303 | |
|---|
| 304 | :: |
|---|
| 305 | |
|---|
| 306 | zypper ar http://download.opensuse.org/repositories/Application:/Geo/openSUSE_11.4/ |
|---|
| 307 | zypper refresh |
|---|
| 308 | zypper install zoo-kernel |
|---|
| 309 | |
|---|
| 310 | Unstable Version |
|---|
| 311 | ^^^^^^^^^^^^^^^^ |
|---|
| 312 | |
|---|
| 313 | The latest development version of ZOO-Kernel can be found in OBS under the project `home:tzotsos <https://build.opensuse.org/project/show?project=home%3Atzotsos>`__. |
|---|
| 314 | ZOO-Kernel packages are maintained and tested there before being released to the Application:Geo repository. |
|---|
| 315 | |
|---|
| 316 | Installation methods are identical as the stable version. Make sure to use `this <http://download.opensuse.org/repositories/home:/tzotsos/>`__ repository instead. |
|---|
| 317 | |
|---|
| 318 | Command line installation (as root for openSUSE 11.4) |
|---|
| 319 | ##################################################### |
|---|
| 320 | |
|---|
| 321 | :: |
|---|
| 322 | |
|---|
| 323 | zypper ar http://download.opensuse.org/repositories/home:/tzotsos/openSUSE_11.4/ |
|---|
| 324 | zypper refresh |
|---|
| 325 | zypper install zoo-kernel |
|---|
| 326 | zypper install zoo-kernel-grass-bridge |
|---|
| 327 | |
|---|
| 328 | Additionally, there is the option of adding the zoo-wps-grass-bridge package. This option will automatically install grass7 (svn trunk). |
|---|
| 329 | |
|---|
| 330 | Try the Installation |
|---|
| 331 | ^^^^^^^^^^^^^^^^^^^^ |
|---|
| 332 | |
|---|
| 333 | - http://localhost/cgi-bin/zoo_loader.cgi?ServiceProvider=&metapath=&Service=WPS&Request=GetCapabilities&Version=1.0.0 |
|---|
| 334 | - http://localhost/cgi-bin/zoo_loader.cgi?ServiceProvider=&metapath=&Service=WPS&Request=DescribeProcess&Version=1.0.0&Identifier=HelloPy |
|---|
| 335 | - http://localhost/cgi-bin/zoo_loader.cgi?ServiceProvider=&metapath=&Service=WPS&Request=Execute&Version=1.0.0&Identifier=HelloPy&DataInputs=a=myname |
|---|
| 336 | |
|---|
| 337 | CentOS |
|---|
| 338 | ****** |
|---|
| 339 | |
|---|
| 340 | .. note:: |
|---|
| 341 | This documentation was created thanks to Guillaume Sueur from Neogeo Technologies which took time to test |
|---|
| 342 | installing the ZOO-Kernel on a CentOS 5.5 environment. |
|---|
| 343 | |
|---|
| 344 | Requirements |
|---|
| 345 | ^^^^^^^^^^^^ |
|---|
| 346 | |
|---|
| 347 | Install some standard tools to be able to run ZOO-Kernel on your platform : |
|---|
| 348 | |
|---|
| 349 | :: |
|---|
| 350 | |
|---|
| 351 | yum install apache2 |
|---|
| 352 | yum install build-essentials |
|---|
| 353 | yum install gcc-c++ |
|---|
| 354 | yum install zlib-devel |
|---|
| 355 | yum install libxml2-devel |
|---|
| 356 | yum install bison |
|---|
| 357 | yum install openssl |
|---|
| 358 | yum install python-devel |
|---|
| 359 | yum install subversion |
|---|
| 360 | |
|---|
| 361 | Compile then install FastCGI library from source |
|---|
| 362 | |
|---|
| 363 | :: |
|---|
| 364 | |
|---|
| 365 | wget http://www.fastcgi.com/dist/fcgi.tar.gz |
|---|
| 366 | tar xzf fcgi-2.4.0.tar.gz |
|---|
| 367 | ./configure |
|---|
| 368 | make |
|---|
| 369 | make install |
|---|
| 370 | echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf |
|---|
| 371 | ldconfig |
|---|
| 372 | |
|---|
| 373 | Compile then install the autoconf tools : |
|---|
| 374 | |
|---|
| 375 | :: |
|---|
| 376 | |
|---|
| 377 | wget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz |
|---|
| 378 | tar xzf autoconf-latest.tar.gz |
|---|
| 379 | ./configure --prefix=/usr |
|---|
| 380 | make |
|---|
| 381 | make install |
|---|
| 382 | |
|---|
| 383 | Compile then install the flex tool : |
|---|
| 384 | |
|---|
| 385 | :: |
|---|
| 386 | |
|---|
| 387 | wget http://downloads.sourceforge.net/project/flex/flex/flex-2.5.35/flex-2.5.35.tar.gz?r=http%3A%2F%2Fflex.sourceforge.net%2F&ts=1292529005&use_mirror=switch |
|---|
| 388 | tar xzf flex-2.5.35.tar.gz |
|---|
| 389 | cd flex-2.5.35 |
|---|
| 390 | ./configure --prefix=/usr |
|---|
| 391 | make |
|---|
| 392 | make install |
|---|
| 393 | |
|---|
| 394 | Using the curl provided in the CentOS distribution will produce a ZOO-Kernel unable to run any |
|---|
| 395 | Service. Indeed, some segmentation faults occur when trying to run ``Execute`` requests on the ZOO-Kernel, |
|---|
| 396 | compiling the ZOO-Kernel setting ``USE_GDB`` flag in the ``CFLAGS`` of your ``Makefile`` will let you run |
|---|
| 397 | ZOO-Kernel from gdb and be able to get more information on what is going wrong with your ZOO-Kernel. |
|---|
| 398 | Doing this we can figure out that code on `line 173 <http://zoo-project.org/trac/browser/trunk/zoo-kernel/ulinet.c#L173>`__ |
|---|
| 399 | and `line 175 <http://zoo-project.org/trac/browser/trunk/zoo-kernel/ulinet.c#L175>`__ have to be commented in the |
|---|
| 400 | ``ulinet.c`` file to get a ZOO-Kernel working using the curl available in CentOS (curl version 7.15.5). |
|---|
| 401 | If you don't apply the modification, you will get an error from a gdb session pointing |
|---|
| 402 | segfault in ``Curl_cookie_clearall``. |
|---|
| 403 | |
|---|
| 404 | You can optionally compile then install curl from source : |
|---|
| 405 | |
|---|
| 406 | :: |
|---|
| 407 | |
|---|
| 408 | wget http://curl.haxx.se/download/curl-7.21.3.tar.bz2 |
|---|
| 409 | tar xjf curl-7.21.3.tar.bz2 |
|---|
| 410 | cd curl-7.21.3 |
|---|
| 411 | ./configure --prefix=/usr |
|---|
| 412 | make |
|---|
| 413 | make install |
|---|
| 414 | |
|---|
| 415 | Compile then install Python : |
|---|
| 416 | |
|---|
| 417 | :: |
|---|
| 418 | |
|---|
| 419 | wget http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tar.bz2 |
|---|
| 420 | tar xjf Python-2.6.6.tar.bz2 |
|---|
| 421 | cd Python-2.6.6 |
|---|
| 422 | ./configure |
|---|
| 423 | make |
|---|
| 424 | make install |
|---|
| 425 | |
|---|
| 426 | Compile then install your own GDAL library : |
|---|
| 427 | |
|---|
| 428 | :: |
|---|
| 429 | |
|---|
| 430 | wget http://download.osgeo.org/gdal/gdal-1.7.3.tar.gz |
|---|
| 431 | tar xzf gdal-1.7.3.tar.gz |
|---|
| 432 | cd gdal-1.7.3 |
|---|
| 433 | ./configure # add your options here |
|---|
| 434 | make |
|---|
| 435 | make install |
|---|
| 436 | |
|---|
| 437 | Install the Sun JAVA SDK into ``/usr/share`` then use the following command to ensure that the ``libjvm.so`` |
|---|
| 438 | will be found at runtime from any context. |
|---|
| 439 | |
|---|
| 440 | :: |
|---|
| 441 | |
|---|
| 442 | echo /usr/share/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/ >> /etc/ld.so.conf.d/jvm.conf |
|---|
| 443 | ldconfig |
|---|
| 444 | |
|---|
| 445 | Compile ZOO-Kernel and ZOO-Services |
|---|
| 446 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 447 | |
|---|
| 448 | Compile then install ZOO-Kernel and your first ZOO-Services. |
|---|
| 449 | |
|---|
| 450 | First of all, compile the cgic library providen in the SVN source tree: |
|---|
| 451 | |
|---|
| 452 | :: |
|---|
| 453 | |
|---|
| 454 | svn co http://svn.zoo-project.org/svn/trunk zoo-project |
|---|
| 455 | cd zoo-project/thirds/cgic206 |
|---|
| 456 | make |
|---|
| 457 | |
|---|
| 458 | Compile then install ZOO-Kernel. |
|---|
| 459 | |
|---|
| 460 | :: |
|---|
| 461 | |
|---|
| 462 | cd ../../zoo-kernel |
|---|
| 463 | ./configure --with-java=/usr/share/jdk1.6.0_23/ --with-python |
|---|
| 464 | make zoo_loader.cgi |
|---|
| 465 | cp main.cfg /var/www/cgi-bin/ |
|---|
| 466 | cp zoo_loader.cgi /var/www/cgi-bin/ |
|---|
| 467 | |
|---|
| 468 | Compile then deploy your first ZOO-ServicesProviders (simple HelloPy, line 1 and 2, and the OGR base-vect-ops |
|---|
| 469 | ServiceProvider, line 3 to 6): |
|---|
| 470 | |
|---|
| 471 | :: |
|---|
| 472 | |
|---|
| 473 | cp ../zoo-services/hello-py/cgi-env/*.zcfg /var/www/cgi-bin/ |
|---|
| 474 | cp ../zoo-services/hello-py/test_service.py /var/www/cgi-bin/ |
|---|
| 475 | cd ../ogr/base-vect-ops/ |
|---|
| 476 | make |
|---|
| 477 | cp ./cgi-env/* /var/www/cgi-bin/ |
|---|
| 478 | vi /var/www/cgi-bin/main.cfg --> set your own informations here |
|---|
| 479 | |
|---|
| 480 | To ensure that the ``libjvm.so`` will be found from apache, please restart it : |
|---|
| 481 | |
|---|
| 482 | :: |
|---|
| 483 | |
|---|
| 484 | /etc/init.d/httpd restart |
|---|
| 485 | |
|---|
| 486 | Testing your ZOO-Kernel |
|---|
| 487 | ^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 488 | |
|---|
| 489 | Test your ZOO-Kernel from command line: |
|---|
| 490 | |
|---|
| 491 | :: |
|---|
| 492 | |
|---|
| 493 | cd /var/www/cgi-bin |
|---|
| 494 | ./zoo_loader.cgi "request=Execute&service=WPS&version=1.0.0&Identifier=HelloPy&DataInputs=a=Djay" |
|---|
| 495 | ./zoo_loader.cgi "request=Execute&service=WPS&version=1.0.0&Identifier=Buffer&DataInputs=BufferDistance=1@datat |
|---|
| 496 | |
|---|
| 497 | Debian / Ubuntu |
|---|
| 498 | *************** |
|---|
| 499 | |
|---|
| 500 | .. note:: |
|---|
| 501 | An Ubuntu 10.4 with ZOO virtual image is available at http://www.zoo-project.org/Ubuntu10.4_ZOO.zip |
|---|
| 502 | (root: ZOO.test) |
|---|
| 503 | |
|---|
| 504 | The following instructions were tested on Debian Squeeze, Ubuntu 10.04 and Ubuntu 10.10 |
|---|
| 505 | |
|---|
| 506 | Installation Workflow |
|---|
| 507 | ^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 508 | |
|---|
| 509 | - install some dependencies |
|---|
| 510 | |
|---|
| 511 | :: |
|---|
| 512 | |
|---|
| 513 | sudo apt-get install flex bison libfcgi-dev libxml2 libxml2-dev curl openssl autoconf checkinstall |
|---|
| 514 | |
|---|
| 515 | - download ZOO source |
|---|
| 516 | |
|---|
| 517 | :: |
|---|
| 518 | |
|---|
| 519 | svn checkout http://svn.zoo-project.org/svn/trunk zoo-project |
|---|
| 520 | |
|---|
| 521 | - install cgic from packages |
|---|
| 522 | |
|---|
| 523 | :: |
|---|
| 524 | |
|---|
| 525 | cd zoo-project/thirds/cgic206/ |
|---|
| 526 | |
|---|
| 527 | - change the path of installation |
|---|
| 528 | |
|---|
| 529 | :: |
|---|
| 530 | |
|---|
| 531 | nano Makefile |
|---|
| 532 | - LIBS=-L./ -lcgic ../fcgi-2.4.0/libfcgi/.libs/libfcgi.a --> LIBS=/path/to/libfcgi.a |
|---|
| 533 | - cp libcgic.a ../../dist/lib --> cp libcgic.a /usr/lib |
|---|
| 534 | - cp cgic.h ../../dist//include --> cp cgic.h /usr/include |
|---|
| 535 | - @echo libcgic.a is in ../../dist/lib and cgic.h is in ../../dist//include. --> @echo libcgic.a is in /usr/lib and cgic.h is in /usr/include. |
|---|
| 536 | |
|---|
| 537 | - compile |
|---|
| 538 | |
|---|
| 539 | :: |
|---|
| 540 | |
|---|
| 541 | make |
|---|
| 542 | |
|---|
| 543 | - install |
|---|
| 544 | |
|---|
| 545 | :: |
|---|
| 546 | |
|---|
| 547 | sudo make install |
|---|
| 548 | |
|---|
| 549 | - go to kernel path |
|---|
| 550 | |
|---|
| 551 | :: |
|---|
| 552 | |
|---|
| 553 | cd ../../zoo-kernel/ |
|---|
| 554 | |
|---|
| 555 | - create configure file |
|---|
| 556 | |
|---|
| 557 | :: |
|---|
| 558 | |
|---|
| 559 | autoconf |
|---|
| 560 | |
|---|
| 561 | - run configure |
|---|
| 562 | |
|---|
| 563 | .. note:: |
|---|
| 564 | In Ubuntu 10.04 libmozjs-dev does not exist, so to use JS you can compile `SpiderMonkey <https://developer.mozilla.org/en/SpiderMonkey>`__ or use the xulrunner-dev package |
|---|
| 565 | which includes SpiderMonkey. |
|---|
| 566 | For PHP, you must make sure to compile PHP with `--enable-embed <http://www.zoo-project.org/trac/wiki/ZooKernel/Embed/PHP#ConfigureandInstallPHPEmbedlibrary>`__. |
|---|
| 567 | |
|---|
| 568 | :: |
|---|
| 569 | |
|---|
| 570 | ./configure --with-java=/path/to/java |
|---|
| 571 | |
|---|
| 572 | to JavaScript with XulRunner SpiderMonkey you have to edit configure file. |
|---|
| 573 | - JS_CPPFLAGS="-I$JSHOME/include/js" --> JS_CPPFLAGS="-I$JSHOME/include" |
|---|
| 574 | - JS_LDFLAGS="-L$JSHOME/lib -ljs -lm" --> JS_LDFLAGS="-L$JSHOME/lib -lmozjs -lm" |
|---|
| 575 | - JS_LIB="js" --> JS_LIB="mozjs" |
|---|
| 576 | |
|---|
| 577 | ./configure --with-js=/usr/lib/xulrunner-devel.1.9.2.n |
|---|
| 578 | |
|---|
| 579 | - compile |
|---|
| 580 | |
|---|
| 581 | :: |
|---|
| 582 | |
|---|
| 583 | make zoo_loader.cgi |
|---|
| 584 | |
|---|
| 585 | - copy necessary files into your cgi-bin |
|---|
| 586 | |
|---|
| 587 | :: |
|---|
| 588 | |
|---|
| 589 | sudo cp main.cfg /usr/lib/cgi-bin |
|---|
| 590 | sudo cp zoo_loader.cgi /usr/lib/cgi-bin |
|---|
| 591 | |
|---|
| 592 | - Install ZOO ServiceProvider |
|---|
| 593 | |
|---|
| 594 | :: |
|---|
| 595 | |
|---|
| 596 | sudo cp ../zoo-services/hello-py/cgi-env/*.zcfg /usr/lib/cgi-bin |
|---|
| 597 | sudo cp ../zoo-services/hello-py/*.py /usr/lib/cgi-bin/ |
|---|
| 598 | |
|---|
| 599 | - change some paths in the main.cfg |
|---|
| 600 | |
|---|
| 601 | :: |
|---|
| 602 | |
|---|
| 603 | sudo nano /usr/lib/cgi-bin/main.cfg |
|---|
| 604 | - serverAddress = http://127.0.0.1 |
|---|
| 605 | - providerSite = http://127.0.0.1 |
|---|
| 606 | |
|---|
| 607 | |
|---|
| 608 | - try the installation |
|---|
| 609 | |
|---|
| 610 | - http://127.0.0.1/cgi-bin/zoo_loader.cgi?ServiceProvider=&metapath=&Service=WPS&Request=GetCapabilities&Version=1.0.0 |
|---|
| 611 | - http://127.0.0.1/cgi-bin/zoo_loader.cgi?ServiceProvider=&metapath=&Service=WPS&Request=DescribeProcess&Version=1.0.0&Identifier=HelloPy |
|---|
| 612 | - http://127.0.0.1/cgi-bin/zoo_loader.cgi?ServiceProvider=&metapath=&Service=WPS&Request=Execute&Version=1.0.0&Identifier=HelloPy&DataInputs=a=myname |
|---|
| 613 | |
|---|
| 614 | .. note:: |
|---|
| 615 | If you have some problem in the execute request, add the following to ``main.cfg``: |
|---|
| 616 | |
|---|
| 617 | :: |
|---|
| 618 | |
|---|
| 619 | [env] |
|---|
| 620 | PYTHONPATH=<YOUR_PYTHONPATH> |
|---|
| 621 | |
|---|
| 622 | Windows |
|---|
| 623 | ------- |
|---|
| 624 | |
|---|
| 625 | Using OSGeo4W |
|---|
| 626 | ************* |
|---|
| 627 | |
|---|
| 628 | ZOO4W is the easiest way to use ZOO Kernel on Windows platforms. It is based on the use of OSGeo4W, and some third-party libs. |
|---|
| 629 | Please follow the steps bellow to install ZOO Kernel. Note that Win32 support for ZOO Kernel is still under development and |
|---|
| 630 | that some bugs may still appear. |
|---|
| 631 | |
|---|
| 632 | Install OSGeo4W |
|---|
| 633 | ^^^^^^^^^^^^^^^ |
|---|
| 634 | |
|---|
| 635 | Download the OSGeo4W installer from http://trac.osgeo.org/osgeo4w/, and install it with all the dependencies needed by your |
|---|
| 636 | services (GDAL/OGR for example). The following libs are required: FastCGI, libxml, Python, cURL. |
|---|
| 637 | |
|---|
| 638 | Install other tools and libraries |
|---|
| 639 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 640 | |
|---|
| 641 | After installing OSGeo4W on your platform you'll need more GNU tools and libraries. `This package <http://www.zoo-project.org/dl/tool-win32.zip>`__ |
|---|
| 642 | contains full dependencies required to compile on WIN32 platform and this one contains `full runtime dependencies to place <http://www.zoo-project.org/dl/zoo-runtime.zip>`__ |
|---|
| 643 | in your c:\OSGeo4W\bin. |
|---|
| 644 | |
|---|
| 645 | Download and Install ZOO Kernel |
|---|
| 646 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 647 | |
|---|
| 648 | Download the `binary version <http://www.zoo-project.org/dl/zoo_loader.cgi>`__ of the ZOO Kernel for WIN32 then place it in the |
|---|
| 649 | ``C:\OSGeo4W\bin`` directory. Don't forget to place a ``main.cfg`` file in the same directory, you can use a modified copy of |
|---|
| 650 | `this file <http://www.zoo-project.org/trac/browser/trunk/zoo-kernel/main.cfg>`__. |
|---|
| 651 | |
|---|
| 652 | Deploy ZOO Services Providers |
|---|
| 653 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 654 | |
|---|
| 655 | Your can use the binary version of the OGR Services Provider available from `here <http://www.zoo-project.org/dl/zoo-services-win32.zip>`__. |
|---|
| 656 | Then place the two libraries with their respective .zcfg files in your local ``C:\OSGeo4W\bin`` directory. |
|---|
| 657 | |
|---|
| 658 | Testing |
|---|
| 659 | ^^^^^^^ |
|---|
| 660 | |
|---|
| 661 | Now you should be able to query your local ZOO Kernel. |
|---|
| 662 | |
|---|
| 663 | Compiling Using Your Own Libraries |
|---|
| 664 | ********************************** |
|---|
| 665 | |
|---|
| 666 | The following steps are for use with the Microsoft Visual Studio compiler (and tested with MSVC 2008). |
|---|
| 667 | |
|---|
| 668 | 1. Make sure the gnuwin32 tools ``bison.exe`` and ``flex.exe`` are found in your path. You can download the GNUwin32 tools `here <http://www.zoo-project.org/dl/tool-win32.zip>`__. |
|---|
| 669 | |
|---|
| 670 | 2. Modify the file ``zoo-project\zoo-kernel\nmake.opt`` to point to your local libraries. You can find a modified nmake.opt that points to local libs `here <http://www.zoo-project.org/trac/attachment/ticket/27/nmake.opt>`__. |
|---|
| 671 | You can also find a modified ``zoo-project\zoo-kernel\makefile.vc`` file `here <http://www.zoo-project.org/trac/attachment/ticket/27/makefile.vc>`__. |
|---|
| 672 | |
|---|
| 673 | 3. Execute: |
|---|
| 674 | |
|---|
| 675 | :: |
|---|
| 676 | |
|---|
| 677 | nmake /f makefile.vc |
|---|
| 678 | |
|---|
| 679 | 4. A file ``zoo_loader.cgi`` should be created. Note that if another file named ``zoo_loader.cgi.manifest`` is also created, you |
|---|
| 680 | will have to run another command: |
|---|
| 681 | |
|---|
| 682 | :: |
|---|
| 683 | |
|---|
| 684 | nmake /f makefile.vc embed-manifest |
|---|
| 685 | |
|---|
| 686 | 5. Copy the files ``zoo_loader.cgi`` and ``main.cfg`` into your cgi-bin directory. |
|---|
| 687 | |
|---|
| 688 | 6. Using the command prompt, test the zoo-kernel by executing the following command: |
|---|
| 689 | |
|---|
| 690 | :: |
|---|
| 691 | |
|---|
| 692 | D:\ms4w\Apache\cgi-bin> zoo_loader.cgi |
|---|
| 693 | |
|---|
| 694 | which should display a message such as: |
|---|
| 695 | |
|---|
| 696 | :: |
|---|
| 697 | |
|---|
| 698 | Content-Type: text/xml; charset=utf-8 |
|---|
| 699 | Status: 200 OK |
|---|
| 700 | |
|---|
| 701 | <?xml version="1.0" encoding="utf-8"?> |
|---|
| 702 | <ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd" xml:lang="en-US" version="1.1.0"> |
|---|
| 703 | <ows:Exception exceptionCode="MissingParameterValue"> |
|---|
| 704 | <ows:ExceptionText>Parameter <request> was not specified</ows:ExceptionText> |
|---|
| 705 | </ows:Exception> |
|---|
| 706 | </ows:ExceptionReport> |
|---|
| 707 | |
|---|
| 708 | 7. Edit the file ``cgi-bin/main.cfg`` so that it contains values describing your WPS service. An example of such |
|---|
| 709 | a file running on Windows is: |
|---|
| 710 | |
|---|
| 711 | :: |
|---|
| 712 | |
|---|
| 713 | [main] |
|---|
| 714 | encoding = utf-8 |
|---|
| 715 | version = 1.0.0 |
|---|
| 716 | serverAddress = http://localhost/ |
|---|
| 717 | lang = en-CA |
|---|
| 718 | tmpPath=/ms4w/tmp/ms_tmp/ |
|---|
| 719 | tmpUrl = /ms_tmp/ |
|---|
| 720 | |
|---|
| 721 | [identification] |
|---|
| 722 | title = The Zoo WPS Development Server |
|---|
| 723 | abstract = Development version of ZooWPS. See http://www.zoo-project.org |
|---|
| 724 | fees = None |
|---|
| 725 | accessConstraints = none |
|---|
| 726 | keywords = WPS,GIS,buffer |
|---|
| 727 | |
|---|
| 728 | [provider] |
|---|
| 729 | providerName=Gateway Geomatics |
|---|
| 730 | providerSite=http://www.gatewaygeomatics.com |
|---|
| 731 | individualName=Jeff McKenna |
|---|
| 732 | positionName=Director |
|---|
| 733 | role=Dev |
|---|
| 734 | adressDeliveryPoint=1101 Blue Rocks Road |
|---|
| 735 | addressCity=Lunenburg |
|---|
| 736 | addressAdministrativeArea=False |
|---|
| 737 | addressPostalCode=B0J 2C0 |
|---|
| 738 | addressCountry=ca |
|---|
| 739 | addressElectronicMailAddress=info@gatewaygeomatics.com |
|---|
| 740 | phoneVoice=False |
|---|
| 741 | phoneFacsimile=False |
|---|
| 742 | |
|---|
| 743 | 8. Open a web browser window, and execute a GetCapababilites request on your WPS service: http://localhost/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS |
|---|
| 744 | |
|---|
| 745 | The response should be displayed in your browser, such as: |
|---|
| 746 | |
|---|
| 747 | :: |
|---|
| 748 | |
|---|
| 749 | <wps:Capabilities xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsGetCapabilities_response.xsd" service="WPS" xml:lang="en-US" version="1.0.0"> |
|---|
| 750 | <ows:ServiceIdentification> |
|---|
| 751 | <ows:Title>The Zoo WPS Development Server</ows:Title> |
|---|
| 752 | <ows:Abstract> |
|---|
| 753 | Development version of ZooWPS. See http://www.zoo-project.org |
|---|
| 754 | </ows:Abstract> |
|---|
| 755 | <ows:Keywords> |
|---|
| 756 | <ows:Keyword>WPS</ows:Keyword> |
|---|
| 757 | <ows:Keyword>GIS</ows:Keyword> |
|---|
| 758 | <ows:Keyword>buffer</ows:Keyword> |
|---|
| 759 | </ows:Keywords> |
|---|
| 760 | <ows:ServiceType>WPS</ows:ServiceType> |
|---|
| 761 | <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion> |
|---|
| 762 | ... |
|---|
| 763 | |
|---|
| 764 | Optionally Compile Individual Services |
|---|
| 765 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 766 | |
|---|
| 767 | An example could be the ``OGR base-vect-ops`` provider in the ``zoo-project\zoo-services\ogr\base-vect-ops`` directory. |
|---|
| 768 | |
|---|
| 769 | 1. Edit the makefile.vc located in that directory, and execute: |
|---|
| 770 | |
|---|
| 771 | :: |
|---|
| 772 | |
|---|
| 773 | nmake /f makefile.vc |
|---|
| 774 | |
|---|
| 775 | Inside that same directory, the file ``cgi-env\ogr_service.zo`` should be created. |
|---|
| 776 | |
|---|
| 777 | 2. Copy all of the files inside ``zoo-services\ogr\base-vect-ops\cgi-env`` into your cgi-bin directory |
|---|
| 778 | |
|---|
| 779 | 3. Test this service provider through the following URL: |
|---|
| 780 | |
|---|
| 781 | http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=Buffer&DataInputs=BufferDistance=1@datatype=interger;InputPolygon=Reference@xlink:href=http%3A%2F%2Fwww.zoo-project.org%3A8082%2Fgeoserver%2Fows%3FSERVICE%3DWFS%26REQUEST%3DGetFeature%26VERSION%3D1.0.0%26typename%3Dtopp%3Astates%26SRS%3DEPSG%3A4326%26FeatureID%3Dstates.15 |
|---|
| 782 | |
|---|
| 783 | The response displayed in your browser should contain: |
|---|
| 784 | |
|---|
| 785 | :: |
|---|
| 786 | |
|---|
| 787 | <wps:ProcessSucceeded>Service "Buffer" run successfully.</wps:ProcessSucceeded> |
|---|
| 788 | |
|---|
| 789 | Mac OS X |
|---|
| 790 | -------- |
|---|
| 791 | |
|---|
| 792 | Using the Installer |
|---|
| 793 | ******************* |
|---|
| 794 | |
|---|
| 795 | 1. To install a default build of the ZOO-Project on your Mac OS X computer use the `installer <http://www.zoo-project.org/trac/raw-attachment/wiki/ZooDocumentation/ZOOKernel/MacOSX_installation/ZOO-Project-Installer.pkg>`__. |
|---|
| 796 | |
|---|
| 797 | .. note:: |
|---|
| 798 | The installer assumes that you are using the distributed Apache2 version that comes with your Mac. The installer will |
|---|
| 799 | place ZOO-Kernel and ZOO-Services into your cgi-bin at ``/Library/WebServer/CGI-Executables``, and the zoo-demo folder |
|---|
| 800 | will be placed within your document root at ``/Library/WebServer/Documents`` |
|---|
| 801 | |
|---|
| 802 | 2. Make sure that your Apache server is running, and then access the ZOO Project Demo at: |
|---|
| 803 | |
|---|
| 804 | http://localhost/zoo-demo/spatialtools.html |
|---|
| 805 | |
|---|
| 806 | 3. To add additional services, please follow the following intructions to compile your own ZOO Project instance. |
|---|
| 807 | |
|---|
| 808 | Compiling from Source |
|---|
| 809 | ********************* |
|---|
| 810 | |
|---|
| 811 | 1. Install `Xcode <http://developer.apple.com/technologies/tools/>`__. |
|---|
| 812 | |
|---|
| 813 | 2. Before you start downloading the ZOO-Project source code, you'll need to install some tools required to |
|---|
| 814 | compile ZOO-Kernel properly. |
|---|
| 815 | |
|---|
| 816 | First of all install PROJ, GEOS and GDAL frameworks from `here <http://www.kyngchaos.com/software/frameworks>`__. |
|---|
| 817 | |
|---|
| 818 | At this step, you should get the following directories on your local hard drive : |
|---|
| 819 | |
|---|
| 820 | :: |
|---|
| 821 | |
|---|
| 822 | /Library/Frameworks/PROJ.framework |
|---|
| 823 | /Library/Frameworks/GEOS.framework |
|---|
| 824 | /Library/Frameworks/GDAL.framework |
|---|
| 825 | |
|---|
| 826 | 3. Then, create a ``src`` directory and inside that directory download the `gettext source code <http://www.gnu.org/software/gettext/#TOCdownloading>`__ and uncompress it. |
|---|
| 827 | |
|---|
| 828 | now, compile gettext with the following commands to produce a universal binary : |
|---|
| 829 | |
|---|
| 830 | :: |
|---|
| 831 | |
|---|
| 832 | cd gettext-0.18.1.1 |
|---|
| 833 | CFLAGS="-O -g -arch i386 -arch ppc -arch x86_64" \ |
|---|
| 834 | LDFLAGS="-arch i386 -arch ppc -arch x86_64" ./configure |
|---|
| 835 | make |
|---|
| 836 | sudo make install |
|---|
| 837 | |
|---|
| 838 | 4. Compile and install your ZOO-Kernel |
|---|
| 839 | |
|---|
| 840 | - Download source from SVN, and use the following command to compile libcgic : |
|---|
| 841 | |
|---|
| 842 | :: |
|---|
| 843 | |
|---|
| 844 | svn co http://svn.zoo-project.org/svn/trunk zoo |
|---|
| 845 | cd zoo/thirds/cgic206 |
|---|
| 846 | make |
|---|
| 847 | |
|---|
| 848 | - If you produced the ``libcgic.a`` file, you can run ``autoconf`` and then ``configure`` from zoo-kernel directory. |
|---|
| 849 | |
|---|
| 850 | :: |
|---|
| 851 | |
|---|
| 852 | cd zoo/zoo-kernel |
|---|
| 853 | autoconf |
|---|
| 854 | ./configure --with-python --with-java=macos \ |
|---|
| 855 | --with-gdal-config=/Library/Frameworks/GDAL.framework/Versions/1.8/Programs/gdal-config |
|---|
| 856 | |
|---|
| 857 | Obviously, if you don't need Python or Java support then you should remove the corresponding configure option. |
|---|
| 858 | |
|---|
| 859 | .. note:: |
|---|
| 860 | Note that we used the --with-java=macos configure option. Due to the generic location of the JDK on all |
|---|
| 861 | Mac OS X platforms, you don't have to provide its full path. |
|---|
| 862 | |
|---|
| 863 | - Now, run the following commands to compile and deploy your ZOO-Kernel on your Apache server : |
|---|
| 864 | |
|---|
| 865 | :: |
|---|
| 866 | |
|---|
| 867 | make |
|---|
| 868 | cp zoo_loader.cgi main.cfg /Library/WebServer/CGI-Executables |
|---|
| 869 | |
|---|
| 870 | You should be ready to request your ZOO-Kernel installation using the following link : http://localhost/cgi-bin/zoo_loader.cgi?request=GetCapabilities&service=WPS . |
|---|
| 871 | |
|---|
| 872 | If everything is ok, you can follow the next steps to deploy new Services Providers. |
|---|
| 873 | |
|---|
| 874 | .. note:: |
|---|
| 875 | If you are using your own libs (not the default libs on your system) then you must take care to create |
|---|
| 876 | universal versions of those libs, as the ZOO-Kernel will try to create a universal binary. If you are |
|---|
| 877 | not following this advice, you might receive compile errors of ``symbol(s) not found for architecture ppc`` or ``file was built for |
|---|
| 878 | unsupported file format which is not the architecture being linked (ppc)``. |
|---|
| 879 | |
|---|
| 880 | Deploy the OGR Services Provider |
|---|
| 881 | ******************************** |
|---|
| 882 | |
|---|
| 883 | Requirements |
|---|
| 884 | ^^^^^^^^^^^^ |
|---|
| 885 | |
|---|
| 886 | Before your try to use any service, please set the correct path in the ``main.cfg`` for tmpPath and tmpUrl. |
|---|
| 887 | |
|---|
| 888 | You can use the following setup : |
|---|
| 889 | |
|---|
| 890 | :: |
|---|
| 891 | |
|---|
| 892 | tmpPath = /Library/WebServer/Documents/tmp |
|---|
| 893 | tmpUrl = ../../tmp |
|---|
| 894 | |
|---|
| 895 | Obviously you'll then need to create this directory, using the following command : |
|---|
| 896 | |
|---|
| 897 | :: |
|---|
| 898 | |
|---|
| 899 | mkdir /Library/WebServer/Documents/tmp |
|---|
| 900 | |
|---|
| 901 | C Version |
|---|
| 902 | ^^^^^^^^^ |
|---|
| 903 | |
|---|
| 904 | To compile the base-vect-ops ServicesProvider you'll need to edit the Makefile in *zoo/zoo-services/ogr/base-vect-ops/* |
|---|
| 905 | directory. Add "-I/Library//Frameworks/GEOS.framework/Versions/3/Headers/" to the CFLAGS value on the first line. |
|---|
| 906 | To compile, add GDAL framework to the PATH environmenet variable, to ensure that gdal-config tool will be found, |
|---|
| 907 | run make and then copy cgi-env files in the /Library/WebServer/CGI-Executables directory. |
|---|
| 908 | |
|---|
| 909 | :: |
|---|
| 910 | |
|---|
| 911 | cd zoo/zoo-services/ogr/base-vect-ops/ |
|---|
| 912 | export PATH=$PATH:/Library/Frameworks/GDAL.framework/Versions/1.7/Programs/ |
|---|
| 913 | make |
|---|
| 914 | cp cgi-env/* /Library/WebServer/CGI-Executables |
|---|
| 915 | |
|---|
| 916 | You can test using this `url <http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=Buffer&DataInputs=BufferDistance=1@datatype=interger;InputPolygon=Reference@xlink:href=http%3A%2F%2Fwww.zoo-project.org%3A8082%2Fgeoserver%2Fows%3FSERVICE%3DWFS%26REQUEST%3DGetFeature%26VERSION%3D1.0.0%26typename%3Dtopp%3Astates%26SRS%3DEPSG%3A4326%26FeatureID%3Dstates.15>`__ |
|---|
| 917 | if everything is ok with your setup. |
|---|
| 918 | |
|---|
| 919 | Python Version |
|---|
| 920 | ^^^^^^^^^^^^^^ |
|---|
| 921 | |
|---|
| 922 | **Requirements** |
|---|
| 923 | |
|---|
| 924 | First of all run python from a Terminal.app and try the following import from the python interpreter : |
|---|
| 925 | |
|---|
| 926 | :: |
|---|
| 927 | |
|---|
| 928 | import osgeo.ogr |
|---|
| 929 | import libxml2 |
|---|
| 930 | |
|---|
| 931 | If you get an issue when importing the libxml2 module from your python interpreter then that means you |
|---|
| 932 | need to install the Python support for the libxml2 library which is already installed on your Mac OS X environment. |
|---|
| 933 | To accomplish this, you have first to determine what version of libxml2 is installed on your platform, using the following command: |
|---|
| 934 | |
|---|
| 935 | xml2-config --version |
|---|
| 936 | |
|---|
| 937 | Download the source corresponding to your version (i.e. on 10.6.6 you get 2.7.3) from the libxml2 |
|---|
| 938 | `download page <ftp://xmlsoft.org/libxml2/>`__ into your ``src`` directory then uncompress it. |
|---|
| 939 | |
|---|
| 940 | Use the following command to install the python support : |
|---|
| 941 | |
|---|
| 942 | :: |
|---|
| 943 | |
|---|
| 944 | cd src/libxml2-2.7.3/python/ |
|---|
| 945 | python setup.py install |
|---|
| 946 | |
|---|
| 947 | **Deploy OGR Python Services Provider** |
|---|
| 948 | |
|---|
| 949 | - Now copy the ``zoo-services/ogt/base-vect-ops/cgi-env`` files into ``/Library/WebServer/CGI-Executables``. |
|---|
| 950 | |
|---|
| 951 | You can test using this `url <http://localhost/cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=BufferPy&DataInputs=BufferDistance=1@datatype=interger;InputPolygon=Reference@xlink:href=http%3A%2F%2Fwww.zoo-project.org%3A8082%2Fgeoserver%2Fows%3FSERVICE%3DWFS%26REQUEST%3DGetFeature%26VERSION%3D1.0.0%26typename%3Dtopp%3Astates%26SRS%3DEPSG%3A4326%26FeatureID%3Dstates.15>`__ |
|---|
| 952 | if everything is ok with your setup. |
|---|
| 953 | |
|---|
| 954 | Test using Local Demo Page |
|---|
| 955 | ************************** |
|---|
| 956 | |
|---|
| 957 | - Download the `OpenLayers <http://openlayers.org>`__ library and uncompress it in your personal Sites directory |
|---|
| 958 | (located in your home directory). |
|---|
| 959 | |
|---|
| 960 | - Rename the OpenLayers directory as openlayers. |
|---|
| 961 | |
|---|
| 962 | - Download this `zip archive <http://www.zoo-project.org/trac/raw-attachment/wiki/ZooDocumentation/ZOOKernel/MacOSX_installation/zoo-demo.zip>`__ |
|---|
| 963 | and then uncompress it in your personal Sites directory. |
|---|
| 964 | |
|---|
| 965 | - Load your local demo pages using urls similar to the following (replacing MyUserName by your MacOS user name) : |
|---|
| 966 | |
|---|
| 967 | * http://localhost/~MyUserName/zoo-demo/spatialtools.html |
|---|
| 968 | * http://localhost/~MyUserName/zoo-demo/spatialtools-py.html |
|---|
| 969 | |
|---|
| 970 | |
|---|
| 971 | |
|---|