2009-08-29 17:07:05 +00:00
|
|
|
INSTALLATION NOTES
|
|
|
|
==================
|
2009-08-28 13:42:41 +00:00
|
|
|
|
2009-09-06 11:06:55 +00:00
|
|
|
Dependencies
|
|
|
|
------------
|
2009-08-28 13:42:41 +00:00
|
|
|
|
2009-10-07 07:18:48 +00:00
|
|
|
MapOSMatic depends on :
|
2009-09-06 11:06:55 +00:00
|
|
|
|
2012-05-08 02:13:25 +00:00
|
|
|
* Python, the programming language.
|
2009-10-07 07:18:48 +00:00
|
|
|
|
2020-01-05 22:14:19 +00:00
|
|
|
* OCitySMap, the rendering pipeline for MapOSMatic. See OCitySMap's
|
|
|
|
install file for installation instructions and OCitySMap's
|
|
|
|
dependencies.
|
|
|
|
|
2009-10-07 07:18:48 +00:00
|
|
|
* Django, the Web framework used to develop the Web front-end, but
|
|
|
|
also used for the maposmaticd daemon to conveniently access the
|
2012-05-08 02:13:25 +00:00
|
|
|
database through Django's ORM.
|
2009-10-07 07:18:48 +00:00
|
|
|
|
2020-01-05 22:14:19 +00:00
|
|
|
* The Django Cookie Law application for compliance with EU cookie
|
|
|
|
regulations
|
2012-05-08 02:13:25 +00:00
|
|
|
|
|
|
|
* python-psycopg2, to let Django access the PostgreSQL database.
|
2009-10-07 07:18:48 +00:00
|
|
|
|
|
|
|
* python-feedparser, to parse the MapOSMatic blog feed and display
|
2012-05-08 02:13:25 +00:00
|
|
|
the latest entries on the main MapOSMatic website.
|
2009-10-07 07:18:48 +00:00
|
|
|
|
2009-12-20 10:54:55 +00:00
|
|
|
* python-imaging, to render PNG maps.
|
|
|
|
|
|
|
|
* gettext, for internationalization.
|
|
|
|
|
2009-12-22 10:45:54 +00:00
|
|
|
* JSON (any python-*json package should work).
|
2009-12-20 23:27:58 +00:00
|
|
|
|
2012-05-08 02:13:25 +00:00
|
|
|
* ImageMagick, for rendering the thumbnails of multi-page maps.
|
2012-03-31 16:42:02 +00:00
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
On an Debian/Ubuntu installation, the following should be sufficient
|
|
|
|
to fullfil all basic MapOSMatic dependencies:
|
2012-02-18 06:54:23 +00:00
|
|
|
|
|
|
|
sudo aptitude install python-django python-psycopg2 \
|
2012-05-08 02:13:25 +00:00
|
|
|
python-feedparser python-imaging gettext imagemagick
|
2012-02-18 06:54:23 +00:00
|
|
|
|
2009-10-07 07:18:48 +00:00
|
|
|
You will also most likely need a working PostGIS installation for the
|
|
|
|
entire pipeline to run. See the INSTALL documentation of OcitySMap for
|
|
|
|
more details.
|
2009-09-06 11:06:55 +00:00
|
|
|
|
|
|
|
Setup
|
|
|
|
-----
|
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
The ``www/`` directory contains the Django web application. The file
|
|
|
|
``www/settings_local.py.dist`` must be copied to ``www/settings_local.py``
|
|
|
|
and modified to match your installation configuration.
|
2009-12-22 10:45:54 +00:00
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
Likewise for ``www/maposmatic.wsgi.dist`` and ``scripts/config.py.dist``,
|
|
|
|
as well as ``www/maposmatic.wsgi`` and ``scripts/config.py``.
|
2009-09-06 11:06:55 +00:00
|
|
|
|
2020-01-05 22:14:19 +00:00
|
|
|
Some static files from django applications need to be copied into
|
|
|
|
the maposmatic static media directory:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
python3 manage.py collectstatic
|
|
|
|
```
|
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
The rendering database must then be initialized with the tables needed for
|
|
|
|
MapOSMatic, using :
|
2009-08-29 17:07:05 +00:00
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
```bash
|
2020-01-05 22:14:19 +00:00
|
|
|
python3 manage.py migrate
|
2019-08-24 14:02:20 +00:00
|
|
|
```
|
2009-09-06 11:06:55 +00:00
|
|
|
|
2010-06-20 15:48:53 +00:00
|
|
|
The rendering daemon should be run in the background. It will fetch rendering
|
|
|
|
jobs from the database and put the results in a directory, as specified in the
|
2019-08-24 14:02:20 +00:00
|
|
|
``settings_local.py`` file.
|
2009-09-06 11:06:55 +00:00
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
To setup the daemon, you need to configure the wrapper in the ``scripts/``
|
|
|
|
directory by copying scripts/config.py-template to ``scripts/config.py`` and
|
2010-06-20 15:48:53 +00:00
|
|
|
editing it to match your setup. The wrapper will set the necessary environment
|
|
|
|
variables and paths for the daemon to run correctly.
|
2009-12-20 23:15:54 +00:00
|
|
|
|
2010-06-20 15:48:53 +00:00
|
|
|
Then, you can run the rendering daemon through the wrapper with:
|
2009-12-20 23:15:54 +00:00
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
```bash
|
2020-01-05 22:14:19 +00:00
|
|
|
scripts/wrapper.py scripts/daemon.py &
|
2019-08-24 14:02:20 +00:00
|
|
|
```
|
2009-12-20 23:15:54 +00:00
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
You'll find in ``support/init-maposmaticd-template`` an init script
|
2012-02-18 06:54:23 +00:00
|
|
|
template that you can tweak and install on your machine to start the
|
|
|
|
MapOSMatic rendering daemon automatically at boot time. If you are not
|
|
|
|
using it or an equivalent, then please ignore any message "The
|
|
|
|
MapOSMatic rendering daemon is currently not running! [...]" that the
|
|
|
|
web frontend (below) might display.
|
2009-12-20 23:15:54 +00:00
|
|
|
|
2010-09-19 13:24:32 +00:00
|
|
|
Testing with Django integrated web server
|
|
|
|
-----------------------------------------
|
2009-12-20 22:59:51 +00:00
|
|
|
|
2010-09-19 13:24:32 +00:00
|
|
|
Before you think about configuring your web server to provide the
|
|
|
|
maposmatic services, you should try them locally first:
|
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
```bash
|
2020-01-05 22:14:19 +00:00
|
|
|
./manage.py runserver
|
2019-08-24 14:02:20 +00:00
|
|
|
```
|
2010-09-19 13:24:32 +00:00
|
|
|
|
|
|
|
Then point your web browser to the address mentioned in the output
|
2019-08-24 14:02:20 +00:00
|
|
|
message. You will need to adjust ``RENDERING_RESULT_URL`` in
|
|
|
|
``www/settings_local.py`` to something like
|
2012-02-18 06:54:23 +00:00
|
|
|
'http://localhost:8000/results' (8000 being the port that is assigned
|
|
|
|
to the integrated web server, printed on the console when you start
|
|
|
|
it), otherwise the rendered map files will not be accessible through
|
|
|
|
the web frontend.
|
2010-09-19 13:24:32 +00:00
|
|
|
|
|
|
|
External Web server configuration
|
|
|
|
---------------------------------
|
|
|
|
|
|
|
|
In a normal setup, you don't want to use the Django integrated web
|
|
|
|
server. If you are using Apache, you can adapt the configuration file
|
2019-08-24 14:02:20 +00:00
|
|
|
given in ``support/apache-maposmatic-template``.
|
2009-09-06 11:06:55 +00:00
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
Also double-check ``DEFAULT_MAPOSMATIC_LOG_FILE`` in ``www/settings_local.py``
|
2012-02-18 06:54:23 +00:00
|
|
|
is writable by the web server. For example:
|
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
```bash
|
2012-02-18 06:54:23 +00:00
|
|
|
sudo chgrp www-data /path/to/maposmatic/logs/maposmatic.log
|
|
|
|
sudo chmod 664 /path/to/maposmatic/logs/maposmatic.log
|
2019-08-24 14:02:20 +00:00
|
|
|
```
|
2012-02-18 06:54:23 +00:00
|
|
|
|
2009-09-06 11:06:55 +00:00
|
|
|
Internationalization
|
|
|
|
--------------------
|
|
|
|
|
2010-09-19 13:24:32 +00:00
|
|
|
To get proper internationalisation, you need to compile the gettext
|
|
|
|
locale files:
|
2009-08-29 17:07:05 +00:00
|
|
|
|
2019-08-24 14:02:20 +00:00
|
|
|
```bash
|
2010-09-19 13:24:32 +00:00
|
|
|
cd www && django-admin compilemessages
|
2019-08-24 14:02:20 +00:00
|
|
|
```
|
2009-09-03 19:10:55 +00:00
|
|
|
|
2009-09-06 11:06:55 +00:00
|
|
|
Don't forget to restart the Django server or it won't pick up the new
|
|
|
|
translated strings!
|