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.
# 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
```
config.vm.provider "virtualbox" do |vb|
vb.gui = false
- vb.customize ["modifyvm", :id, "--memory", "1024"]
+ vb.customize ["modifyvm", :id, "--memory", "2048"]
end
# now ideally login as $USERNAME and continue
su $USERNAME -l
-pwd
-ls -la /home/vagrant
cd /home/vagrant/Nominatim
# cd ~/Nominatim
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
@define('CONST_Postgis_Version', '2.1');
// Website settings
@define('CONST_Website_BaseURL', 'http://$IP:8089/nominatim/');
-" > settings/local.php
+" > $LOCALSETTINGS_FILE
### Setup Apache/website
###
-createuser -SDR www-data
+sudo -u postgres createuser -SDR www-data
echo '
Listen 8089