[348] | 1 | .. _kernel-installation-debian: |
---|
| 2 | |
---|
| 3 | Debian / Ubuntu |
---|
| 4 | =============== |
---|
| 5 | |
---|
| 6 | :Authors: Nicolas Bozon, Gérald Fenoy, Jeff McKenna, Luca Delucchi |
---|
| 7 | :Last Updated: $Date: 2013-06-21 16:55:49 +0000 (Fri, 21 Jun 2013) $ |
---|
| 8 | |
---|
| 9 | .. contents:: Table of Contents |
---|
| 10 | :depth: 2 |
---|
| 11 | :backlinks: top |
---|
| 12 | |
---|
| 13 | .. note:: |
---|
| 14 | An Ubuntu 10.4 with ZOO virtual image is available at http://www.zoo-project.org/Ubuntu10.4_ZOO.zip |
---|
| 15 | (root: ZOO.test) |
---|
| 16 | |
---|
[409] | 17 | Ubuntu 12.04 dependencies |
---|
| 18 | -------------------------------------- |
---|
[348] | 19 | |
---|
[409] | 20 | - install default dependencies |
---|
[348] | 21 | |
---|
[409] | 22 | :: |
---|
[348] | 23 | |
---|
[414] | 24 | 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 |
---|
[409] | 25 | |
---|
| 26 | - add ubuntugis repository to obtain the newer GIS libraries |
---|
| 27 | |
---|
[348] | 28 | :: |
---|
| 29 | |
---|
[409] | 30 | sudo add-apt-repository ppa:ubuntugis/ppa |
---|
| 31 | sudo apt-get update |
---|
[348] | 32 | |
---|
[409] | 33 | |
---|
| 34 | - install geographic library |
---|
| 35 | |
---|
| 36 | :: |
---|
| 37 | |
---|
| 38 | sudo apt-get install libgdal1-dev |
---|
| 39 | |
---|
[348] | 40 | - download ZOO source |
---|
| 41 | |
---|
[409] | 42 | Debian 7.0 dependencies |
---|
| 43 | -------------------------------------- |
---|
| 44 | |
---|
| 45 | - install dependencies |
---|
| 46 | |
---|
[348] | 47 | :: |
---|
| 48 | |
---|
[409] | 49 | 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 |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | Installation Workflow |
---|
| 53 | -------------------------------------- |
---|
| 54 | |
---|
| 55 | .. note :: In the following lines you will find ``as administrator user`` note, |
---|
| 56 | on Ubuntu you have to add ``sudo`` at the beginning of line, on Debian |
---|
| 57 | you can use ``su -c COMMAND``) |
---|
| 58 | |
---|
| 59 | :: |
---|
| 60 | |
---|
[348] | 61 | svn checkout http://svn.zoo-project.org/svn/trunk zoo-project |
---|
| 62 | |
---|
| 63 | - install cgic from packages |
---|
| 64 | |
---|
| 65 | :: |
---|
| 66 | |
---|
| 67 | cd zoo-project/thirds/cgic206/ |
---|
| 68 | |
---|
| 69 | - compile |
---|
| 70 | |
---|
| 71 | :: |
---|
| 72 | |
---|
| 73 | make |
---|
| 74 | |
---|
[409] | 75 | - if you want use Mapserver (optional) for WMS, WFS and WCS output read :ref:`mapserver` |
---|
[348] | 76 | |
---|
| 77 | - go to kernel path |
---|
| 78 | |
---|
| 79 | :: |
---|
| 80 | |
---|
[409] | 81 | cd ../../zoo-project/zoo-kernel/ |
---|
[348] | 82 | |
---|
| 83 | - create configure file |
---|
| 84 | |
---|
| 85 | :: |
---|
| 86 | |
---|
| 87 | autoconf |
---|
| 88 | |
---|
| 89 | - run configure |
---|
| 90 | |
---|
| 91 | :: |
---|
| 92 | |
---|
[409] | 93 | ./configure --with-js --with-python |
---|
[348] | 94 | |
---|
[409] | 95 | .. note:: For PHP, you must make sure to compile PHP with `--enable-embed <http://www.zoo-project.org/trac/wiki/ZooKernel/Embed/PHP#ConfigureandInstallPHPEmbedlibrary>`__. |
---|
[348] | 96 | |
---|
[409] | 97 | .. note:: To use MapServer add the option ``--with-mapserver=/path/to/mapserver/source`` |
---|
[348] | 98 | |
---|
[409] | 99 | - compile |
---|
[348] | 100 | |
---|
| 101 | :: |
---|
| 102 | |
---|
[409] | 103 | make |
---|
[348] | 104 | |
---|
[409] | 105 | - copy necessary files into your cgi-bin (as administrator user) |
---|
[348] | 106 | |
---|
| 107 | |
---|
| 108 | :: |
---|
| 109 | |
---|
[409] | 110 | cp main.cfg /usr/lib/cgi-bin |
---|
| 111 | cp zoo_loader.cgi /usr/lib/cgi-bin |
---|
[348] | 112 | |
---|
[409] | 113 | - install ZOO ServiceProvider, in this case we try Python service (as administrator user) |
---|
[348] | 114 | |
---|
| 115 | :: |
---|
| 116 | |
---|
[409] | 117 | cp ../zoo-services/hello-py/cgi-env/*.zcfg /usr/lib/cgi-bin |
---|
| 118 | cp ../zoo-services/hello-py/*.py /usr/lib/cgi-bin/ |
---|
[348] | 119 | |
---|
[409] | 120 | - change some information in the main.cfg (as administrator user) |
---|
[348] | 121 | |
---|
| 122 | :: |
---|
| 123 | |
---|
[409] | 124 | nano /usr/lib/cgi-bin/main.cfg |
---|
| 125 | - serverAddress = http://127.0.0.1 |
---|
[348] | 126 | |
---|
| 127 | |
---|
| 128 | - try the installation |
---|
| 129 | |
---|
| 130 | - http://127.0.0.1/cgi-bin/zoo_loader.cgi?ServiceProvider=&metapath=&Service=WPS&Request=GetCapabilities&Version=1.0.0 |
---|
| 131 | - http://127.0.0.1/cgi-bin/zoo_loader.cgi?ServiceProvider=&metapath=&Service=WPS&Request=DescribeProcess&Version=1.0.0&Identifier=HelloPy |
---|
| 132 | - 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 |
---|
| 133 | |
---|
| 134 | .. note:: |
---|
| 135 | If you have some problem in the execute request using Python service, add the following to ``main.cfg``: |
---|
| 136 | |
---|
| 137 | :: |
---|
| 138 | |
---|
| 139 | [env] |
---|
[409] | 140 | PYTHONPATH=<YOUR_PYTHONPATH> |
---|
| 141 | |
---|
| 142 | |
---|
| 143 | Rewrite rule configuration |
---|
| 144 | ----------------------------- |
---|
| 145 | |
---|
| 146 | - for better readability and fully functional ZOO Kernel, you have to modify the default |
---|
| 147 | Apache configuration in order to be able to use the http://localhost/zoo/ url directly. |
---|
| 148 | Run (as administrator user) |
---|
| 149 | |
---|
| 150 | :: |
---|
| 151 | |
---|
| 152 | nano /usr/lib/cgi-bin/main.cfg |
---|
| 153 | - serverAddress = http://localhost/zoo |
---|
| 154 | |
---|
| 155 | - first, please create a ``zoo`` directory in ``/var/www/`` which is used by Apache as the |
---|
| 156 | DocumentRoot (as administrator user) |
---|
| 157 | |
---|
| 158 | :: |
---|
| 159 | |
---|
| 160 | mkdir /var/www/zoo |
---|
| 161 | |
---|
| 162 | - Then, please edit the ``/etc/apache2/sites-available/default`` configuration file and add the following |
---|
| 163 | lines after the Directory block related to /var/www directory (as administrator user) |
---|
| 164 | |
---|
| 165 | :: |
---|
| 166 | |
---|
| 167 | <Directory /var/www/zoo/> |
---|
| 168 | Options Indexes FollowSymLinks MultiViews |
---|
| 169 | AllowOverride All |
---|
| 170 | Order allow,deny |
---|
| 171 | allow from all |
---|
| 172 | </Directory> |
---|
| 173 | |
---|
| 174 | - now create a small .htaccess file in the ``/var/www/zoo`` containing the following lines (as administrator user) |
---|
| 175 | |
---|
| 176 | :: |
---|
| 177 | |
---|
| 178 | RewriteEngine on |
---|
| 179 | RewriteRule call/(.*)/(.*) /cgi-bin/zoo_loader.cgi?request=Execute&service=WPS&version=1.0.0&Identifier=$1&DataInputs=sid=$2&RawDataOutput=Result [L,QSA] |
---|
| 180 | RewriteRule (.*)/(.*) /cgi-bin/zoo_loader.cgi?metapath=$1 [L,QSA] |
---|
| 181 | RewriteRule (.*) /cgi-bin/zoo_loader.cgi [L,QSA] |
---|
| 182 | |
---|
| 183 | |
---|
| 184 | - for this last file to be taken into account by Apache, you must activate the |
---|
| 185 | rewrite Apache module by copying a load file as bellow (as administrator user) |
---|
| 186 | |
---|
| 187 | :: |
---|
| 188 | |
---|
| 189 | cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/ |
---|
| 190 | |
---|
| 191 | - or using the a2enmod tool this way (as administrator user) |
---|
| 192 | |
---|
| 193 | :: |
---|
| 194 | |
---|
| 195 | a2enmod rewrite |
---|
| 196 | |
---|
| 197 | - now you should be able to access the ZOO Kernel using a simplified by restarting |
---|
| 198 | your Apache Web server (as administrator user) |
---|
| 199 | |
---|
| 200 | :: |
---|
| 201 | /etc/init.d/apache2 restart |
---|
| 202 | |
---|
| 203 | - now you can try: |
---|
| 204 | |
---|
| 205 | - http://localhost/zoo/?Service=WPS&Request=GetCapabilities&Version=1.0.0 |
---|
| 206 | - http://localhost/zoo/?Service=WPS&Request=DescribeProcess&Version=1.0.0&Identifier=HelloPy |
---|
| 207 | - http://localhost/zoo/?Service=WPS&Request=Execute&Version=1.0.0&Identifier=HelloPy&DataInputs=a=myname |
---|
| 208 | |
---|
| 209 | .. _mapserver: |
---|
| 210 | |
---|
| 211 | Compile MapServer |
---|
| 212 | ------------------ |
---|
| 213 | |
---|
| 214 | - install MapServer dependencies (as administrator user) |
---|
| 215 | |
---|
| 216 | :: |
---|
| 217 | |
---|
| 218 | apt-get install git libfreetype6-dev libproj-dev libkml-dev libcairo-dev libxml2-dev libgd2-xpm-dev libxslt1-dev |
---|
| 219 | |
---|
| 220 | - extract MapServer from git repository |
---|
| 221 | |
---|
| 222 | :: |
---|
| 223 | |
---|
| 224 | git clone https://github.com/mapserver/mapserver.git |
---|
| 225 | cd mapserver |
---|
| 226 | git checkout branch-6-2 |
---|
| 227 | git pull |
---|
| 228 | |
---|
| 229 | - now compile MapServer |
---|
| 230 | |
---|
| 231 | :: |
---|
| 232 | |
---|
| 233 | ./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 |
---|
| 234 | make |
---|
| 235 | |
---|
| 236 | - now install MapServer (as administrator user) |
---|
| 237 | |
---|
| 238 | :: |
---|
| 239 | |
---|
| 240 | make install |
---|
| 241 | |
---|
| 242 | - now add path to libraries path (as administrator user) |
---|
| 243 | |
---|
| 244 | :: |
---|
| 245 | |
---|
| 246 | nano /etc/ld.so.conf.d/mapserver.conf |
---|
| 247 | - /usr/local/lib/ |
---|
| 248 | |
---|
| 249 | - run as administrator |
---|
| 250 | |
---|
| 251 | :: |
---|
| 252 | |
---|
| 253 | ldconfig |
---|