Skip to content

Commit

Permalink
ubuntu-vagrant: install Nominatim as vagrant user
Browse files Browse the repository at this point in the history
  • Loading branch information
lonvia committed Feb 8, 2016
1 parent ebdd250 commit a2994fc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Expand Up @@ -8,7 +8,7 @@ Vagrant.configure("2") do |config|
# If true, then any SSH connections made will enable agent forwarding.
config.ssh.forward_agent = true

#config.vm.synced_folder ".", "/home/vagrant/Nominatim"
config.vm.synced_folder ".", "/home/vagrant/Nominatim"

config.vm.define "ubuntu" do |sub|
sub.vm.box = "ubuntu/trusty64"
Expand Down
34 changes: 21 additions & 13 deletions vagrant/ubuntu-trusty-provision.sh
@@ -1,5 +1,11 @@
#!/bin/bash

# This script sets up a Nominatim installation on a Ubuntu box.
#
# For more detailed installation instructions see also
# http://wiki.openstreetmap.org/wiki/Nominatim/Installation

## Part 1: System preparation

## During 'vagrant provision' this script runs as root and the current
## directory is '/root'
Expand Down Expand Up @@ -75,20 +81,22 @@ echo "date.timezone = 'Etc/UTC'" | sudo tee /etc/php5/cli/conf.d/99-timezone.ini
###
sudo apt-get install -y libgeos-c1 libgeos++-dev libxml2-dev

## Part 2: Nominatim installaion

# now ideally login as $USERNAME and continue
su $USERNAME -l
cd /home/vagrant
cd /home/$USERNAME

# If the Nominatim source is not being shared with the host, check out source.
if [ ! -d "Nominatim" ]; then
sudo apt-get install -y git
git clone --recursive https://github.com/twain47/Nominatim.git
sudo -u $USERNAME git clone --recursive https://github.com/twain47/Nominatim.git
fi

cd Nominatim

./autogen.sh
./configure
make
sudo -u $USERNAME ./autogen.sh
sudo -u $USERNAME ./configure
sudo -u $USERNAME make
chmod +x ./
chmod +x ./module

Expand Down Expand Up @@ -139,12 +147,12 @@ Listen 8089
' | sudo tee /etc/apache2/sites-enabled/nominatim.conf > /dev/null


sudo apache2ctl graceful
apache2ctl graceful


sudo mkdir -m 755 /var/www/nominatim
sudo chown $USERNAME /var/www/nominatim
./utils/setup.php --threads 1 --create-website /var/www/nominatim
mkdir -m 755 /var/www/nominatim
chown $USERNAME /var/www/nominatim
sudo -u $USERNAME ./utils/setup.php --create-website /var/www/nominatim


# if you get 'permission denied for relation word', then try
Expand All @@ -155,12 +163,12 @@ sudo chown $USERNAME /var/www/nominatim
## Test suite (Python)
## https://github.com/twain47/Nominatim/tree/master/tests
##
sudo apt-get install -y python-dev python-pip python-Levenshtein python-shapely \
apt-get install -y python-dev python-pip python-Levenshtein python-shapely \
python-psycopg2 tidy python-nose python-tidylib
sudo pip install lettuce==0.2.18 six==1.7 haversine
pip install lettuce==0.2.18 six==1.7 haversine

## Test suite (PHP)
## https://github.com/twain47/Nominatim/tree/master/tests-php
sudo apt-get install -y phpunit
apt-get install -y phpunit


0 comments on commit a2994fc

Please sign in to comment.