Skip to content

Commit 2287afe

Browse files
authored
Updated Documentation (#320)
* Update docs * Added `macOS` build documentation link to README
1 parent 6e20fba commit 2287afe

13 files changed

Lines changed: 548 additions & 362 deletions

README.rst

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This software contains two main pieces:
88
2) ``renderd``: A daemon that renders map tiles using mapnik.
99

1010
.. figure:: ./screenshot.jpg
11-
:alt: Image shoing example slippy map and OSM layer
11+
:alt: Image showing example slippy map and OSM layer
1212

1313
Together they efficiently render and serve raster map tiles for example
1414
to use within a slippy map. The two consist of the classic raster tile
@@ -21,15 +21,22 @@ combination with ``mod_tile``.
2121
Dependencies
2222
------------
2323

24-
* `GNU/Linux` Operating System (works best on Debian or Ubuntu)
25-
* `Apache 2 HTTP webserver <https://httpd.apache.org/>`__
26-
* `Mapnik <https://mapnik.org/>`__
27-
* `Cairo 2D graphics library <https://cairographics.org/>`__
28-
* `Curl library (SSL variant) <https://curl.haxx.se/>`__
29-
* `Iniparser library <https://github.com/ndevilla/iniparser>`__
30-
* `GLib library <https://gitlab.gnome.org/GNOME/glib>`__
31-
* `Memcached library (optional) <https://libmemcached.org/>`__
32-
* `RADOS library (optional) <https://docs.ceph.com/en/latest/rados/api/librados/>`__
24+
* `Supported Operating Systems`
25+
* `GNU/Linux` (works best on Debian or Ubuntu)
26+
* `FreeBSD`
27+
* `macOS`
28+
* `Supported Build Systems`
29+
* `GNU Autotools <https://www.gnu.org/software/software.html>`__
30+
* `CMake <https://cmake.org/>`__
31+
* `Runtime/Build Dependencies`
32+
* `Apache 2 HTTP webserver <https://httpd.apache.org/>`__
33+
* `Mapnik <https://mapnik.org/>`__
34+
* `Cairo 2D graphics library <https://cairographics.org/>`__
35+
* `Curl library (SSL variant) <https://curl.haxx.se/>`__
36+
* `Iniparser library <https://github.com/ndevilla/iniparser>`__
37+
* `GLib library <https://gitlab.gnome.org/GNOME/glib>`__
38+
* `Memcached library (optional) <https://libmemcached.org/>`__
39+
* `RADOS library (optional) <https://docs.ceph.com/en/latest/rados/api/librados/>`__
3340

3441
Installation
3542
------------
@@ -58,10 +65,13 @@ when using it on an operating system this is not being packaged for.
5865
We prepared instructions for you on how to build the software on the following
5966
distributions:
6067

61-
* `CentOS 7 <docs/build/building_on_centos_7.md>`__
62-
* `Fedora 34 </docs/build/building_on_fedora_34.md>`__
63-
* `Ubuntu 20.04 </docs/build/building_on_ubuntu_20_04.md>`__ (this should work as well for Debian 10)
64-
* `Debian 12 </docs/build/building_on_debian_12.md>`__
68+
* `CentOS </docs/build/building_on_centos.md>`__
69+
* `CentOS Stream </docs/build/building_on_centos_stream.md>`__
70+
* `Debian </docs/build/building_on_debian.md>`__
71+
* `Fedora </docs/build/building_on_fedora.md>`__
72+
* `FreeBSD </docs/build/building_on_freebsd.md>`__
73+
* `macOS </docs/build/building_on_macos.md>`__
74+
* `Ubuntu </docs/build/building_on_ubuntu.md>`__
6575

6676
Configuration
6777
-------------
@@ -72,47 +82,63 @@ example configuration files are distributed with the software packages and
7282
located in the ``etc`` directory of this repository.
7383

7484
A very basic example-map and data can be found in the ``utils/example-map``
75-
directory. For a simple test copy it over to ``/var/www/example-map``.
85+
directory.
7686

77-
Copy the configuration files to their place, too:
87+
For a simple test copy it over to ``/usr/share/renderd/example-map``:
7888

7989
::
8090

81-
$ cp etc/renderd/renderd.conf /etc/renderd.conf
82-
$ cp etc/apache2/renderd.conf /etc/apache2/conf-available/renderd.conf
83-
$ cp etc/apache2/renderd-example-map.conf /etc/apache2/conf-available/renderd-example-map.conf
91+
$ sudo mkdir -p /usr/share/renderd
92+
$ sudo cp -av utils/example-map /usr/share/renderd/
8493

85-
Enable the configuration:
94+
Copy the apache configuration file to its place, too:
8695

8796
::
8897

89-
$ sudo a2enmod tile
90-
$ sudo a2enconf renderd
91-
$ sudo a2enconf renderd-example-map
98+
$ sudo cp -av etc/apache2/renderd-example-map.conf /etc/apache2/sites-available/renderd-example-map.conf
9299

