Install Rendering (Ubuntu 16.04) [ARCHIVED]
The purpose to this server is to render tiles.
The tiles for https://tile.osm.be/ are streamed by another server.
- Server with at least 30Go RAM
- Server with at least 8 (v)CPU
- Ubuntu 16.04 (obviously)
Just to be sure everything is up to date :
sudo apt-get update
sudo apt-get dist-upgrade
And restart your server :
sudo reboot
sudo apt-get install tar unzip wget bzip2 build-essential autoconf protobuf-c-compiler make cmake g++ \
libboost-all-dev libgeos-dev libgeos++-dev libpq-dev libbz2-dev libproj-dev libprotobuf-c0-dev \
libxml2-dev libfreetype6-dev libpng12-dev libtiff5-dev libicu-dev libgdal-dev libcairo-dev \
libtool libcairomm-1.0-dev libagg-dev libgeotiff-epsg libboost-dev libboost-system-dev \
libboost-filesystem-dev libexpat1-dev zlib1g-dev\
lua5.3 liblua5.3-dev \
apache2 apache2-dev \
munin \
fonts-noto-cjk fonts-noto-hinted fonts-noto-unhinted fonts-hanazono ttf-unifont \
gdal-bin libgdal1-dev \
libmapnik-dev mapnik-utils python-mapnik \
python-yaml
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g carto
git clone git://github.com/openstreetmap/osm2pgsql.git
cd osm2pgsql
mkdir build && cd build
cmake ..
make
sudo make install
sudo mkdir /var/lib/mod_tile
sudo chown $USER /var/lib/mod_tile
git clone git://github.com/SomeoneElseOSM/mod_tile.git
cd mod_tile
./autogen.sh
./configure
make
sudo make install
sudo make install-mod_tile
sudo ldconfig
Create /etc/apache2/mods-available/tile.load
file :
LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so
Create /etc/apache2/mods-available/tile.conf
file :
<IfModule tile_module> LoadTileConfigFile /usr/local/etc/renderd.conf ModTileRenderdSocketName /var/run/renderd/renderd.sock # Timeout before giving up for a tile to be rendered ModTileRequestTimeout 0 # Timeout before giving up for a tile to be rendered that is otherwise missing ModTileMissingRequestTimeout 30 </IfModule>
Update needed parameters :
- num_threads : should match the number of (v)CPU
-
plugins_dir : use
mapnik-config --input-plugins
to get the directory where Mapnik plugins are stored
Add following to file /usr/local/etc/renderd.conf
:
[osmbe] URI=/osmbe/ TILEDIR=/var/lib/mod_tile XML=/home/ubuntu/src/openstreetmap-carto-be/mapnik.xml HOST=localhost TILESIZE=256 MAXZOOM=18 CORS=* [osmbe-fr] URI=/osmbe-fr/ TILEDIR=/var/lib/mod_tile XML=/home/ubuntu/src/openstreetmap-carto-be/mapnik-fr.xml HOST=localhost TILESIZE=256 MAXZOOM=18 CORS=* [osmbe-nl] URI=/osmbe-nl/ TILEDIR=/var/lib/mod_tile XML=/home/ubuntu/src/openstreetmap-carto-be/mapnik-nl.xml HOST=localhost TILESIZE=256 MAXZOOM=18 CORS=*
sudo a2enmod tile
sudo service apache2 restart
Make sure the IP address of the database server is correct in project.mml
!
You will need to use ~/.pgpass
file to define the password to connect to PostgreSQL : https://www.postgresql.org/docs/current/libpq-pgpass.html.
git clone git://github.com/jbelien/openstreetmap-carto-be.git
git clone git://github.com/alx77/render_list_geo.pl.git
To render osmbe
:
sh openstreetmap-carto-be/scripts/render/process.sh
To render osmbe-fr
:
sh openstreetmap-carto-be/scripts/render/process.sh fr
To render osmbe-nl
:
sh openstreetmap-carto-be/scripts/render/process.sh nl
If you want to know in details what will happen, check https://github.com/jbelien/openstreetmap-carto-be/blob/master/scripts/render/process.sh !