Skip to content

Maproulette Instance Quickstart Guide

Jim McAndrew edited this page Mar 17, 2015 · 5 revisions

MapRoulette QuickStart Guide

This guide takes you through a fast installation of a Maproulette instance that can be used for testing. The installation here is similar (though not exactly the same) as the one used in production.

Install Prerequsites

You will need a Python installation with all the libraries in requirement.txt I suggest using virtualenv to keep your Maproulette installation separate.

Target System

The quickstart assumes that you have a target computer to install into. As of the time of writing, the target host should be running Ubuntu 13.10.

While you can run the fabric scripts as root, you may find it more convenient (as well as more secure) to create a separate user which has root priviledges via sudo.

Terms

The fabric scripts use a few specific terms that we will define here.

host - This is the fqdn of the system you are installing to. It must be network accessible via this name. For example, if the fqdn is foo.bar.net then you must be able to run ssh foo.bar.net successfully.

instance - This is the fqdn of the name of the hostname that maproulette will be installed to. This may be the same as the hostname, but may not be. For example, you may want to use an instance name of dev.bar.net, where dev is a CNAME to foo.bar.net

setting - This sets what type of installation you are creating, dev, test or prod. You should very likely set this to dev unless you are planning on deploying your own Maproulette in production.

In addition, there are a few settings in the config.py that require explanation as well.

SECRET_KEY - This is your application's secret key. It is used for things such as keeping your cookies secure. It should be a very long random string.

OSM 'consumer_key' and OSM 'consumer_secret' - These are OAUTH keys which you can get from api06.dev.openstreetmap.org, clicking on your username, then clicking on OAuth settings, then "Register your application"

DEFAULT CHALLENGE - This is the challenge slug of the default challenge. If you are using the test data, you can safely leave this as "test1"

MAILGUN_API_KEY - This is the API key used for Mailgun and sending mail

Installation

Find a host running Ubuntu 13.10 that you have root access to

We can't give you a machine to run these commands on. You can use a virtual host on your own machine, a cloud instance, or a physical server.

Create a user to run these commands as

The fabric commands need to run as a user who has sudo permissions. You could also use root here.

Create your configuration rc file.

Using the above terms, create a configuration file that contains the correct values. Provided below is a sample

host = myhost.example.com
user = someuser
instance = myinstance.example.com
setting = dev

Use fabric to set up the system

fab -c mynewfile setup_system

Use fabric to set up the instance

fab -c mynewfile create_deployment

Make some final configuration tweaks

You will need to log into your system and manually edit the config.py file to add in your OSM and Mailgun API keys. That configuration file will be in /srv/www/myinstance.example.com/htdocs/config.py

Restart uwsgi

fab -c mynewfile restart_uwsgi

Make yourself a peanut butter and jelly sandwich and a glass of milk.

You're done!