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