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