Last active
April 7, 2022 20:00
-
-
Save springmeyer/2164897 to your computer and use it in GitHub Desktop.
install bleeding edge tilemill, nodejs, and mapnik
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, clear out any old mapnik or node.js installs that might conflict | |
sudo apt-get purge libmapnik libmapnik-dev mapnik-utils nodejs | |
# Also clear out any old ppa's that might conflict | |
sudo rm /etc/apt/sources.list.d/*mapnik* | |
sudo rm /etc/apt/sources.list.d/*developmentseed* | |
sudo rm /etc/apt/sources.list.d/*chris-lea* | |
# add new ppa's | |
echo 'yes' | sudo apt-add-repository ppa:chris-lea/node.js | |
echo 'yes' | sudo apt-add-repository ppa:mapnik/v2.2.0 | |
# update | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
# install nodejs latest and a few tilemill deps | |
sudo apt-get install -y nodejs git build-essential libgtk2.0-dev \ | |
libwebkitgtk-dev protobuf-compiler libprotobuf-lite7 libprotobuf-dev \ | |
libgdal1-dev | |
# Now, either install mapnik latest from packages | |
# Or see file below for installing mapnik from source | |
# and skip this line | |
sudo apt-get install -y libmapnik-dev mapnik-utils | |
# set up postgres | |
POSTGRES_VERSION=9.1 # you may need to change this depending on ubuntu version | |
POSTGIS_VERSION="1.5" # you may need to change this depending on ubuntu version | |
sudo apt-get install -y postgresql postgresql-server-dev-$POSTGRES_VERSION postgresql-$POSTGRES_VERSION-postgis | |
sudo su postgres | |
# we lost variables, reset them | |
POSTGRES_VERSION=9.1 # you may need to change this | |
POSTGIS_VERSION="1.5" # you may need to change this | |
createuser <your user> # yes to super | |
createdb template_postgis | |
createlang -d template_postgis plpgsql # you may not need this | |
POSTGIS_PATH=`pg_config --sharedir`/contrib/postgis-$POSTGIS_VERSION | |
psql -d template_postgis -f $POSTGIS_PATH/postgis.sql | |
psql -d template_postgis -f $POSTGIS_PATH/spatial_ref_sys.sql | |
exit | |
# build tilemill | |
git clone https://github.com/mapbox/tilemill.git | |
cd tilemill | |
npm install | |
# then start it... | |
# if you are running a desktop server then just boot using all the defaults | |
./index.js # should open a window automatically, but you can also view at http://localhost:20009 | |
# if you are running a headless/remote server then you can connect either | |
# by ssh connection forwarding or by opening up public access to the machine. | |
# for details on ssh forwarding see http://www.mapbox.com/tilemill/docs/guides/ubuntu-service/#ssh_connection_forwarding | |
# for details on viewing via the remote ip see http://www.mapbox.com/tilemill/docs/guides/ubuntu-service/#configuring_to_listen_for_public_traffic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installing Mapnik from source | |
# See https://github.com/mapnik/mapnik/wiki/UbuntuInstallation for more details | |
# Or, install proj4 latest and then mapnik from source: | |
wget http://download.osgeo.org/proj/proj-datumgrid-1.5.zip | |
# we use trunk instead for better threading support | |
svn co http://svn.osgeo.org/metacrs/proj/trunk/proj proj-trunk # at the time pre-release 4.8.0 | |
cd proj-trunk/nad | |
unzip -o ../../proj-datumgrid-1.5.zip | |
cd ../ | |
./configure | |
make | |
make install | |
# grab boost PPA for recent enough version | |
sudo add-apt-repository ppa:mapnik/boost | |
sudo apt-get update | |
sudo apt-get install -y libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-system-dev libboost-thread-dev | |
# mapnik dev deps | |
sudo apt-get install -y g++ cpp \ | |
libicu-dev \ | |
libboost-filesystem-dev \ | |
libboost-program-options-dev \ | |
libboost-python-dev libboost-regex-dev \ | |
libboost-system-dev libboost-thread-dev \ | |
python-dev libxml2 libxml2-dev \ | |
libfreetype6 libfreetype6-dev \ | |
libjpeg-dev \ | |
libltdl7 libltdl-dev \ | |
libpng-dev \ | |
libproj-dev \ | |
libgeotiff-dev libtiff-dev libtiffxx0c2 \ | |
libcairo2 libcairo2-dev python-cairo python-cairo-dev \ | |
libcairomm-1.0-1 libcairomm-1.0-dev \ | |
ttf-unifont ttf-dejavu ttf-dejavu-core ttf-dejavu-extra \ | |
git build-essential python-nose clang \ | |
libgdal1-dev python-gdal \ | |
postgresql-9.1 postgresql-server-dev-9.1 postgresql-contrib-9.1 postgresql-9.1-postgis \ | |
libsqlite3-dev | |
# mapnik sources | |
git clone http://github.com/mapnik/mapnik | |
cd mapnik | |
git checkout 2.3.x | |
./configure | |
make && sudo make install |
Building on Trusty this mostly still seems to work. Two minor changes:
- Replace 'nodejs' with 'nodejs-legacy'. (Installing 'nodejs' now gives an executable called 'nodejs' which probably breaks everything, whereas nodejs-legacy gives one called 'node').
- Remove libprotobuf-lite7. I don't understand why, but apt-get couldn't find it for me. Installed fine without it.
Got this working on Ubuntu 10.14 with these modifications:
- nodejs-legacy instead of node (requires uninstalling node)
- so don't add the ppa:chris-lea/node.js, use nodejs-legacy
- using Postgress 9.4-rc1
Haven't got topcube working yet, but that's not strictly required.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just tried this on a new ubuntu 12.04 server and works like a charm, I skipped all the mapnik packages as they seem to come as a node now ( I read somewhere :) ).