Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /branches/destination-access/doc/html/installation.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1647 - (show annotations) (download) (as text)
Fri May 1 18:01:32 2015 UTC (9 years, 10 months ago) by amb
File MIME type: text/html
File size: 14868 byte(s)
Merge changes from trunk related to translations, the Hungarian
translation and HTML formatting for mobile browsers.

1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
7
8 <title>Routino : Installation</title>
9
10 <!--
11 Routino documentation - installation
12
13 Part of the Routino routing software.
14
15 This file Copyright 2008-2015 Andrew M. Bishop
16
17 This program is free software: you can redistribute it and/or modify
18 it under the terms of the GNU Affero General Public License as published by
19 the Free Software Foundation, either version 3 of the License, or
20 (at your option) any later version.
21
22 This program is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 GNU Affero General Public License for more details.
26
27 You should have received a copy of the GNU Affero General Public License
28 along with this program. If not, see http://www.gnu.org/licenses/.
29 -->
30
31 <link href="style.css" type="text/css" rel="stylesheet">
32 </head>
33
34 <body>
35
36 <!-- Header Start -->
37
38 <div class="header">
39
40 <h1>Routino : Installation</h1>
41
42 </div>
43
44 <!-- Header End -->
45
46 <!-- Content Start -->
47
48 <div class="content">
49
50
51 <h2 id="H_1_1">Quick Start Guide</h2>
52
53 The instructions below are a complete list of the minimum required to get
54 Routino installed and running under Apache on Debian Linux (other Linux versions
55 will be similar).
56
57 <p>
58
59 <em>These instructions should not be considered as complete or a secure
60 installation for the reasons given in more detail in
61 the <a href="#H_1_5_1">Configuration of Web Files</a> section below.</em>
62
63 <p>
64
65 The starting point for the installation is in the Routino source code directory
66 after it has been uncompressed. Most of the steps will need to be run as the
67 root user.
68
69 <p>
70 The first thing to do is to install the packages which are required for
71 compilation of Routino as described in the <a href="#H_1_2">Pre-Requisites</a>
72 section below.
73
74 <pre class="boxed">
75 apt-get install gcc make libc6-dev libz-dev libbz2-dev
76 </pre>
77
78 After this the programs can be compiled:
79
80 <pre class="boxed">
81 make
82 </pre>
83
84 The files for the web interface can now be copied to the web server directory.
85 On Debian this is <tt>/var/www</tt> and the files changed to be owned by the
86 user Apache runs as.
87
88 <pre class="boxed">
89 cp -a web /var/www/routino
90 chown -R www-data:www-data /var/www/routino
91 </pre>
92
93 To be able to use Routino some data will need to be processed and a script is
94 provided for this. This will download the data for the UK which may take a
95 while and then process it.
96
97 <pre class="boxed">
98 cd /var/www/routino/data
99 sh -x create.sh
100 </pre>
101
102 The routino web pages also requires either the OpenLayers or Leaflet Javascript
103 library to be downloaded and installed and scripts are provided for this.
104
105 <pre class="boxed">
106 cd /var/www/routino/www/openlayers
107 sh -x install.sh
108 </pre>
109
110 <pre class="boxed">
111 cd /var/www/routino/www/leaflet
112 sh -x install.sh
113 </pre>
114
115 To make full use of the location search feature on the Routino web page you will
116 need to install some extra perl packages.
117
118 <pre class="boxed">
119 apt-get install libwww-perl liburi-perl libjson-pp-perl
120 </pre>
121
122 Finally to make the web pages work you will need to add the extra lines to the
123 Apache configuration file as described in the <a href="#H_1_5_2">Configuration of
124 Web Server</a> section below. You don't have to use <tt>vi</tt> and can use any
125 text editor.
126
127 <pre class="boxed">
128 vi /etc/apache2/sites-enabled/000-default
129 apache2ctl restart
130 </pre>
131
132 Now everything should be set up and the web page should work if accessed at
133 http://localhost/routino/www/routino/router.html.
134
135 <p>
136
137 When everything is working you should read the rest of this document carefully
138 and make the following changes:
139
140 <ul>
141 <li>Download your choice of OSM data - edit the file <tt>data/create.sh</tt>
142 and run it again.
143 <li>Edit the <tt>www/routino/mapprops.js</tt> file to match the downloaded
144 data and personal map preferences.
145 <li>Move the files in the web server directory so that only the contents of
146 the <tt>www</tt> directory are accessible by the web server.
147 <li>Edit the file <tt>www/routino/paths.pl</tt> to reference the new file
148 locations.
149 </ul>
150
151
152 <h2 id="H_1_2">Pre-Requisites</h2>
153
154 The programs are written in standard C language with minimal external
155 requirements so only a small set of development tools are required (gcc, make).
156 The compilation tools to use and the command line options are defined in the
157 file <tt>Makefile.conf</tt>.
158
159 <p>
160
161 There is some support for multi-threading that uses pthreads and additional
162 development libraries for this may be required (on Linux this might be part of
163 the standard C language development files). The multi-threading is enabled by
164 default but can be disabled at compile time by commenting out two lines in the
165 file <tt>Makefile.conf</tt>.
166
167 <p>
168
169 To use the built-in gzip file decompression function and to process all PBF
170 format files the zlib (or libz) development library is required (on Linux this
171 might be in a package called libz-dev). The gzip function is enabled by default
172 but can be disabled by commenting out two lines in the
173 file <tt>Makefile.conf</tt>.
174
175 <p>
176
177 To use the built-in bzip2 file decompression functions the bzip2 (or libbz2)
178 development library is required (on Linux this might be in a package called
179 libbz2-dev). The bzip2 function is enabled by default but can be disabled by
180 commenting out two lines in the file <tt>Makefile.conf</tt>.
181
182 <p>
183
184 To use the built-in xz file decompression functions the liblzma development
185 library is required (on Linux this might be in a package called liblzma-dev).
186 The xz function is not enabled by default but can be enabled by uncommenting
187 two lines in the file <tt>Makefile.conf</tt>.
188
189 <p>
190
191 To compile the source code from subversion requires the Perl Graphics::Magick
192 module to generate the web page icons (on Linux this might be in a package
193 called libgraphics-magick-perl). The released source code packages contains the
194 icons so this package is not required for compilation.
195
196 <p>
197
198 To use the web page interface an http server is required. Instructions below
199 are for Apache but any server that supports CGIs should work.
200
201 <p>
202
203 The web pages use the Perl scripting language and a number of the default Perl
204 modules. To use the search function on the router web page the Perl module
205 JSON::PP must be installed (on Linux this might be in a package called
206 libjson-pp-perl if not part of the standard Perl installation).
207
208
209 <h2 id="H_1_3">Compilation</h2>
210
211 To compile the programs just type <tt>make</tt> at the top level of the source
212 tree.
213
214 <p>
215
216 This program has been written to run on Linux, no cross-platform compatibility
217 has been specifically included but on the other hand other platforms have not
218 knowingly been excluded either.
219
220 <p>
221
222 Any information on improving the compilation process on anything other than x86
223 Linux is welcome.
224
225
226 <h2 id="H_1_4">Installation</h2>
227
228 After compilation the executable files are copied into the directory
229 <tt>web/bin</tt> and the default XML configuration files are copied into the
230 directory <tt>web/data</tt>. This is in preparation for using the supplied
231 example web pages but is also a useful location to copy the files from for
232 normal use.
233
234 <p>
235
236 The required executable files are <tt>planetsplitter</tt>, <tt>router</tt> and
237 <tt>filedumper</tt> and the <tt>*-slim</tt> versions of the same files. They
238 can be copied to any location and need no special installation environment.
239 The <tt>filedumperx</tt> executable is for debugging and not required.
240
241 <p>
242
243 The configuration files are called <tt>profiles.xml</tt>, <tt>tagging.xml</tt>
244 and <tt>translations.xml</tt>. The names of the configuration files can be
245 specified on the command line but by default are also looked for in the
246 directory that contains the routing database with these names.
247
248
249 <h2 id="H_1_5">Example Web Page</h2>
250
251 The directory <tt>web</tt> contains a set of files that can be used to create a
252 working set of web pages with interfaces to the routing algorithm.
253
254 <p>
255
256 The files in the <tt>web</tt> directory will require copying to a location that
257 is accessible by a web server. After copying the files some of them need to be
258 edited; search through the files for lines that contain the words "EDIT THIS"
259 and make appropriate edits (more details below).
260
261
262 <h3 id="H_1_5_1">Configuration of Web Files</h3>
263
264 The assumption in this description is that the whole of the directory called
265 <tt>web</tt> is copied into a directory that is accessible by an Apache web
266 server.
267
268 <p>
269
270 <em>This is not a secure configuration but an easy one to configure.</em>
271 <br>
272 <em>Only the directory <tt>www</tt> should be accessible by the web server.</em>
273 <em>Do not use this configuration unmodified in a public web server.</em>
274
275 <p>
276
277 The directory structure is as follows:
278
279 <pre>
280 web/
281 |
282 + /bin/ <- The Routino executable files (when compiled).
283 |
284 + /data/ <- The Routino database and default configuration
285 | files.
286 |
287 + /results/ <- An empty directory to store the results.
288 |
289 + /www/ <- The files that must be available to the web
290 | server are below this level.
291 |
292 + /openlayers/ <- A directory to hold the OpenLayers library
293 | (optional; leaflet can be used instead).
294 |
295 + /leaflet/ <- A directory to hold the Leaflet library.
296 | (optional; openlayers can be used instead).
297 |
298 + /routino/ <- The main HTML, Javascript, CSS and CGI files.
299 |
300 + /documentation/ <- The HTML version of the Routino documentation.
301 </pre>
302
303 The directory <tt>bin</tt> will be filled by running the compilation process.
304 For a secure installation the <tt>bin</tt> directory should be outside of the
305 web server, the file <tt>www/routino/paths.pl</tt> contains the path to
306 the <tt>bin</tt> directory.
307
308 <p>
309
310 The directory <tt>data</tt> must contain the Routino database and is also the
311 default location for the configuration files. The routing database is created
312 by downloading the OSM files for the region of interest and running the
313 planetsplitter program. There is a script in the directory that will download
314 the OSM files and create the required database. The script should be edited to
315 set the names of the files to be downloaded. For a secure installation
316 the <tt>data</tt> directory should be outside of the web server, the
317 file <tt>www/routino/paths.pl</tt> contains the path to the <tt>data</tt>
318 directory.
319
320 <p>
321
322 The directory <tt>results</tt> is a temporary directory that it used to hold the
323 GPX and text files generated by the Routino router. The directory must be
324 writable by the web server process since it is the CGI scripts that are run by
325 the web server that writes the results here. For a secure installation
326 the <tt>results</tt> directory should be outside of the web server, the file
327 <tt>www/routino/paths.pl</tt> contains the path to the <tt>results</tt> directory.
328
329 <p>
330
331 The directory <tt>www</tt> and its sub-directories are the only ones that need
332 to be within the web server accessible directory.
333
334 <p>
335
336 A Javascript map drawing library is required and either OpenLayers or Leaflet
337 can be used. The library is loaded dynamically when the HTML is opened based on
338 the value that is selected in <tt>mapprops.js</tt>.
339
340 <p>
341
342 The directory <tt>www/openlayers</tt> is for the OpenLayers Javascript library
343 that can be downloaded from http://www.openlayers.org/. (This version of
344 Routino has been tested with OpenLayers library versions 2.12 and 2.13.1). The
345 file <tt>www/openlayers/OpenLayers.js</tt> and the directories
346 <tt>www/openlayers/img/</tt> and <tt>www/openlayers/theme/</tt> must all exist.
347 There is a script in the <tt>www/openlayers</tt> directory that will
348 automatically download the files, create an optimised <tt>OpenLayers.js</tt> and
349 copy the files to the required locations.
350
351 <p>
352
353 The directory <tt>www/leaflet</tt> is for the Leaflet Javascript library that
354 can be downloaded from http://leafletjs.com/. (This version of Routino has been
355 tested with Leaflet library versions 0.7.1 and 0.7.2). The files
356 <tt>www/leaflet/leaflet.js</tt> and <tt>www/leaflet/leaflet.css</tt> and the
357 directory <tt>www/leaflet/images/</tt> must all exist. There is a script in the
358 <tt>www/leaflet</tt> directory that will automatically download the files.
359
360 <p>
361
362 The directory <tt>www/routino</tt> contains the main HTML, Javascript and CSS
363 files as well as the CGI scripts that perform the server-side routing functions.
364 The description below lists all of the files that contain editable information.
365
366 <dl>
367 <dt><tt>paths.pl</tt>
368 <dd>This contains the names of the directories that contain the executable
369 files, router database and temporary results; the prefix for the routing
370 database; and the names of the executables.
371 <dt><tt>mapprops.js</tt>
372 <dd>The parameters in this file control the Javascript map library (defaults
373 to OpenLayers), the boundary of the visible map (defaults to UK), the
374 minimum and maximum zoom levels (defaults to between 4 and 15 inclusive),
375 the source of map tiles (defaults to the main OpenStreetMap tile server),
376 the data editing and browsing URLs (default to the OpenStreetMap website)
377 and the number of waypoints allowed (defaults to 9).
378 </dl>
379
380 <p>
381
382 The directory <tt>www/routino/documentation</tt> contains the HTML version of
383 the Routino documentation.
384
385
386 <h3 id="H_1_5_2">Configuration of Web Server</h3>
387
388 The file <tt>www/routino/.htaccess</tt> contains all of the Apache configuration
389 options that are required to get the example web pages running. The only
390 problem is that because of the way that the <tt>AllowOverride</tt> option works
391 one of the configuration options has been commented out. This must be enabled
392 in the main Apache server configuration file.
393
394 <p>
395
396 If you have copied the routino <tt>web</tt> directory into <tt>/var/www</tt> and
397 named it <tt>routino</tt> then the entry that you need in your Apache
398 configuration file is this one:
399
400 <pre>
401 &lt;Directory /var/www/routino&gt;
402 AllowOverride All
403 Options +ExecCGI
404 &lt;/Directory&gt;
405 </pre>
406
407 This can be placed anywhere between the <tt>&lt;VirtualHost *:80&gt;</tt>
408 and <tt>&lt;/VirtualHost&gt;</tt> tags which should be at the start and end of
409 the file.
410
411 </div>
412
413 <!-- Content End -->
414
415 <!-- Footer Start -->
416
417 <div class="footer">
418
419 <address>
420 &copy; Andrew M. Bishop - <a href="http://www.routino.org/">http://www.routino.org/</a>
421 </address>
422
423 </div>
424
425 <!-- Footer End -->
426
427 </body>
428
429 </html>