source: subversion/sites/other/tilesAtHome_tahngo/docs/INSTALL

Last change on this file was 21742, checked in by spaetz, 10 years ago

docs: bump django requirement to >=1.2

File size: 6.9 KB
Line 
1PREREQUISITES
2-------------
3
4The Tahngo server, as currently tested, requires the following software:
5
6- Python.  (2.4 works)
7- Django.  (>=1.2)
8- Apache.  (2.2 works)
9- mod_python.  (3.3 works)
10
11Django needs a database module to store its data in.  If you don't have a preference, sqlite is the simplest to use.  You will need a python module for your database, such as python-mysql or python-sqlite (python-sqlite2 2.3.3 works).
12
13INSTALLATION
14------------
15- Download the main directory from the OpenStreetMap svn server.  Put it in a location of your choice, eg. /usr/local/share/tah.  The base directory name must be "tah".  The svn download will give you a directory named "tileAtHome_tahngo" by default; change it to "tah".
16
17- The "Tiles" directory should be moved to the place where you want to store all the tileset files. The setting "TILES_ROOT" in settings.py should point to this directory as it will save tileset files here and expect the stock images (blank sea/land/error) here.
18
19- The "media" directory contains files that should be accessible through the web server and should be moved to a place where the files can be served through apache. I think the setting MEDIA_URL in tah.settings needs to point to one directory below "media".
20
21- Move settings.py.example to settings.py and adapt the settings in tah.settings to your configuration (database choice, url handler, etc)
22
23- Run "python manage.py syncdb" to create the database
24
25- Configure your web server for the new paths.  See "Apache Configuration" below.
26
27- In a web browser, go to the /admin interface and add the settings "latest_client_version", "unzipPath","logFile" to the table Settings.
28  In the case of tah.osm.org these settings are "2008070500" (just a random string that is parsed by clients), "/tmp", and "/var/log/tah/tahngo.log" respectively.
29
30- in tah_intern/Tile.py some paths are still hardcoded for efficiency reasons. Open that file and adapt the path there too. There is
31    basetilepath='/mnt/agami/openstreetmap/tah/Tiles'
32    blanktilepath='/var/www/tah/Tiles'
33and
34    leg_basetiledir='/mnt/agami/openstreetmap/tah/Tiles'
35    oceantilesdat_path ='/var/www/tah/Tiles/oceantiles_12.dat'
36which needs adapting.
37
38- tah_intern/LegacyTileset.py contains hardcoded paths to your oceantiles.dat file and your fallback legacy tile directories. You shouldn't need this, as Legacy tiles are only on the tah server.
39
40- Configure the html templates for the URL to your tile server.  In the templates directory, base_browse_slippy.html might need adaptation to your tile location.
41
42APACHE CONFIGURATION
43--------------------
44The following snippet was sufficient in the apache vhost configuration to make it work. If the main apache config cannot be modified it worked to have the stuff in a .htaccess file in the corresponding directories too (NOTE: works only if the config variable AllowOverride in   
45Apache is set to something sensible).
46
47        <Location />
48                SetHandler python-program
49                PythonHandler django.core.handlers.modpython
50                SetEnv DJANGO_SETTINGS_MODULE tah.settings
51                #adapt next line to whatever your install base directory is
52                PythonPath "['/usr/local/share/'] + sys.path"
53                #PythonAutoReload Off
54                PythonDebug Off
55        </Location>
56        <Location /media>
57                SetHandler None
58        </Location>
59        <Location /Tiles>
60                SetHandler python-program
61                #adapt next line to whatever your install base directory is
62                PythonPath "['/usr/local/share/'] + sys.path"
63                PythonHandler  tah.tah_intern.serve_tiles
64                #PythonAutoReload Off
65                PythonDebug Off
66        </Location>
67
68You can also put these in a subdirectory of your web server by changing the path in the Location lines.
69
70If you have Django in a seperate location (eg. you had to download a new version) you can set the PythonPath to something like:
71PythonPath "['/usr/local/share', '/path/to/your/django/installation'] + sys.path"
72
73(Note: Currently, the actual tile serving only through Apache mod_python or preferably with a compiled module for apache. See mod_tile.c in the directory mod_tah for more on that).  Much of the other parts of the server (admin and browse screens) can be run in a Django standalone server using "python manage.py runserver" for testing purposes.)
74
75USAGE
76-----
77t@h clients can connect to the server without explicitely creating an account. If clients are configured with their
78OpenStreetMap account email (display user name will not work for account creation, but should work as username afterwards, although there is no reason to prefer that to the email) and regular OSM password, the account will be automatically created.
79Passwords are cached in a hashed form on the t@h server, so subsequent OpenStreetMap Email or Password changes will not be automatically propagate to the t@h server. In case of a wrong password, the server tries to refetch the password from OpenStreetMap, so password changes (should theoretically) be possible.
80
81In the web admin interface, you will need to add some "layers" for your maps. In t@h these are currently: tile (the default layer from z0-17), captionless (from z0-17; part of the default layers), maplint(transparent; from z12-17; part of the default layers), and caption (transparent; from z0-17).
82NOTE: that the layer with id=1 is considered the main default layer. It will be used when checking for tileset file size, for example.
83
84Processing uploaded tilesets will not happen automatically by the django server this is done in a separate thread. In the directory tah_intern, you need to call "./process_uploads" to unzip the uploads and put the resulting tilesetfiles to their final location. To start and stop this process more conveniently there is Tools/startstop_process_uploads which is a variant of a Debian like /etc/init.d/ script. You need to adapt some paths in here (and create the directory where the .pid file will be saved) and you can then use ./startstop_process_ploads start|stop|restart to start the tile processing. If it already runs, it will not be started again, so I run the startstop script with option "start" every half hour in a cron script to restart it after a reboot (or an unlikely crash).
85
86CRON
87----
88These are the calls I do via cron:
89
90# m h  dom mon dow   command
91
92#THIS ONE IS IMPORTANT. Reset unfinished tiles and remove finished tiles after 48h
93#THIS IS THE ONLY WAY REQUESTS GET DELETED FROM THE REQUEST DB
945 * * * * wget -q -O- http://tah.openstreetmap.org:81/Request/expireTiles/ > /dev/null
95
96# auto-request changed tiles every 6 hours
970 */6 * * * wget -q -O- http://tah.openstreetmap.org:81/Request/create/changedTiles/ > /dev/null
98
99#could restart the processor from time to time, in case something went wrong
100#19 */1 * * * /var/www/tah/Tools/startstop_process_uploads restart > /dev/null
101
102#download new oceantiles.dat from time to time
10322 22 * * 0 cd /var/www/tah/Tiles;wget http://svn.openstreetmap.org/applications/rendering/tilesAtHome/oceantiles_12.dat -O oceantiles_12.dat.tmp;mv oceantiles_12.dat.tmp oceantiles_12.dat
104
105#auto-stitch lowzoom tiles
10630 0 * * * cd /var/www/tah/tah_intern/;TMPDIR=/tmp/ramdisk python stitch_lowzoom.py
Note: See TracBrowser for help on using the repository browser.