Debian / Ubuntu

Authors:Nicolas Bozon, Gérald Fenoy, Jeff McKenna, Luca Delucchi
Last Updated:$Date: 2013-06-21 18:55:49 +0200 (Fri, 21 Jun 2013) $


An Ubuntu 10.4 with ZOO virtual image is available at (root: ZOO.test)

Ubuntu 12.04 dependencies

  • install default dependencies
sudo apt-get install flex bison libfcgi-dev libxml2 libxml2-dev curl openssl autoconf apache2 python-software-properties subversion libmozjs185-dev python-dev build-essential
  • add ubuntugis repository to obtain the newer GIS libraries
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
  • install geographic library
sudo apt-get install libgdal1-dev
  • download ZOO source

Debian 7.0 dependencies

  • install dependencies
apt-get install flex bison libfcgi-dev libxml2 libxml2-dev curl openssl autoconf apache2 python-software-properties subversion python-dev libgdal1-dev build-essential libmozjs185-dev

Installation Workflow


In the following lines you will find as administrator user note, on Ubuntu you have to add sudo at the beginning of line, on Debian you can use su -c COMMAND)

svn checkout zoo-project
  • install cgic from packages
cd zoo-project/thirds/cgic206/
  • compile
  • if you want use Mapserver (optional) for WMS, WFS and WCS output read Compile MapServer
  • go to kernel path
cd ../../zoo-project/zoo-kernel/
  • create configure file
  • run configure
./configure --with-js --with-python


For PHP, you must make sure to compile PHP with –enable-embed.


To use MapServer add the option --with-mapserver=/path/to/mapserver/source

  • compile
  • copy necessary files into your cgi-bin (as administrator user)
cp main.cfg /usr/lib/cgi-bin
cp zoo_loader.cgi /usr/lib/cgi-bin
  • install ZOO ServiceProvider, in this case we try Python service (as administrator user)
cp ../zoo-services/hello-py/cgi-env/*.zcfg /usr/lib/cgi-bin
cp ../zoo-services/hello-py/*.py /usr/lib/cgi-bin/
  • change some information in the main.cfg (as administrator user)
nano /usr/lib/cgi-bin/main.cfg
- serverAddress =


If you have some problem in the execute request using Python service, add the following to main.cfg:


Rewrite rule configuration

  • 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. Run (as administrator user)
nano /usr/lib/cgi-bin/main.cfg
- serverAddress = http://localhost/zoo
  • first, please create a zoo directory in /var/www/ which is used by Apache as the DocumentRoot (as administrator user)
mkdir /var/www/zoo
  • 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 (as administrator user)
<Directory /var/www/zoo/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  • now create a small .htaccess file in the /var/www/zoo containing the following lines (as administrator user)
RewriteEngine on
RewriteRule call/(.*)/(.*) /cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=$1&DataInputs=sid=$2&RawDataOutput=Result [L,QSA]
RewriteRule (.*)/(.*) /cgi-bin/zoo_loader.cgi?metapath=$1 [L,QSA]
RewriteRule (.*) /cgi-bin/zoo_loader.cgi [L,QSA]
  • for this last file to be taken into account by Apache, you must activate the rewrite Apache module by copying a load file as bellow (as administrator user)
cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
  • or using the a2enmod tool this way (as administrator user)
a2enmod rewrite
  • now you should be able to access the ZOO Kernel using a simplified by restarting your Apache Web server (as administrator user)
/etc/init.d/apache2 restart

Compile MapServer

  • install MapServer dependencies (as administrator user)
apt-get install git libfreetype6-dev libproj-dev libkml-dev libcairo-dev libxml2-dev libgd2-xpm-dev libxslt1-dev
  • extract MapServer from git repository
git clone
cd mapserver
git checkout branch-6-2
git pull
  • now compile MapServer
./configure --with-ogr --with-gdal --with-wfsclient --with-wmsclient --with-tiff --with-jpeg --with-gd --with-wcs --with-sos --with-xml2-config --with-wfs --with-fastcgi --with-proj --with-cairo --with-kml=yes --with-xslt --with-threads --with-geos
  • now install MapServer (as administrator user)
make install
  • now add path to libraries path (as administrator user)
nano /etc/
- /usr/local/lib/
  • run as administrator