Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
128 lines (92 sloc) 5.08 KB
Installing Paperwalking on Ubuntu 9
I've tested this guide on two platforms: Amazon's EC2 cloud-based computing
service, and the SheevaPlug, a miniaturized ARM-based plug computing platform.
SheevaPlug comes with Ubuntu 9.04, while EC2 can run Ubuntu 9.10 machine images.
Machine images from seem to work well, and the guide below was
produced using ami-19a34270 (alestic/ubuntu-9.10-karmic-base-20090623).
When setting up an EC2 instance, make sure it's in a security group that can
accept both SSH and HTTP connections!
With the addition of GeoTIFF creation in decoder/, a new dependency
on GDAL 1.6+ has been added. This version is present in version of Ubuntu Linux
starting at 10.4 (Lucid Lynx). Try to use the latest version where possible.
Start by logging into the server via SSH, as the root user. We assume that
the public name of the server is "" in this guide, replace it with
whatever is appropriate for your own server.
There are a few packages that you will need to install: some base material,
packaged for use by the offline image decoder, and packages to help run the
public-facing website. During the steps below, you'll be asked to create a root
MySQL password a few times, it's fine to leave this blank.
% apt-get update
% apt-get install curl vim screen tcsh sudo build-essential git-core
% apt-get install python-imaging python-numpy openjdk-6-jre-headless
% apt-get install libapache2-mod-php5 php5-gd php5-mysql mysql-server-5.1 php-pear
% apt-get install python-pyproj python-gdal gdal-bin
Paperwalking uses server packages from PHP's PEAR collection. The can be
installed via the pear utility. Some of the packages below will throw warnings
about deprecation, don't worry about those.
% pear install Crypt_HMAC HTTP_Request DB
% pear install Crypt_HMAC2 MDB2 MDB2#mysql
Apache's default configuration will need to be edited slightly. Edit the line
with "DocumentRoot" to say: DocumentRoot /var/www/paperwalking/site/www, then
restart Apache.
% pico /etc/apache2/sites-enabled/000-default
% apache2ctl restart
Try in a browser.
Now, to install Paperwalking itself:
% cd /var/www
% git clone paperwalking
% cd paperwalking
% mysql -u root
> create database paperwalking character set='utf8';
> grant select, insert, update, delete, lock tables on paperwalking.* to paperwalking@localhost identified by 'w4lks';
> flush privileges;
> quit;
% mysql -u root paperwalking < site/doc/create.mysql
% cd site && make
The main site configuration information is kept in lib/init.php. Paperwalking
comes with a blank that you have to copy and edit with your favorite text editor:
% cp lib/init.php.txt lib/init.php
% pico lib/init.php
Change these two lines (choose your own password):
1. define('DB_DSN', 'mysql://paperwalking:w4lks@localhost/paperwalking');
2. define('API_PASSWORD', 'swordfish');
And these three lines (if you want to have the map start someplace else):
1. define('DEFAULT_LATITUDE', 37.791);
2. define('DEFAULT_LONGITUDE', -122.343);
3. define('DEFAULT_ZOOM', 11);
Now try in a browser to see it work. If you try to make
a new print, you'll see a note that Paperwalking is "Preparing your print".
Leave the window open for now. You will need to start the back-end Python
process to create prints and decode scans. Run the process once with
the password you chose above:
% cd ../decoder
% python -p swordfish -b once
You'll see a few messages scroll by, and eventually the print page will be
replaced by an image of your selected area and a PDF download link. Print it,
scan it, or just convert it to a JPEG, and post the image back to your instance
of Paperwalking. Note that it's just sitting there, "queued for processing".
Keep this browser window open, because we need to build SIFT using make:
% make
Some stuff will scroll by, you may see compiler warnings, ignore these unless
actual errors show up. Run once again with the password chosen above:
% python -p swordfish -b once
Watch the scan page in your browser update as it progresses through the image.
If it works, then re-run without the "once" argument at the end.
We don't have a proper daemon wrapper for this yet, so I've just been running it
in screen as a cheap way to get a long-running process going. It sounds ghetto,
but I've had processes like this one stay up for months at a time this way.
Use of screen to maintain long-running shell sessions is described here:
Finally we can get applications IDs for three external information services,
for specific improvements to the site.
GeoPlanet is used in conjunction with the "Find" button on the map composition page:
Flickr does our reverse-geocoding, so that maps of arbitrary places can be given names:
Cloudmade provides a few extra map styles: