]> git.openstreetmap.org Git - nominatim.git/commitdiff
Vagrant: use 2GB by default, dont overwrite local.php which would be unexpected
authormarc tobias <mtm@marcs-MacBook-Pro.local>
Thu, 9 Jul 2015 01:45:31 +0000 (03:45 +0200)
committermarc tobias <mtm@marcs-MacBook-Pro.local>
Thu, 9 Jul 2015 01:45:31 +0000 (03:45 +0200)
VAGRANT.md
Vagrantfile
vagrant-provision.sh

index d97fb3f788d2531490b30003d9934016214d6535..c662d5e40302b5acb6f1d83270d0b946cceb638e 100644 (file)
@@ -38,7 +38,8 @@ is.
 
 3. Import a small country (Monaco)
 
 
 3. Import a small country (Monaco)
 
-    You need to give the virtual machine more memory (2GB) for an import, see `Vagrantfile`.
+    You need to give the virtual machine more memory (2GB) for an import,
+    see `Vagrantfile`. Otherwise 1GB is enough.
     
     See the FAQ how to skip this step and point Nominatim to an existing database.
 
     
     See the FAQ how to skip this step and point Nominatim to an existing database.
 
@@ -46,7 +47,7 @@ is.
   # inside the virtual machine:
   cd Nominatim
     wget --no-verbose --output-document=data/monaco.osm.pbf http://download.geofabrik.de/europe/monaco-latest.osm.pbf
   # inside the virtual machine:
   cd Nominatim
     wget --no-verbose --output-document=data/monaco.osm.pbf http://download.geofabrik.de/europe/monaco-latest.osm.pbf
-    utils/setup.php --osm-file data/monaco.osm.pbf --osm2pgsql-cache 1000 --all | tee monaco.$$.log
+    ./utils/setup.php --osm-file data/monaco.osm.pbf --osm2pgsql-cache 1000 --all 2>&1 | tee monaco.$$.log
     ./utils/specialphrases.php --countries > data/specialphrases_countries.sql
     psql -d nominatim -f data/specialphrases_countries.sql
     ```
     ./utils/specialphrases.php --countries > data/specialphrases_countries.sql
     psql -d nominatim -f data/specialphrases_countries.sql
     ```
index 1b1653270c9dea2e0a542d6307da4c09039e52ec..843dd668227c6aeec154dc9ba21584577e573a24 100644 (file)
@@ -30,7 +30,7 @@ Vagrant.configure("2") do |config|
 
   config.vm.provider "virtualbox" do |vb|
     vb.gui = false
 
   config.vm.provider "virtualbox" do |vb|
     vb.gui = false
-    vb.customize ["modifyvm", :id, "--memory", "1024"]
+    vb.customize ["modifyvm", :id, "--memory", "2048"]
   end
 
 
   end
 
 
index aad75443127a7f87401e9d9efdca5128b744d1cd..68e279c54eb52a9a0cc7eb5d91de64c1b38862f3 100755 (executable)
@@ -84,8 +84,6 @@ sudo apt-get install -y libprotobuf-c0-dev protobuf-c-compiler \
 
 # now ideally login as $USERNAME and continue
 su $USERNAME -l
 
 # now ideally login as $USERNAME and continue
 su $USERNAME -l
-pwd
-ls -la /home/vagrant
 cd /home/vagrant/Nominatim
 
 # cd ~/Nominatim
 cd /home/vagrant/Nominatim
 
 # cd ~/Nominatim
@@ -96,6 +94,12 @@ chmod +x ./
 chmod +x ./module
 
 
 chmod +x ./module
 
 
+LOCALSETTINGS_FILE='settings/local.php'
+if [[ -e "$LOCALSETTINGS_FILE" ]]; then
+  echo "$LOCALSETTINGS_FILE already exist, writing to settings/local-vagrant.php instead."
+  LOCALSETTINGS_FILE='settings/local-vagrant.php'
+fi
+
 # IP=`curl -s http://bot.whatismyipaddress.com`
 IP=localhost
 echo "<?php
 # IP=`curl -s http://bot.whatismyipaddress.com`
 IP=localhost
 echo "<?php
@@ -106,7 +110,7 @@ echo "<?php
    @define('CONST_Postgis_Version', '2.1');
    // Website settings
    @define('CONST_Website_BaseURL', 'http://$IP:8089/nominatim/');
    @define('CONST_Postgis_Version', '2.1');
    // Website settings
    @define('CONST_Website_BaseURL', 'http://$IP:8089/nominatim/');
-" > settings/local.php
+" > $LOCALSETTINGS_FILE
 
 
 
 
 
 
@@ -118,7 +122,7 @@ echo "<?php
 ### Setup Apache/website
 ###
 
 ### Setup Apache/website
 ###
 
-createuser -SDR www-data
+sudo -u postgres createuser -SDR www-data
 
 echo '
 Listen 8089
 
 echo '
 Listen 8089