[240] | 1 | .. _kernel-installation-centos: |
---|
| 2 | |
---|
| 3 | CentOS |
---|
[271] | 4 | ====== |
---|
| 5 | |
---|
[320] | 6 | :Authors: Nicolas Bozon, Gérald Fenoy, Jeff McKenna |
---|
[314] | 7 | :Last Updated: $Date: 2011-08-11 17:05:38 +0000 (Thu, 11 Aug 2011) $ |
---|
[240] | 8 | |
---|
| 9 | .. contents:: Table of Contents |
---|
| 10 | :depth: 2 |
---|
| 11 | :backlinks: top |
---|
| 12 | |
---|
| 13 | .. note:: |
---|
| 14 | This documentation was created thanks to Guillaume Sueur from Neogeo Technologies which took time to test |
---|
| 15 | installing the ZOO-Kernel on a CentOS 5.5 environment. |
---|
| 16 | |
---|
| 17 | Requirements |
---|
| 18 | ------------ |
---|
| 19 | |
---|
| 20 | Install some standard tools to be able to run ZOO-Kernel on your platform : |
---|
| 21 | |
---|
| 22 | :: |
---|
| 23 | |
---|
| 24 | yum install apache2 |
---|
| 25 | yum install build-essentials |
---|
| 26 | yum install gcc-c++ |
---|
| 27 | yum install zlib-devel |
---|
| 28 | yum install libxml2-devel |
---|
| 29 | yum install bison |
---|
| 30 | yum install openssl |
---|
| 31 | yum install python-devel |
---|
| 32 | yum install subversion |
---|
| 33 | |
---|
| 34 | Compile then install FastCGI library from source |
---|
| 35 | |
---|
| 36 | :: |
---|
| 37 | |
---|
| 38 | wget http://www.fastcgi.com/dist/fcgi.tar.gz |
---|
| 39 | tar xzf fcgi-2.4.0.tar.gz |
---|
| 40 | ./configure |
---|
| 41 | make |
---|
| 42 | make install |
---|
| 43 | echo /usr/local/lib >> /etc/ld.so.conf.d/local.conf |
---|
| 44 | ldconfig |
---|
| 45 | |
---|
| 46 | Compile then install the autoconf tools : |
---|
| 47 | |
---|
| 48 | :: |
---|
| 49 | |
---|
| 50 | wget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz |
---|
| 51 | tar xzf autoconf-latest.tar.gz |
---|
| 52 | ./configure --prefix=/usr |
---|
| 53 | make |
---|
| 54 | make install |
---|
| 55 | |
---|
| 56 | Compile then install the flex tool : |
---|
| 57 | |
---|
| 58 | :: |
---|
| 59 | |
---|
| 60 | 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 |
---|
| 61 | tar xzf flex-2.5.35.tar.gz |
---|
| 62 | cd flex-2.5.35 |
---|
| 63 | ./configure --prefix=/usr |
---|
| 64 | make |
---|
| 65 | make install |
---|
| 66 | |
---|
| 67 | Using the curl provided in the CentOS distribution will produce a ZOO-Kernel unable to run any |
---|
| 68 | Service. Indeed, some segmentation faults occur when trying to run ``Execute`` requests on the ZOO-Kernel, |
---|
| 69 | compiling the ZOO-Kernel setting ``USE_GDB`` flag in the ``CFLAGS`` of your ``Makefile`` will let you run |
---|
| 70 | ZOO-Kernel from gdb and be able to get more information on what is going wrong with your ZOO-Kernel. |
---|
| 71 | Doing this we can figure out that code on `line 173 <http://zoo-project.org/trac/browser/trunk/zoo-kernel/ulinet.c#L173>`__ |
---|
| 72 | and `line 175 <http://zoo-project.org/trac/browser/trunk/zoo-kernel/ulinet.c#L175>`__ have to be commented in the |
---|
| 73 | ``ulinet.c`` file to get a ZOO-Kernel working using the curl available in CentOS (curl version 7.15.5). |
---|
| 74 | If you don't apply the modification, you will get an error from a gdb session pointing |
---|
| 75 | segfault in ``Curl_cookie_clearall``. |
---|
| 76 | |
---|
| 77 | You can optionally compile then install curl from source : |
---|
| 78 | |
---|
| 79 | :: |
---|
| 80 | |
---|
| 81 | wget http://curl.haxx.se/download/curl-7.21.3.tar.bz2 |
---|
| 82 | tar xjf curl-7.21.3.tar.bz2 |
---|
| 83 | cd curl-7.21.3 |
---|
| 84 | ./configure --prefix=/usr |
---|
| 85 | make |
---|
| 86 | make install |
---|
| 87 | |
---|
| 88 | Compile then install Python : |
---|
| 89 | |
---|
| 90 | :: |
---|
| 91 | |
---|
| 92 | wget http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tar.bz2 |
---|
| 93 | tar xjf Python-2.6.6.tar.bz2 |
---|
| 94 | cd Python-2.6.6 |
---|
| 95 | ./configure |
---|
| 96 | make |
---|
| 97 | make install |
---|
| 98 | |
---|
| 99 | Compile then install your own GDAL library : |
---|
| 100 | |
---|
| 101 | :: |
---|
| 102 | |
---|
| 103 | wget http://download.osgeo.org/gdal/gdal-1.7.3.tar.gz |
---|
| 104 | tar xzf gdal-1.7.3.tar.gz |
---|
| 105 | cd gdal-1.7.3 |
---|
| 106 | ./configure # add your options here |
---|
| 107 | make |
---|
| 108 | make install |
---|
| 109 | |
---|
| 110 | Install the Sun JAVA SDK into ``/usr/share`` then use the following command to ensure that the ``libjvm.so`` |
---|
| 111 | will be found at runtime from any context. |
---|
| 112 | |
---|
| 113 | :: |
---|
| 114 | |
---|
| 115 | echo /usr/share/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client/ >> /etc/ld.so.conf.d/jvm.conf |
---|
| 116 | ldconfig |
---|
| 117 | |
---|
| 118 | Compile ZOO-Kernel and ZOO-Services |
---|
| 119 | ----------------------------------- |
---|
| 120 | |
---|
| 121 | Compile then install ZOO-Kernel and your first ZOO-Services. |
---|
| 122 | |
---|
| 123 | First of all, compile the cgic library providen in the SVN source tree: |
---|
| 124 | |
---|
| 125 | :: |
---|
| 126 | |
---|
| 127 | svn co http://svn.zoo-project.org/svn/trunk zoo-project |
---|
| 128 | cd zoo-project/thirds/cgic206 |
---|
| 129 | make |
---|
| 130 | |
---|
| 131 | Compile then install ZOO-Kernel. |
---|
| 132 | |
---|
| 133 | :: |
---|
| 134 | |
---|
| 135 | cd ../../zoo-kernel |
---|
| 136 | ./configure --with-java=/usr/share/jdk1.6.0_23/ --with-python |
---|
| 137 | make zoo_loader.cgi |
---|
| 138 | cp main.cfg /var/www/cgi-bin/ |
---|
| 139 | cp zoo_loader.cgi /var/www/cgi-bin/ |
---|
| 140 | |
---|
| 141 | Compile then deploy your first ZOO-ServicesProviders (simple HelloPy, line 1 and 2, and the OGR base-vect-ops |
---|
| 142 | ServiceProvider, line 3 to 6): |
---|
| 143 | |
---|
| 144 | :: |
---|
| 145 | |
---|
| 146 | cp ../zoo-services/hello-py/cgi-env/*.zcfg /var/www/cgi-bin/ |
---|
| 147 | cp ../zoo-services/hello-py/test_service.py /var/www/cgi-bin/ |
---|
| 148 | cd ../ogr/base-vect-ops/ |
---|
| 149 | make |
---|
| 150 | cp ./cgi-env/* /var/www/cgi-bin/ |
---|
| 151 | vi /var/www/cgi-bin/main.cfg --> set your own informations here |
---|
| 152 | |
---|
| 153 | To ensure that the ``libjvm.so`` will be found from apache, please restart it : |
---|
| 154 | |
---|
| 155 | :: |
---|
| 156 | |
---|
| 157 | /etc/init.d/httpd restart |
---|
| 158 | |
---|
| 159 | Testing your ZOO-Kernel |
---|
| 160 | ----------------------- |
---|
| 161 | |
---|
| 162 | Test your ZOO-Kernel from command line: |
---|
| 163 | |
---|
| 164 | :: |
---|
| 165 | |
---|
| 166 | cd /var/www/cgi-bin |
---|
| 167 | ./zoo_loader.cgi "request=Execute&service=WPS&version=1.0.0&Identifier=HelloPy&DataInputs=a=Djay" |
---|
| 168 | ./zoo_loader.cgi "request=Execute&service=WPS&version=1.0.0&Identifier=Buffer&DataInputs=BufferDistance=1@datat |
---|