-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathprovision.sh
63 lines (51 loc) · 1.47 KB
/
provision.sh
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
#! /bin/sh
# locale
update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
# Add PostgreSQL PPA
sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
# update Repositories:
apt-get update
# install basic packages:
apt-get install -y \
git \
htop \
unzip \
python-dev \
python-software-properties \
python-pip \
python-psycopg2 \
build-essential \
libproj-dev \
libgeos-dev \
libgdal-dev \
protobuf-compiler \
libprotobuf-dev \
libtokyocabinet-dev \
libgeos-c1 \
postgresql-9.6 \
postgresql-9.6-postgis-2.3
# install imposm
pip install imposm
# add Tilemill PPa
add-apt-repository -y ppa:developmentseed/mapbox
# update package index:
apt-get update
# install Tilemill:
apt-get install -y \
tilemill \
libmapnik \
mapnik-utils \
nodejs
# deploy custom pg_hba.conf and restart postgres server:
ln -s -f /vagrant/config/pg_hba.conf /etc/postgresql/9.6/main/pg_hba.conf
service postgresql restart
# setup database, db user and postgis
su - postgres -c "psql -c 'CREATE USER vagrant;'"
su - postgres -c "psql -c 'CREATE DATABASE osm OWNER vagrant;'"
su - postgres -c "psql -d osm -c 'CREATE EXTENSION postgis;'"
# configure tilemill
ln -s -f /vagrant/config/tilemill.config /etc/tilemill/tilemill.config
# start tilemill as system service
service tilemill start