Toolserver:OpenStreetMap server/Setup notes

This used to be on the Toolserver wiki but as of writing it's so fantastically slow as to be unusable. So I'm moving it here.

These are notes I (Ævar Arnfjörð Bjarmason) am keeping when setting up Cassini.

Software
This is the software running on Cassini

From apt
Non-standard software installed from the package system:


 * aptitude install screen pv bzip2
 * aptitude install subversion
 * aptitude build-dep mapnik
 * aptitude install python-cairo-dev libcairomm-1.0-dev # for mapnik
 * aptitude install iotop
 * aptitude install unzip # To get a stupd CPAN package that used a .zip file instead of gz/bzip2
 * aptitude install build-essential libxml2-dev libgeos-dev libpq-dev libbz2-dev proj # for osm2pgsql
 * aptitude install postgresql-8.3-postgis

From CPAN
Things installed from the CPAN. I'm using CPANPLUS (cpanplus) to install things. If this listing is incomplete /home/ravar/.cpanplus/install-logs/ should be the full listing.


 * WWW::Mechanize
 * HTML::TableParser::Grid
 * YAML::Syck
 * App::Ack

From source
Directories with stuff built from source, in /usr/local/src/

mapnik
ravar@cassini:/usr/local/src$ svn co http://svn.mapnik.org/trunk mapnik ravar@cassini:/usr/local/src/mapnik$ python scons/scons.py configure ravar@cassini:/usr/local/src/mapnik$ python scons/scons.py ravar@cassini:/usr/local/src/mapnik$ sudo python scons/scons.py install

osm
We're using various stuff from the OSM SVN, copied with:

ravar@cassini:/usr/local/src$ svn co http://svn.openstreetmap.org/ osm

osm2pgsql
ravar@cassini:/usr/local/src/osm/applications/utils/export/osm2pgsql$ make ravar@cassini:/usr/local/src/osm/applications/utils/export/osm2pgsql$ sudo make install

osm-tools
These are our tools for setting up or own rendering/stuff hosted in MediaWiki SVN:

ravar@cassini:/usr/local/src$ svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/tools/osm-tools

Planet.osm
We have a copy of the Planet.osm file in /sql/planet.osm/

TODO: Keep it automatically up-to-date: http://wiki.openstreetmap.org/wiki/Osmosis/DetailedUsage#--read-change-interval_.28--rci.29

PostGIS
I couldn't figure out quickly how to make a PostgreSQL user gis that I could log in as avar so I made avar a PostgreSQL superuser. TODO fix.

PostgreSQL has been setup to store its data on the /sql partition:

ravar@cassini:/sql$ sudo ack -a /sql /etc/postgresql /etc/postgresql/8.3/main/postgresql.conf 38:data_directory = '/sql/postgresql/8.3/main'         # use data in another directory

I've imported both a standard OSM setup:

avar@cassini:/sql/planet.osm$ osm2pgsql -d gis-osm-like -U avar -W -S /usr/local/src/osm/applications/utils/export/osm2pgsql/default.style planet-090715.osm

And a i18n friendly version: avar@cassini:/usr/local/src/osm-tools/osm2pgsql-style$ perl wikipedia-language-codes.pl > /tmp/languages.yml avar@cassini:/usr/local/src/osm-tools/osm2pgsql-style$ perl create-wikimedia-style.pl --style /usr/local/src/osm/applications/utils/export/osm2pgsql/default.style --languages /tmp/languages.yml > /sql/planet.osm/wikimedia.style avar@cassini:/sql/planet.osm$ osm2pgsql -d gis -U avar -W -S ./wikimedia.style planet-090715.osm

Maybe this import is broken somehow, it doesn't seem big enough: http://lists.openstreetmap.org/pipermail/talk/2009-July/038786.html