93-
Restart apache2:
100+
Add a map configuration for example-map to ``/etc/renderd.conf`:
94101
95102
::
96103
97-
$ sudo a2enmod tile
98-
$ sudo a2enconf renderd
104+
$ printf '
105+
[example-map]
106+
URI=/tiles/renderd-example
107+
XML=/usr/share/renderd/example-map/mapnik.xml
108+
' | sudo tee -a /etc/renderd.conf
99109
110+
Start the rendering daemon
111+
112+
::
100113
101-
And run the rendering daemon
114+
$ sudo renderd
115+
116+
Enable the apache module and site:
102117
103118
::
104119
105-
$ renderd -f
120+
$ sudo a2enmod tile
121+
$ sudo a2ensite renderd-example-map
122+
123+
Restart apache:
124+
125+
::
126+
127+
$ sudo apache2ctl restart
128+
129+
Now visit the renderd example map in your browser, e.g.:
130+
131+
::
106132
107-
Make sure the ``/var/cache/renderd/tiles`` directory is writable by
108-
the user running the renderd process.
133+
http://localhost/renderd-example-map
109134
110-
Try loading a tile in your browser, e.g.
135+
Or try loading a single tile, e.g:
111136
112137
::
113138
114-
http://localhost/renderd-example/tiles/0/0/0.png
139+
http://localhost:8081/tiles/renderd-example/0/0/0.png
115140
141+
*Note: the above commands and paths may differ based on your OS/distribution.*
116142
117143
You may edit ``/etc/renderd.conf`` to indicate the location of different
118144
mapnik style sheets (up to ten) and the endpoints you wish to use to access

docs/build/building_on_centos.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Building on CentOS
2+
3+
This document provides users with step-by-step instructions on how to compile and use`mod_tile` and `renderd`.
4+
5+
Please see our [Continuous Integration script](/.github/workflows/build-and-test.yml) for more details.
6+
7+
_CentOS does not provide a `mapnik`/`mapnik-devel` package, so it will first need to be built & installed, which is beyond the scope of this document, please visit the project's [installation document on GitHub](https://github.com/mapnik/mapnik/blob/master/INSTALL.md) or our [Continuous Integration script](/.github/actions/dependencies/build-and-install/mapnik/action.yml) for more information._
8+
9+
## CentOS 7
10+
```shell
11+
#!/usr/bin/env bash
12+
13+
# Update installed packages
14+
sudo yum --assumeyes update
15+
16+
# Install build dependencies
17+
# (libmemcached-devel & librados2-devel are optional)
18+
sudo yum --assumeyes install epel-release
19+
sudo yum --assumeyes --setopt=install_weak_deps=False install \
20+
boost169-devel \
21+
cairo-devel \
22+
cmake3 \
23+
gcc \
24+
gcc-c++ \
25+
gdal \
26+
git \
27+
glib2-devel \
28+
harfbuzz-devel \
29+
httpd-devel \
30+
iniparser-devel \
31+
libcurl-devel \
32+
libicu-devel \
33+
libjpeg \
34+
libmemcached-devel \
35+
librados2-devel \
36+
libtiff \
37+
libwebp \
38+
make \
39+
proj
40+
41+
# Download, Build, Test & Install `mod_tile`
42+
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
43+
rm -rf /tmp/mod_tile_src /tmp/mod_tile_build
44+
mkdir /tmp/mod_tile_src /tmp/mod_tile_build
45+
cd /tmp/mod_tile_src
46+
git clone --depth 1 https://github.com/openstreetmap/mod_tile.git .
47+
cd /tmp/mod_tile_build
48+
cmake3 -B . -S /tmp/mod_tile_src \
49+
-DCMAKE_BUILD_TYPE:STRING=Release \
50+
-DCMAKE_CXX_FLAGS:STRING="-I/usr/include/boost169" \
51+
-DCMAKE_C_FLAGS:STRING="-I/usr/include/boost169" \
52+
-DENABLE_TESTS:BOOL=ON
53+
cmake3 --build .
54+
ctest3
55+
sudo cmake --install . --prefix /usr --strip
56+
57+
# Create /usr/share/renderd directory
58+
sudo mkdir --parents /usr/share/renderd
59+
60+
# Copy files of example map
61+
sudo cp -av /tmp/mod_tile_src/utils/example-map /usr/share/renderd/example-map
62+
63+
# Add configuration
64+
sudo cp -av /tmp/mod_tile_src/etc/apache2/renderd-example-map.conf /etc/httpd/conf.d/renderd-example-map.conf
65+
printf '\n[example-map]\nURI=/tiles/renderd-example\nXML=/usr/share/renderd/example-map/mapnik.xml\n' | sudo tee -a /etc/renderd.conf
66+
67+
# Start services
68+
sudo httpd
69+
sudo renderd -f
70+
```
71+
72+
Then you can visit: `http://localhost:8081/renderd-example-map`

docs/build/building_on_centos_7.md

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)