Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
=================================
How to install MapServer Rest API
=================================
This document describes how to install and configure **MapServer Rest API**.
Prerequisites
=============
**MapServer Rest API** needs the following components:
* Python with following packages:
* web.py
* pyyaml
* GDAL (>= 1.9.x with Python support)
* MapServer (>= 6.x with MapScript-Python support)
Download
========
Get the newest source code by downloading the archive at `download`_ page.
Then extract the archive in a directory of your choice. Or checkout the Git in some place.
.. _download: http://
Installation
============
There is nothing to do more.
Just create a virtual directory and the following aliases: ::
WSGIPythonPath /path/to/mra/src/mra
WSGIScriptAlias /mra /path/to/mra/src/mra/server.py
Alias /static /path/to/mra/src/static
<Directory /home/mra/src/static>
Order deny,allow
Allow from all
</Directory>
AddType text/html .py .js
<Directory /home/mra/src/mra>
SetHandler wsgi-script
Options ExecCGI FollowSymlinks
Order deny,allow
Allow from all
</Directory>
You must reload Apache to make the change take effect.
Check the ALIAS is working:
http://localhost/mra
Settings
========
All settings are done in the ``mra/src/mra/mra.yaml`` file, which should be rather easy to adapt to your configuration.
If you have checked out the svn repository, just rename the ``mra.yaml.sample`` in ``mra.yaml``.
That way, your own configuration won't be discarded by a further update.
* ``storage``:
* ``mapfiles``
Path to the directory containing your mapfiles, which can be located anywhere on your disk.
The MapServerRestAPI will scan this directory recursively to find all the mapfiles.
``mapfiles: "/path/to/your/mapfiles/directory"``
* ``resources``
Path to the directory containing your data, which can be located anywhere on your disk.
``resources: "/path/to/your/data/directory"``
* ``mapserver``:
* ``url``
URL that should be used to access your mapserver.
``url: "http://127.0.0.1/cgi-bin/mapserv?"``
* ``wms_version``, ``wfs_version``, ``wcs_version``
Default version to use for WMS, WFS and WCS.
* ``debug``
* ``web_debug`` [True|False]
web_debug allows for easy debuging in the the browser, should be deactivated in production.
* ``raise_all`` [True|False]
Exceptions are transformed into web errors. (404, ...)
This can be prevented by setting raise_all to True.
* ``logging``
* ``format``
Format of the debug log. Here is a typical message:
``format: "%(asctime)s %(levelname)7s: (%(funcName)s:%(lineno)s) %(message)s"``
* ``file``
Path to the log file, which can be located anywhere on your disk.
``file: "./mra.log"``
* ``level`` [DEBUG|INFO|WARNING|ERROR]
Level of debugging output.
* ``web_logs`` [False|True]
To add the logs to the generated output of the webapp by setting web_logs.
Finally check MapServer Rest API is working correctly: ``http://localhost/mra/maps.xml``
Enjoy!
======
You are ready to use **MapServer Rest API**.
Please now refer to the **MapServer Rest API** Reference documentation.