-
Notifications
You must be signed in to change notification settings - Fork 23
/
INSTALL
127 lines (92 loc) · 5.08 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
Installing Paperwalking on Ubuntu 9
-----------------------------------
Hardware
--------
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 Alestic.com 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/decode.py, 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 "example.host" in this guide, replace it with
whatever is appropriate for your own server.
Software
--------
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 http://example.host in a browser.
Now, to install Paperwalking itself:
% cd /var/www
% git clone http://github.com/migurski/paperwalking.git 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 http://example.host 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 poll.py process once with
the password you chose above:
% cd ../decoder
% python poll.py -p swordfish -b http://example.host 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 poll.py once again with the password chosen above:
% python poll.py -p swordfish -b http://example.host once
Watch the scan page in your browser update as it progresses through the image.
If it works, then re-run poll.py 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:
http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/
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:
http://developer.yahoo.com/geo/geoplanet/
Flickr does our reverse-geocoding, so that maps of arbitrary places can be given names:
http://www.flickr.com/services/api/keys/
Cloudmade provides a few extra map styles:
http://developers.cloudmade.com/