Bootstrapping the Demo Server

Set Up a Linux VM

Start by downloading an iso for Ubuntu Server and building a virtual machine instance. Use whatever virtualization software you may have such as VMWare, Parallels, or if you are looking for a free cross-platform option VirtualBox is a solid choice.

Amazon EC2 provides a simpler option with Amazon Machine Images (AMI) where the OS has already been installed. They have a free usage tier for getting started.

After the VM is booted, install necessary packages and dependencies from Ubuntu Server.

sudo apt-get install openssh-server postgresql postgis \
    postgresql-9.1-postgis gdal-bin openjdk-6-jdk python-gdal unzip
sudo apt-get install git python-pip python-imaging python-psycopg2 \
    python-mapnik2 osm2pgsql

Python packages can be managed with Pip to provide newer versions of packages than what is available in the Ubuntu repos.

sudo pip install django TileStache ModestMaps Werkzeug vectorformats

Set up secure remote shell access for easier remote administration.

ssh-copy-id username@hostname

Create a PostgreSQL/PostGIS database of Open Street Map data.

First, modify PostgreSQL to trust local connections, but require authentication for remote users. Add the line "local all all trust" to pg_hba.conf. Make sure to restart the database for the configuration changes to take effect.

sudo service postgresql restart

Set up PostGIS with PostgreSQL with the help of a script from the GeoDjango folks.

curl -O https://docs.djangoproject.com/en/dev/_downloads/create_template_postgis-debian.sh
chmod 755 create_template_postgis-debian.sh
sudo -u postgres ./create_template_postgis-debian.sh

Download OSM data by various world regions from Geofabrik.

curl -O http://download.geofabrik.de/osm/north-america/us/california.osm.pbf

Use the osm2pgsql loader to create a PostGIS database.

osm2pgsql -c -G -S /usr/share/osm2pgsql/default.style -U postgres -d osm california.osm.pbf

Now, clone a Git repository with Carto stylesheets for Mapnik which will greatly speed up the process of styling the raw OSM vectors.

git clone 'https://github.com/mapbox/osm-bright.git'

TileMill

TileMill makes it easy to create beautiful maps. Download an installer for your OS here.

TileStache

Set up TileStache to serve our OSM tiles by authoring the tilestache.cfg file. We will just use the included development server for the demo.

GeoServer

Download the most recent stable release of GeoServer and tour some of the features. There are many interesting extensions as well.

curl -LO http://downloads.sourceforge.net/geoserver/geoserver-2.1.3-bin.zip
unzip geoserver-2.1.3-bin.zip

Also download the Web Processing Service extension.

curl -LO http://downloads.sourceforge.net/geoserver/geoserver-2.1.3-wps-plugin.zip
unzip geoserver-2.1.3-wps-plugin.zip

Next, we can start up GeoServer.

cd /opt/geoserver-2.1.3-bin
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64
bin/startup.sh