]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 18 Sep 2020 20:41:47 +0000 (22:41 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 18 Sep 2020 20:41:47 +0000 (22:41 +0200)
32 files changed:
.travis.yml
CMakeLists.txt
Vagrantfile
data/country_name.sql
docs/admin/Deployment.md [new file with mode: 0644]
docs/admin/Import.md
docs/admin/Installation.md
docs/develop/Development-Environment.md [new file with mode: 0644]
docs/develop/Documentation.md [deleted file]
docs/develop/Setup.md [deleted file]
docs/develop/Testing.md [moved from test/README.md with 67% similarity]
docs/mkdocs.yml
lib/ClassTypes.php
lib/init.php
settings/defaults.php
settings/import-address.style
settings/import-extratags.style
settings/import-full.style
sql/functions/address_lookup.sql
sql/functions/normalization.sql
sql/functions/placex_triggers.sql
sql/functions/ranking.sql
test/Makefile
test/bdd/api/search/queries.feature
test/bdd/api/search/structured.feature
test/bdd/db/import/addressing.feature
test/bdd/db/import/placex.feature
test/bdd/db/import/postcodes.feature
vagrant/Install-on-Travis-CI.sh [moved from vagrant/install-on-travis-ci.sh with 57% similarity]
vagrant/Install-on-Ubuntu-18-nginx.sh [deleted file]
vagrant/Install-on-Ubuntu-18.sh
vagrant/Install-on-Ubuntu-20.sh

index 4461add9f454f8150f5ea5ffebdb5e937d3405eb..b16d8106f760f74fbea9a332b5eb531b205af83e 100644 (file)
@@ -1,24 +1,21 @@
 ---
 os: linux
-dist: bionic
-language: python
-python:
-  - "3.6"
+dist: focal
 addons:
-  postgresql: "9.6"
+  postgresql: "12"
   apt:
     packages:
-      postgresql-server-dev-9.6
-      postgresql-client-9.6
+      - postgresql-server-dev-12
+      - postgresql-12-postgis-3
 git:
   depth: 3
 env:
   - TEST_SUITE=tests
   - TEST_SUITE=monaco
 before_install:
-  - phpenv global 7.1
+  - phpenv global 7.4
 install:
-  - vagrant/install-on-travis-ci.sh
+  - vagrant/Install-on-Travis-CI.sh
 before_script:
   - psql -U postgres -c "create extension postgis"
 script:
index e1ccae8724469dfebba936b78ac60e7978b3a359..5aa71800b8c235d8205062646911b2b6183d6317 100644 (file)
@@ -161,6 +161,11 @@ if (BUILD_API)
            php -S 127.0.0.1:8088
            WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/website
    )
+
+   add_custom_target(serve-global
+           php -S 0.0.0.0:8088
+           WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/website
+   )
 endif()
 
 #-----------------------------------------------------------------------------
index 87118c43524dbc9a66934afa9053ec84c54b1b32..033e1507deabf1320256d4687124cd48f90ae5b7 100644 (file)
@@ -4,18 +4,38 @@
 Vagrant.configure("2") do |config|
   # Apache webserver
   config.vm.network "forwarded_port", guest: 80, host: 8089
+  config.vm.network "forwarded_port", guest: 8088, host: 8088
 
   # If true, then any SSH connections made will enable agent forwarding.
   config.ssh.forward_agent = true
 
+  # Never sync the current directory to /vagrant.
+  config.vm.synced_folder ".", "/vagrant", disabled: true
+
   checkout = "yes"
   if ENV['CHECKOUT'] != 'y' then
-      config.vm.synced_folder ".", "/home/vagrant/Nominatim"
-      checkout = "no"
+    checkout = "no"
+  end
+
+  config.vm.provider "virtualbox" do |vb, override|
+    vb.gui = false
+    vb.memory = 2048
+    vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant","0"]
+    if ENV['CHECKOUT'] != 'y' then
+      override.vm.synced_folder ".", "/home/vagrant/Nominatim"
+    end
+  end
+
+  config.vm.provider "libvirt" do |lv, override|
+    lv.memory = 2048
+    lv.nested = true
+    if ENV['CHECKOUT'] != 'y' then
+      override.vm.synced_folder ".", "/home/vagrant/Nominatim", type: 'nfs'
+    end
   end
 
   config.vm.define "ubuntu", primary: true do |sub|
-      sub.vm.box = "bento/ubuntu-20.04"
+      sub.vm.box = "generic/ubuntu2004"
       sub.vm.provision :shell do |s|
         s.path = "vagrant/Install-on-Ubuntu-20.sh"
         s.privileged = false
@@ -23,69 +43,68 @@ Vagrant.configure("2") do |config|
       end
   end
 
-  config.vm.define "ubuntu18", primary: true do |sub|
-      sub.vm.box = "bento/ubuntu-18.04"
+  config.vm.define "ubuntu-apache" do |sub|
+      sub.vm.box = "generic/ubuntu2004"
       sub.vm.provision :shell do |s|
-        s.path = "vagrant/Install-on-Ubuntu-18.sh"
+        s.path = "vagrant/Install-on-Ubuntu-20.sh"
         s.privileged = false
-        s.args = [checkout]
+        s.args = [checkout, "install-apache"]
       end
   end
 
-  config.vm.define "ubuntu18nginx" do |sub|
-      sub.vm.box = "bento/ubuntu-18.04"
+  config.vm.define "ubuntu-nginx" do |sub|
+      sub.vm.box = "generic/ubuntu2004"
       sub.vm.provision :shell do |s|
-        s.path = "vagrant/Install-on-Ubuntu-18-nginx.sh"
+        s.path = "vagrant/Install-on-Ubuntu-20.sh"
         s.privileged = false
-        s.args = [checkout]
+        s.args = [checkout, "install-nginx"]
       end
   end
 
-  config.vm.define "ubuntu16" do |sub|
-      sub.vm.box = "bento/ubuntu-16.04"
+  config.vm.define "ubuntu18" do |sub|
+      sub.vm.box = "generic/ubuntu1804"
       sub.vm.provision :shell do |s|
-        s.path = "vagrant/Install-on-Ubuntu-16.sh"
+        s.path = "vagrant/Install-on-Ubuntu-18.sh"
         s.privileged = false
         s.args = [checkout]
       end
   end
 
-  config.vm.define "travis" do |sub|
-      sub.vm.box = "bento/ubuntu-14.04"
+  config.vm.define "ubuntu18-apache" do |sub|
+      sub.vm.box = "generic/ubuntu1804"
       sub.vm.provision :shell do |s|
-        s.path = "vagrant/install-on-travis-ci.sh"
+        s.path = "vagrant/Install-on-Ubuntu-18.sh"
         s.privileged = false
-        s.args = [checkout]
+        s.args = [checkout, "install-apache"]
       end
   end
 
-  config.vm.define "centos" do |sub|
+  config.vm.define "ubuntu18-nginx" do |sub|
+      sub.vm.box = "generic/ubuntu1804"
+      sub.vm.provision :shell do |s|
+        s.path = "vagrant/Install-on-Ubuntu-18.sh"
+        s.privileged = false
+        s.args = [checkout, "install-nginx"]
+      end
+  end
+
+  config.vm.define "centos7" do |sub|
       sub.vm.box = "centos/7"
       sub.vm.provision :shell do |s|
         s.path = "vagrant/Install-on-Centos-7.sh"
         s.privileged = false
-        s.args = "yes"
+        s.args = [checkout]
       end
-      sub.vm.synced_folder ".", "/home/vagrant/Nominatim", disabled: true
-      sub.vm.synced_folder ".", "/vagrant", disabled: true
   end
 
-  config.vm.define "centos8" do |sub|
+  config.vm.define "centos" do |sub|
       sub.vm.box = "generic/centos8"
       sub.vm.provision :shell do |s|
         s.path = "vagrant/Install-on-Centos-8.sh"
         s.privileged = false
-        s.args = "yes"
+        s.args = [checkout]
       end
-      sub.vm.synced_folder ".", "/home/vagrant/Nominatim", disabled: true
-      sub.vm.synced_folder ".", "/vagrant", disabled: true
   end
 
 
-  config.vm.provider "virtualbox" do |vb|
-    vb.gui = false
-    vb.memory = 2048
-    vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant","0"]
-  end
-
 end
index dc86ef1639db93bc31f2f306b87b7a51c1da920a..8dc02382a6f0e09d564832cc34b322170839f5a5 100644 (file)
@@ -129,7 +129,7 @@ kn  "name"=>"Saint Kitts and Nevis", "name:af"=>"Sint Kitts en Nevis", "name:ar"=
 rs     "name"=>"Србија (Serbia)", "name:af"=>"Serwië", "name:ar"=>"صربيا", "name:be"=>"Сербія", "name:br"=>"Serbia", "name:ca"=>"Sèrbia", "name:cy"=>"Serbia", "name:da"=>"Serbien", "name:de"=>"Serbien", "name:el"=>"Σερβία", "name:en"=>"Serbia", "name:eo"=>"Serbio", "name:es"=>"Serbia", "name:et"=>"Serbia", "name:fa"=>"صربستان", "name:fi"=>"Serbia", "name:fr"=>"Serbie", "name:fy"=>"Servje", "name:ga"=>"An tSeirbia", "name:gd"=>"An t-Sèarb", "name:he"=>"סרביה", "name:hr"=>"Srbija", "name:hu"=>"Szerbia", "name:id"=>"Serbia", "name:is"=>"Serbía", "name:it"=>"Serbia", "name:ja"=>"セルビア", "name:la"=>"Serbia", "name:lb"=>"Serbien", "name:li"=>"Servië", "name:lt"=>"Serbija", "name:mn"=>"Серби", "name:nb"=>"Serbia", "name:nl"=>"Servië", "name:nn"=>"Serbia", "name:no"=>"Serbia", "name:pl"=>"Serbia", "name:pt"=>"Sérvia", "name:ru"=>"Сербия", "name:sk"=>"Srbsko", "name:sl"=>"Srbija", "name:sr"=>"Србија", "name:sv"=>"Serbien", "name:th"=>"ประเทศเซอร์เบีย", "name:tr"=>"Sırbistan", "name:uk"=>"Сербія", "name:vi"=>"Serbia", "name:zh"=>"塞尔维亚", "name:haw"=>"Seripia", "name:zh_py"=>"Saierweiya", "name:zh_pyt"=>"Sāiěrwéiyà", "official_name:br"=>"Republik Serbia", "official_name:el"=>"Δημοκρατία της Σερβίας", "official_name:et"=>"Serbia Vabariik", "official_name:fr"=>"République de Serbie", "official_name:id"=>"Republik Serbia", "official_name:ja"=>"セルビア共和国", "official_name:lt"=>"Serbijos Respublika", "official_name:pt"=>"República da Sérvia", "official_name:sk"=>"Srbská republika", "official_name:sv"=>"Republiken Serbien"       sr      59
 lb     "name"=>"لبنان  Lebanon", "name:af"=>"Libanon", "name:ar"=>"لبنان", "name:be"=>"Ліван", "name:br"=>"Liban", "name:ca"=>"Líban", "name:cy"=>"Libanus", "name:da"=>"Libanon", "name:de"=>"Libanon", "name:el"=>"Λίβανος", "name:en"=>"Lebanon", "name:eo"=>"Libano", "name:es"=>"Líbano", "name:et"=>"Liibanon", "name:fa"=>"لبنان", "name:fi"=>"Libanon", "name:fr"=>"Liban", "name:fy"=>"Libanon", "name:ga"=>"An Liobáin", "name:gd"=>"Leabanon", "name:he"=>"לבנון", "name:hr"=>"Libanon", "name:hu"=>"Libanon", "name:id"=>"Lebanon", "name:is"=>"Líbanon", "name:it"=>"Libano", "name:ja"=>"レバノン", "name:la"=>"Libanus", "name:lb"=>"Libanon", "name:li"=>"Libanon", "name:lt"=>"Libanas", "name:lv"=>"Libāna", "name:mn"=>"Ливан", "name:nb"=>"Libanon", "name:nl"=>"Libanon", "name:nn"=>"Libanon", "name:no"=>"Libanon", "name:pl"=>"Liban", "name:pt"=>"Líbano", "name:ru"=>"Ливан", "name:sl"=>"Libanon", "name:sv"=>"Libanon", "name:th"=>"ประเทศเลบานอน", "name:tr"=>"Lübnan", "name:uk"=>"Ліван", "name:vi"=>"Liban", "name:zh"=>"黎巴嫩", "name:haw"=>"Lepanona", "name:zh_py"=>"Libanen", "name:zh_pyt"=>"Líbānèn", "official_name"=>"Republic of Lebanon", "official_name:br"=>"Republik Liban", "official_name:en"=>"Republic of Lebanon", "official_name:et"=>"Liibanoni Vabariik", "official_name:id"=>"Republik Lebanon", "official_name:it"=>"Repubblica Libanese", "official_name:ja"=>"レバノン共和国", "official_name:lb"=>"Republik Libanon", "official_name:lv"=>"Libānas Republika", "official_name:pl"=>"Republika Libańska", "official_name:pt"=>"República do Líbano", "official_name:sv"=>"Republiken Libanon", "official_name:vi"=>"Cộng hòa Liban"  \N      66
 bt     "name"=>"Bhutan", "name:af"=>"Bhoetan", "name:ar"=>"بوتان", "name:be"=>"Бутан", "name:br"=>"Bhoutan", "name:dz"=>"འབྲུག་ཡུལ་", "name:el"=>"Μπουτάν", "name:en"=>"Bhutan", "name:eo"=>"Butano", "name:es"=>"Bután", "name:fa"=>"بوتان", "name:fi"=>"Bhutan", "name:fr"=>"Bhoutan", "name:fy"=>"Bûtan", "name:ga"=>"An Bhútain", "name:gd"=>"Butàn", "name:he"=>"בהוטן", "name:hr"=>"Butan", "name:hu"=>"Bhután", "name:is"=>"Bútan", "name:it"=>"Bhutan", "name:ja"=>"ブータン", "name:la"=>"Butania", "name:li"=>"Bhoetaan", "name:lt"=>"Butanas", "name:lv"=>"Butāna", "name:mn"=>"Бутан", "name:pl"=>"Bhutan", "name:pt"=>"Butão", "name:ru"=>"Бутан", "name:sl"=>"Butan", "name:sv"=>"Bhutan", "name:th"=>"ประเทศภูฏาน", "name:uk"=>"Бутан", "name:zh"=>"不丹", "name:haw"=>"Butana", "name:zh_py"=>"Budan", "name:zh_pyt"=>"Bùdān", "official_name:el"=>"Βασίλειο του Μπουτάν", "official_name:en"=>"Kingdom of Bhutan", "official_name:fi"=>"Bhutanin kuningaskunta", "official_name:it"=>"Regno del Bhutan", "official_name:lt"=>"Butano Karalystė", "official_name:lv"=>"Butānas Karaliste", "official_name:pt"=>"Reino do Butão", "official_name:sv"=>"Konungariket Bhutan", "official_name:vi"=>"Vương quốc Bhutan"       dz      87
-mk     "name"=>"Ð\9cакедониÑ\98а", "name:af"=>"Masedonië", "name:ar"=>"Ù\85Ù\82دÙ\88Ù\86Ù\8aا", "name:be"=>"Ð\9cакедонÑ\96Ñ\8f", "name:br"=>"Makedonia", "name:ca"=>"Macedònia", "name:cy"=>"Gweriniaeth Macedonia", "name:da"=>"Makedonien", "name:de"=>"Mazedonien", "name:en"=>"Macedonia", "name:eo"=>"Makedonio", "name:es"=>"Macedonia", "name:et"=>"Makedoonia", "name:fa"=>"Ù\85Ù\82دÙ\88Ù\86Û\8cÙ\87", "name:fi"=>"Makedonia", "name:fr"=>"Macédoine", "name:fy"=>"Massedoanje", "name:ga"=>"An Mhacadóin", "name:gd"=>"Masadoinia", "name:he"=>"×\9eק×\93×\95× ×\99×\94", "name:hr"=>"Makedonija", "name:hu"=>"Macedónia", "name:id"=>"Republik Makedonia", "name:is"=>"Makedónía", "name:it"=>"Macedonia", "name:ja"=>"ã\83\9eã\82±ã\83\89ã\83\8bã\82¢", "name:la"=>"Respublica Macedonica", "name:lb"=>"Makedonien", "name:li"=>"Macedonië", "name:lt"=>"Makedonija", "name:lv"=>"MaÄ·edonija", "name:mn"=>"Ð\9cакедон", "name:nl"=>"Macedonië", "name:pl"=>"Macedonia", "name:pt"=>"Macedônia", "name:ru"=>"Ð\9cакедониÑ\8f", "name:sk"=>"Macedónsko", "name:sl"=>"Makedonija", "name:sv"=>"Makedonien", "name:th"=>"à¸\9bระà¹\80à¸\97ศมาà¸\8bิà¹\82à¸\94à¹\80à¸\99ีย", "name:tr"=>"Makedonya", "name:uk"=>"Ð\9cакедонÑ\96Ñ\8f", "name:vi"=>"Macedonia", "name:zh"=>"马å\85¶é¡¿", "name:haw"=>"Repupalika â\80\98o Makekonia", "name:zh_py"=>"Maqidun", "name:zh_pyt"=>"MÇ\8eqídùn", "official_name"=>"РепÑ\83блика Ð\9cакедониÑ\98а", "official_name:af"=>"Republiek van Masedonië", "official_name:be"=>"РÑ\8dÑ\81пÑ\83блÑ\96ка Ð\9cакедонÑ\96Ñ\8f ", "official_name:br"=>"Republik Makedonia", "official_name:ca"=>"Exrepública Iugoslava de Macedònia", "official_name:en"=>"Republic of Macedonia", "official_name:es"=>"República de Macedonia", "official_name:et"=>"Makedoonia Vabariik", "official_name:fr"=>"République de Macédoine", "official_name:it"=>"Repubblica di Macedonia", "official_name:ja"=>"ã\83\9eã\82±ã\83\89ã\83\8bã\82¢æ\97§ã\83¦ã\83¼ã\82´ã\82¹ã\83©ã\83\93ã\82¢å\85±å\92\8cå\9b½", "official_name:lv"=>"MaÄ·edonijas Republika", "official_name:pl"=>"Republika Macedonii", "official_name:pt"=>"República da Macedônia", "official_name:sk"=>"Macedónska republika", "official_name:sl"=>"Republika Makedonija", "official_name:sv"=>"Republiken Makedonien", "official_name:vi"=>"Cá»\99ng hòa Macedonia"     mk      69
+mk     "name"=>"СевеÑ\80на Ð\9cакедониÑ\98а", "name:af"=>"Masedonië", "name:ak"=>"Masedonia", "name:am"=>"á\88\9bá\88´á\8b¶á\8a\95á\8b«", "name:an"=>"Republica de Macedonia", "name:ar"=>"Ø´Ù\85اÙ\84 Ù\85Ù\82دÙ\88Ù\86Ù\8aا", "name:az"=>"Masedoniya", "name:ba"=>"Ð\9cакедониÑ\8f Ð ÐµÑ\81пÑ\83бликаһÑ\8b", "name:be"=>"Ð\9cакедонÑ\96Ñ\8f", "name:bg"=>"СевеÑ\80на Ð\9cакедониÑ\8f", "name:bi"=>"Macedonia", "name:bm"=>"MacedÉ\94ni", "name:bn"=>"মà§\87সিডà§\8bনিয়া[FYROM]", "name:bo"=>"à½\98à¼\8bསེà¼\8bà½\8cོà¼\8bà½\93ིཡà¼\8d (རà¾\92ྱལà¼\8bà½\81à½\96à¼\8d)", "name:br"=>"Makedonia", "name:bs"=>"Sjeverna Makedonija", "name:ca"=>"Macedònia del Nord", "name:ce"=>"Ð\9cакедони", "name:cs"=>"Severní Makedonie", "name:cu"=>"Ð\9cакÑ\94донÑ\97ê\99\97", "name:cv"=>"Ð\9cакедони Ð ÐµÑ\81пÑ\83блики", "name:cy"=>"Gogledd Macedonia", "name:da"=>"Nordmakedonien", "name:de"=>"Nordmazedonien", "name:dv"=>"Þ\89Þ¬Þ\90Þ¬Þ\91Þ¯Þ\82Þ¨Þ\87Þ§", "name:dz"=>"à½\98à¼\8bསེà¼\8bà½\8cོà¼\8bà½\93ིà¼\8bཡà¼\8b [ཡུà¼\8bà½\82ོà¼\8bསླཱà¼\8bà½\96ིà¼\8bཡ]", "name:ee"=>"Makedonia", "name:el"=>"Î\92Ï\8cÏ\81εια Î\9cακεδονία", "name:en"=>"North Macedonia", "name:eo"=>"Nord-Makedonio", "name:es"=>"Macedonia del Norte", "name:et"=>"Põhja-Makedoonia", "name:eu"=>"Ipar Mazedonia", "name:fa"=>"Ù\85Ù\82دÙ\88Ù\86Û\8cÙ\87 Ø´Ù\85اÙ\84Û\8c", "name:ff"=>"Meceduwaan", "name:fi"=>"Makedonia", "name:fo"=>"Makedónia", "name:fr"=>"Macédoine du Nord", "name:fy"=>"Noard-Masedoanje", "name:ga"=>"An Mhacadóin", "name:gd"=>"Masadoinia a Tuath", "name:gl"=>"Macedonia do Norte", "name:gn"=>"Masendoña", "name:gu"=>"મà«\87સà«\87ડà«\8bનિયા", "name:gv"=>"Massadoan Hwoaie", "name:ha"=>"Masedoniya", "name:he"=>"×\9eק×\93×\95× ×\99×\94 ×\94צפ×\95× ×\99ת", "name:hi"=>"à¤\89तà¥\8dतर à¤®à¥\87सà¥\80डà¥\8bनिया", "name:hr"=>"Sjeverna Makedonija", "name:ht"=>"Repiblik d Masedoni", "name:hu"=>"Ã\89szak-Macedónia", "name:hy"=>"Õ\84Õ¡Õ¯Õ¥Õ¤Õ¸Õ¶Õ«Õ¡ÕµÕ« Õ\80Õ¡Õ¶Ö\80Õ¡ÕºÕ¥Õ¿Õ¸Ö\82Õ©ÕµÕ¸Ö\82Õ¶", "name:ia"=>"Macedonia", "name:id"=>"Republik Makedonia", "name:ie"=>"Macedonia", "name:io"=>"Republiko Macedonia", "name:is"=>"Makedónía", "name:it"=>"Macedonia del Nord", "name:ja"=>"å\8c\97ã\83\9eã\82±ã\83\89ã\83\8bã\82¢", "name:jv"=>"Républik Makedonia", "name:ka"=>"á\83\9bá\83\90á\83\99á\83\94á\83\93á\83\9dá\83\9cá\83\98á\83\90", "name:kg"=>"Makedonia", "name:ki"=>"Masedonia", "name:kk"=>"Ð\9cакедониÑ\8f Ð ÐµÑ\81пÑ\83бликаÑ\81Ñ\8b", "name:kl"=>"Makedonia", "name:km"=>"á\9e\98á\9f\89á\9e¶á\9e\9fá\9f\81á\9e\8aá\9f\92á\9e\9cá\9e¶á\9e\93", "name:kn"=>"ಮà³\8dಯಾಸಿಡà³\8bನಿಯ", "name:ko"=>"ë§\88ì¼\80ë\8f\84ë\8b\88ì\95\84", "name:ks"=>"Ù\85ٮ۪سÙ\88Ú\91Ù\88Ù\86Ù\90Û\8cا", "name:ku"=>"Komara Makedonyayê", "name:kv"=>"Ð\9cакедониÑ\8f Ð ÐµÑ\81пÑ\83блика", "name:kw"=>"Repoblek Makedoni", "name:la"=>"Macedonia Septentrionalis", "name:lb"=>"Nordmazedonien", "name:lg"=>"Masedoniya", "name:li"=>"Noord-Macedonië", "name:ln"=>"Masedoni", "name:lo"=>"ມາàº\8aີà»\82àº\94à»\80àº\99àº\8d", "name:lt"=>"Å iaurÄ\97s Makedonija", "name:lv"=>"ZiemeļmaÄ·edonija", "name:mg"=>"Makedonia", "name:mi"=>"MakerÅ\8dnia", "name:mk"=>"СевеÑ\80на Ð\9cакедониÑ\98а", "name:ml"=>"റിപàµ\8dപബàµ\8dലിà´\95àµ\8d à´\93à´«àµ\8d à´®à´¾à´¸à´¿à´¡àµ\8bണിയ", "name:mn"=>"Ð\91үгд Ð\9dайÑ\80амдаÑ\85 Ð\9cакедон Ð£Ð»Ñ\81", "name:mr"=>"मà¥\85सिडà¥\8bनिया", "name:ms"=>"Republik Macedonia", "name:mt"=>"Repubblika tal-MaÄ\8bedonja", "name:my"=>"á\80\99á\80\80á\80ºá\80\85á\80®á\80\92á\80­á\80¯á\80¸á\80\94á\80®á\80¸á\80\9aá\80¬á\80¸á\80\94á\80­á\80¯á\80\84á\80ºá\80\84á\80¶", "name:na"=>"Matedoniya", "name:ne"=>"मà¥\8dयासà¥\87डà¥\8bनिया", "name:nl"=>"Noord-Macedonië", "name:nn"=>"Nord-Makedonia", "name:no"=>"Nord-Makedonia", "name:oc"=>"Republica de Macedònia", "name:or"=>"ମାସିଡà­\8bନିà¬\86", "name:os"=>"РеÑ\81пÑ\83бликæ Ð\9cакедони", "name:pa"=>"ਮà¨\95ਦà©\82ਨà©\80à¨\86 à¨\97ਣਰਾà¨\9c", "name:pl"=>"Macedonia PóÅ\82nocna", "name:ps"=>"د Ù\85Ù\82دÙ\88Ù\86Ù\8aÛ\90 Ù\88Ù\84سÙ\85شرÙ\8aزÙ\87", "name:pt"=>"Macedónia do Norte", "name:qu"=>"Makidunya", "name:rm"=>"Macedonia", "name:rn"=>"Masedoniya", "name:ro"=>"Macedonia de Nord", "name:ru"=>"СевеÑ\80наÑ\8f Ð\9cакедониÑ\8f", "name:rw"=>"Masedoniya", "name:sa"=>"मà¥\87सà¥\87डà¥\8bनिया", "name:sc"=>"Matzedònia", "name:se"=>"Davvi-Makedonia", "name:sg"=>"Maseduäni", "name:sh"=>"Severna Makedonija", "name:si"=>"මà·\90à·\83à·\92ඩà·\9dනà·\92යà·\8fන [FYROM]", "name:sk"=>"Severné Macedónsko", "name:sl"=>"Makedonija", "name:sn"=>"Macedonia", "name:so"=>"Makedonia", "name:sq"=>"Maqedonia e Veriut", "name:sr"=>"СевеÑ\80на Ð\9cакедониÑ\98а", "name:ss"=>"IMakhedoniya", "name:su"=>"Makédonia", "name:sv"=>"Nordmakedonien", "name:sw"=>"Jamhuri ya Masedonia", "name:ta"=>"மாà®\95à¯\8dà®\95à®\9fà¯\8bனியà®\95à¯\8d à®\95à¯\81à®\9fியரà®\9aà¯\81", "name:te"=>"à°®à±\87సిడà±\8bనియా", "name:tg"=>"Ò¶Ñ\83мҳÑ\83Ñ\80ии Ð\9cаÒ\9bдÑ\83ниÑ\8f", "name:th"=>"à¸\9bระà¹\80à¸\97ศมาà¸\8bิà¹\82à¸\94à¹\80à¸\99ีย", "name:ti"=>"á\88\9bá\8a¨á\8b¶á\8a\92á\8b«", "name:tk"=>"Makedoniýa Respublikasy", "name:tl"=>"Republika ng Masedonya", "name:to"=>"MasitÅ\8dnia [FYROM]", "name:tr"=>"Kuzey Makedonya", "name:tt"=>"Ð\9cакедониÑ\8f Ò\96өмһүÑ\80иÑ\8fÑ\82е", "name:ug"=>"Ù\85اÙ\83Û\90دÙ\88Ù\86Ù\89Ù\8aÛ\95", "name:uk"=>"Ð\9fÑ\96внÑ\96Ñ\87на Ð\9cакедонÑ\96Ñ\8f", "name:ur"=>"Ø´Ù\85اÙ\84Û\8c Ù\85Ù\82دÙ\88Ù\86Û\8cÛ\81", "name:uz"=>"Makedoniya Respublikasi", "name:vi"=>"Bắc Macedonia", "name:vo"=>"Nolüda-Makedoniyän", "name:wo"=>"Réewum Maseduwaan", "name:yi"=>"רעפ×\95×\91×\9c×\99ק ×¤×\95×\9f ×\9e×\90קע×\93×\90× ×\99×¢", "name:yo"=>"OrílẹÌ\80-èdè Olómìnira ilẹÌ\80 Makẹdóníà", "name:zh"=>"å\8c\97马å\85¶é¡¿å\85±å\92\8cå\9b½", "name:zu"=>"isi-Macedonia [FYROM]", "int_name"=>"North Macedonia", "name:ace"=>"Masèdonia", "name:als"=>"Republik Mazedonien", "name:ang"=>"Macedonia CynewÄ«se", "name:arc"=>"Ü©Ü\98Ü\9bÜ¢Ü\9dÜ\98ܬÜ\90 Ü\95Ü¡Ü©Ü\95Ü\98Ü¢Ü\9dÜ\90", "name:arz"=>"جÙ\85Ù\87Ù\88رÙ\8aØ© Ù\85Ù\82دÙ\88Ù\86Ù\8aا", "name:ast"=>"República de Macedonia", "name:bar"=>"Mazedonien", "name:bcl"=>"Republika kan Masedonya", "name:ceb"=>"Republika sa Macedonia", "name:chr"=>"á\8e¹á\8f\8fá\8f\99á\8f\82á\8e¢á\8e ", "name:ckb"=>"Ú©Û\86Ù\85ارÛ\8c Ù\85Û\95Ù\82دÙ\88Ù\88Ù\86Û\8cا", "name:crh"=>"Makedoniya Cumhuriyeti", "name:csb"=>"MacedoÅ\84skô", "name:diq"=>"Cumhuriyetê Makedonya", "name:dsb"=>"MakedoÅ\84ska", "name:ext"=>"Repúbrica de Macedónia", "name:frp"=>"Rèpublica de Macèdonie", "name:frr"=>"Mazedoonien", "name:fur"=>"Macedonie", "name:gag"=>"Makedoniya", "name:hak"=>"Mâ-khì-tun", "name:haw"=>"Repupalika â\80\98o Makekonia", "name:hif"=>"Macedonia", "name:hsb"=>"Makedonska", "name:ilo"=>"Macedonia", "name:jbo"=>"makedonias", "name:kaa"=>"Makedoniya", "name:kab"=>"Masidwan", "name:kbd"=>"РеÑ\81пÑ\83бликÑ\8d Ð\9cакедониÑ\8d", "name:koi"=>"РеÑ\81пÑ\83блика Ð\9cакедониÑ\8f", "name:krc"=>"Ð\9cакедониÑ\8f", "name:ksh"=>"de vörmaals ens jugoÃ\9flaawesch jewääse Republik Mazedoonije", "name:lad"=>"Makedonia", "name:lfn"=>"Macedonia", "name:lij"=>"Maçedònia", "name:lmo"=>"Macedonia", "name:ltg"=>"Makedonejis Republika", "name:mdf"=>"Ð\9cакедоние", "name:mhr"=>"Ð\9cакедоний", "name:nah"=>"TlÄ\81catlahtohcÄ\81\8dtl Macedonia", "name:nan"=>"Makedonija KiÅ\8dng-hô-kok", "name:nds"=>"Republiek Makedonien", "name:pam"=>"Republika ning Makedonia", "name:pap"=>"Macedonia", "name:pcd"=>"Machédoène", "name:pih"=>"Repablik o' Masedoenya", "name:pms"=>"Macedònia", "name:rmy"=>"Nordutni Makedoniya", "name:sah"=>"Ð\9cакедониÑ\8f", "name:scn"=>"Macidonia", "name:sco"=>"Macedonie", "name:smn"=>"Tave-Makedonia", "name:sms"=>"Tâʹvv-Makedonia", "name:stq"=>"Makedonien", "name:szl"=>"MacedůÅ\84ijo", "name:tok"=>"ma Maketonija", "name:udm"=>"Ð\9cакедониÑ\8f Ð ÐµÑ\81пÑ\83блика", "name:vec"=>"Republica de Macedonia", "name:vep"=>"Makedonii", "name:vls"=>"Nôord-Macedonië", "name:war"=>"Republika han Macedonia", "name:wuu"=>"å\8c\97马å\85¶é¡¿", "name:xal"=>"Ð\9cаÑ\81идин Ð\9eÑ\80н", "name:xmf"=>"á\83\9bá\83\90á\83\99á\83\94á\83\93á\83\9dá\83\9cá\83\98á\83\90", "name:yue"=>"å\8c\97馬å\85¶é \93å\85±å\92\8cå\9c\8b", "name:zea"=>"Macedonië", "old_name"=>"Ð\9cакедониÑ\98а", "name:UN:ar"=>"جÙ\85Ù\87Ù\88رÙ\8aØ© Ø´Ù\85اÙ\84 Ù\85Ù\82دÙ\88Ù\86Ù\8aا", "name:UN:el"=>"Î\92Ï\8cÏ\81εια Î\9cακεδονία", "name:UN:en"=>"Republic of North Macedonia", "name:UN:es"=>"Macedonia del Norte", "name:UN:fr"=>"l'ex-République yougoslave de Macédoine", "name:UN:he"=>"×\94רפ×\95×\91×\9c×\99ק×\94 ×\94×\99×\95×\92×\95ס×\9c×\91×\99ת ×\9cשע×\91ר ×©×\9c ×\9eק×\93×\95× ×\99×\94", "name:UN:hr"=>"BivÅ¡a Jugoslavenska Republika Makedonija", "name:UN:ru"=>"бÑ\8bвÑ\88аÑ\8f Ñ\8eгоÑ\81лавÑ\81каÑ\8f Ð ÐµÑ\81пÑ\83блика Ð\9cакедониÑ\8f", "name:UN:sk"=>"Bývalá Juhoslovanská Republika Macedónsko", "name:UN:zh"=>"å\89\8då\8d\97æ\96¯æ\8b\89夫ç\9a\84马å\85¶é¡¿å\85±å\92\8cå\9b½", "name:pt-BR"=>"Macedônia do Norte", "name:zh_py"=>"Maqidun", "alt_name:ar"=>"Ù\85Ù\82دÙ\88Ù\86Ù\8aا Ø§Ù\84Ø´Ù\85اÙ\84Ù\8aØ©", "alt_name:br"=>"Ez-Republik Yougoslaviat Makedonia", "alt_name:eo"=>"Nord-Makedonujo", "alt_name:pt"=>"Antiga República Jugoslava da Macedónia", "alt_name:vi"=>"Bắc Ma-xê-Ä\91ô-ni-a;Ma-xê-Ä\91ô-ni-a;Bắc Mác-kê-Ä\91ôn-ni-a;Mác-kê-Ä\91ôn-ni-a", "name:nds-nl"=>"Massedonië", "name:zh_pyt"=>"MÇ\8eqídùn", "old_name:ar"=>"Ù\85Ù\82دÙ\88Ù\86Ù\8aا", "old_name:bg"=>"Ð\9cакедониÑ\8f", "old_name:bs"=>"Makedonija", "old_name:cs"=>"Makedonie", "old_name:cy"=>"Macedonia", "old_name:de"=>"Mazedonien", "old_name:el"=>"ΠÏ\81Ï\8eην Î\93ιοÏ\85γκοÏ\83λαβική Î\94ημοκÏ\81αÏ\84ία Ï\84ηÏ\82 Î\9cακεδονίαÏ\82", "old_name:en"=>"Macedonia", "old_name:eu"=>"Mazedonia", "old_name:fa"=>"Ù\85Ù\82دÙ\88Ù\86Û\8cÙ\87", "old_name:fr"=>"Macédoine", "old_name:fy"=>"Masedoanje", "old_name:he"=>"×\9eק×\93×\95× ×\99×\94", "old_name:hr"=>"Makedonija", "old_name:ja"=>"ã\83\9eã\82±ã\83\89ã\83\8bã\82¢", "old_name:mk"=>"Ð\9cакедониÑ\98а", "old_name:nl"=>"Macedonië", "old_name:nn"=>"Makedonia", "old_name:no"=>"Makedonia", "old_name:pt"=>"Macedônia", "old_name:ro"=>"Macedonia", "old_name:se"=>"Makedonia", "old_name:sk"=>"Macedónsko", "old_name:sq"=>"Maqedoni", "old_name:sr"=>"Ð\9cакедониÑ\98а", "old_name:tr"=>"Makedonya Cumhuriyeti", "old_name:uk"=>"Ð\9cакедонÑ\96Ñ\8f", "old_name:ur"=>"Ù\85Ù\82دÙ\88Ù\86Û\8cÛ\81", "old_name:vi"=>"Macedonia", "old_name:zh"=>"马å\85¶é¡¿å\85±å\92\8cå\9b½", "name:bat-smg"=>"MakeduonÄ\97\97", "name:fiu-vro"=>"Makõdoonia Vabariik", "name:roa-rup"=>"Machedonia", "name:sr-Latn"=>"Severna Makedonija", "old_name:rmy"=>"Makedoniya", "name:roa-tara"=>"Macidonie", "official_name"=>"РепÑ\83блика Ð¡ÐµÐ²ÐµÑ\80на Ð\9cакедониÑ\98а", "short_name:ca"=>"Macedònia", "short_name:en"=>"Macedonia", "short_name:hr"=>"Makedonija", "short_name:mk"=>"Ð\9cакедониÑ\98а", "short_name:sl"=>"Makedonija", "short_name:zh"=>"å\8c\97马å\85¶é¡¿", "name:be-tarask"=>"РÑ\8dÑ\81пÑ\83блÑ\96ка Ð\9cакедонÑ\96Ñ\8f", "name:zh_pinyin"=>"MÇ\8eqídùn", "official_name:af"=>"Republiek van Masedonië", "official_name:ar"=>"جÙ\85Ù\87Ù\88رÙ\8aØ© Ø´Ù\85اÙ\84 Ù\85Ù\82دÙ\88Ù\86Ù\8aا", "official_name:be"=>"РÑ\8dÑ\81пÑ\83блÑ\96ка Ð\9cакедонÑ\96Ñ\8f ", "official_name:bg"=>"РепÑ\83блика Ð¡ÐµÐ²ÐµÑ\80на Ð\9cакедониÑ\8f", "official_name:br"=>"Republik Makedonia", "official_name:bs"=>"Republika Sjeverna Makedonija", "official_name:ca"=>"República de Macedònia del Nord", "official_name:cs"=>"Republika Severní Makedonie", "official_name:cy"=>"Gweriniaeth Gogledd Macedonia", "official_name:de"=>"Republik Nordmazedonien", "official_name:el"=>"Î\94ημοκÏ\81αÏ\84ία Ï\84ηÏ\82 Î\92Ï\8cÏ\81ειαÏ\82 Î\9cακεδονίαÏ\82", "official_name:en"=>"Republic of North Macedonia", "official_name:eo"=>"Respubliko Makedonujo", "official_name:es"=>"República de Macedonia del Norte", "official_name:et"=>"Makedoonia Vabariik", "official_name:eu"=>"Ipar Mazedoniako Errepublika", "official_name:fa"=>"جÙ\85Ù\87Ù\88رÛ\8c Ù\85Ù\82دÙ\88Ù\86Û\8cÙ\87 Ø´Ù\85اÙ\84Û\8c", "official_name:fr"=>"République de Macédoine du Nord", "official_name:gl"=>"República de Macedonia do Norte", "official_name:he"=>"רפ×\95×\91×\9c×\99קת ×\9eק×\93×\95× ×\99×\94 ×\94צפ×\95× ×\99ת", "official_name:hr"=>"Republika Sjeverna Makedonija", "official_name:it"=>"Repubblica di Macedonia del Nord", "official_name:ja"=>"ã\83\9eã\82±ã\83\89ã\83\8bã\82¢æ\97§ã\83¦ã\83¼ã\82´ã\82¹ã\83©ã\83\93ã\82¢å\85±å\92\8cå\9b½", "official_name:ku"=>"Komara Makedonyayê", "official_name:lv"=>"MaÄ·edonijas Republika", "official_name:mk"=>"РепÑ\83блика Ð¡ÐµÐ²ÐµÑ\80на Ð\9cакедониÑ\98а", "official_name:nn"=>"Republikken Nord-Makedonia", "official_name:no"=>"Republikken Nord-Makedonia", "official_name:pl"=>"Republika Macedonii PóÅ\82nocnej", "official_name:pt"=>"República da Macedônia", "official_name:ro"=>"Republica Macedonia", "official_name:se"=>"Dásseváldi Davvi-Makedonia", "official_name:sk"=>"Republika Severné Macedónsko", "official_name:sl"=>"Republika Makedonija", "official_name:sq"=>"Republika e Maqedonisë së Veriut", "official_name:sr"=>"РепÑ\83блика Ð¡ÐµÐ²ÐµÑ\80на Ð\9cакедониÑ\98а", "official_name:sv"=>"Republiken Makedonien", "official_name:tl"=>"Republika ng Masedonya", "official_name:tr"=>"Kuzey Makedonya Cumhuriyeti", "official_name:uk"=>"РеÑ\81пÑ\83блÑ\96ка Ð\9cакедонÑ\96Ñ\8f", "official_name:ur"=>"جÙ\85Û\81Ù\88رÛ\8cÛ\81 Ø´Ù\85اÙ\84Û\8c Ù\85Ù\82دÙ\88Ù\86Û\8cÛ\81", "official_name:vi"=>"Cá»\99ng hòa Bắc Macedonia", "old_name:sr-Latn"=>"Makedonija", "official_name:sr-Latn"=>"Republika Severna Makedonija"  mk      69
 pg     "name"=>"Papua New Guinea", "name:af"=>"Papoea-Nieu-Guinee", "name:ar"=>"بابوا نيوغينيا", "name:be"=>"Папуа-Новая Гвінея ", "name:br"=>"Papoua Ginea Nevez", "name:ca"=>"Papua Nova Guinea", "name:cy"=>"Papua Guinea Newydd", "name:da"=>"Papua Ny Guinea", "name:de"=>"Papua-Neuguinea", "name:en"=>"Papua New Guinea", "name:eo"=>"Papuo-Nov-Gvineo", "name:es"=>"Papúa Nueva Guinea", "name:et"=>"Paapua Uus-Guinea", "name:fa"=>"پاپوآ گینه نو", "name:fi"=>"Papua-Uusi-Guinea", "name:fr"=>"Papouasie-Nouvelle-Guinée", "name:fy"=>"Papoea Nij-Guinea", "name:ga"=>"Nua-Ghuine Phapua", "name:gd"=>"Papua Gini-Nuadh", "name:he"=>"פפואה גינאה החדשה", "name:hr"=>"Papua Nova Gvineja", "name:hu"=>"Pápua Új-Guinea", "name:id"=>"Papua Nugini", "name:is"=>"Papúa Nýja-Gínea", "name:it"=>"Papua Nuova Guinea", "name:la"=>"Papua Nova Guinea", "name:lb"=>"Papua-Neiguinea", "name:li"=>"Papoea-Nui-Guinea", "name:lt"=>"Papua ir Naujoji Gvinėja", "name:lv"=>"Papua-Jaungvineja", "name:mn"=>"Папуа-Шинэ Гвиней", "name:nl"=>"Papoea-Nieuw-Guinea", "name:pl"=>"Papua-Nowa Gwinea", "name:ru"=>"Папуа-Новая Гвинея", "name:sl"=>"Papua Nova Gvineja", "name:sv"=>"Papua Nya Guinea", "name:th"=>"ประเทศปาปัวนิวกินี", "name:tr"=>"Papua -Yeni Gine", "name:uk"=>"Папуа-Нова Гвінея", "name:zh"=>"巴布亚新几内亚", "official_name"=>"Independent State of Papua New Guinea;Independen Stet bilong Papua Niugini", "official_name:es"=>"Estado Independiente de Papúa Nueva Guínea", "official_name:et"=>"Paapua Uus-Guinea Iseseisvusriik", "official_name:lv"=>"Papua-Jaungvinejas Neatkarīgā Valsts", "official_name:pl"=>"Niezależne Państwo Papui-Nowej Gwinei", "official_name:vi"=>"Quốc gia Độc lập Papua New Guinea"      \N      71
 sd     "name"=>"السودان ‎al-Sūdān", "name:af"=>"Soedan", "name:ar"=>"السودان", "name:be"=>"Судан", "name:br"=>"Soudan", "name:ca"=>"Sudan ", "name:cy"=>"Sudan", "name:da"=>"Sudan", "name:de"=>"Sudan", "name:el"=>"Σουδάν", "name:en"=>"Sudan", "name:eo"=>"Sudano", "name:es"=>"Sudán", "name:et"=>"Sudaan", "name:fa"=>"سودان", "name:fi"=>"Sudan", "name:fr"=>"Soudan", "name:fy"=>"Sûdan", "name:ga"=>"An tSúdáin", "name:gd"=>"Sudan", "name:he"=>"סודן", "name:hr"=>"Sudan", "name:hu"=>"Szudán", "name:id"=>"Sudan", "name:is"=>"Súdan", "name:it"=>"Sudan", "name:ja"=>"スーダン", "name:la"=>"Sudania", "name:lb"=>"Sudan", "name:li"=>"Soedaan", "name:lt"=>"Sudanas", "name:lv"=>"Sudāna", "name:mn"=>"Судан", "name:nl"=>"Soedan", "name:pl"=>"Sudan", "name:pt"=>"Sudão", "name:ru"=>"Судан", "name:sl"=>"Sudan", "name:sv"=>"Sudan", "name:th"=>"ประเทศซูดาน", "name:tr"=>"Sudan", "name:uk"=>"Судан", "name:vi"=>"Sudan", "name:zh"=>"苏丹", "name:haw"=>"Sudana", "name:zh_py"=>"Sudan", "name:zh_pyt"=>"Sūdān", "official_name"=>"جمهورية السودان", "official_name:br"=>"Republik Soudan", "official_name:el"=>"Δημοκρατία του Σουδάν", "official_name:en"=>"Republic of Sudan", "official_name:et"=>"Sudaani Vabariik", "official_name:fr"=>"République du Soudan", "official_name:id"=>"Republik Sudan", "official_name:ja"=>"スーダン共和国", "official_name:lb"=>"Republik Sudan", "official_name:pt"=>"República do Sudão", "official_name:sv"=>"Republiken Sudan", "official_name:vi"=>"Cộng hòa Sudan"      \N      72
 za     "name"=>"South Africa", "name:af"=>"Suid-Afrika", "name:ar"=>"جنوب أفريقيا", "name:be"=>"Паўднёва-Афрыканская Рэспубліка", "name:br"=>"Suafrika", "name:ca"=>"Sud-àfrica", "name:cy"=>"De Affrica", "name:da"=>"Sydafrika", "name:de"=>"Südafrika", "name:el"=>"Νότια Αφρική", "name:en"=>"South Africa", "name:eo"=>"Sudafriko", "name:es"=>"Sudáfrica", "name:et"=>"Lõuna-Aafrika Vabariik", "name:fa"=>"آفریقای جنوبی", "name:fi"=>"Etelä-Afrikka", "name:fr"=>"Afrique du Sud", "name:fy"=>"Súd-Afrika", "name:ga"=>"An Afraic Theas", "name:gd"=>"Afraga a Deas", "name:he"=>"דרום אפריקה", "name:hr"=>"Južnoafrička Republika", "name:hu"=>"Dél-Afrikai Köztársaság", "name:id"=>"Afrika Selatan", "name:is"=>"Suður-Afríka", "name:it"=>"Sudafrica", "name:ja"=>"南アフリカ", "name:la"=>"Africa Australis", "name:lb"=>"Südafrika", "name:li"=>"Zuud-Afrika", "name:lt"=>"Pietų Afrikos Respublika", "name:mn"=>"Өмнөд Африк", "name:nl"=>"Zuid-Afrika", "name:pl"=>"Republika Południowej Afryki", "name:pt"=>"África do Sul", "name:ru"=>"Южная Африка", "name:sl"=>"Južna Afrika", "name:ss"=>"INingizimu Afrika", "name:st"=>"Afrika Borwa", "name:sv"=>"Sydafrika", "name:th"=>"ประเทศแอฟริกาใต้", "name:tn"=>"Aferika Borwa", "name:tr"=>"Güney Afrika", "name:ts"=>"Afrika-Dzonga", "name:uk"=>"Південно-Африканська Республіка", "name:ve"=>"Afurika Tshipembe", "name:vi"=>"Nam Phi", "name:xh"=>"uMzantsi Afrika", "name:zh"=>"南非", "name:zu"=>"Ningizimu Afrika", "name:haw"=>"ʻApelika Hema", "name:zh_py"=>"Nan Fei", "name:zh_pyt"=>"Nán Fēi", "official_name"=>"Republic of South Africa", "official_name:br"=>"Republik Suafrika", "official_name:en"=>"Republic of South Africa", "official_name:fr"=>"République d'Afrique du Sud", "official_name:gd"=>"Poblachd Afraga a Deas", "official_name:id"=>"Republik Afrika Selatan", "official_name:ja"=>"南アフリカ共和国", "official_name:lb"=>"Republik Südafrika", "official_name:pt"=>"República da África do Sul", "official_name:ru"=>"Южно-Африканская Республика", "official_name:sl"=>"Republika Južna Afrika", "official_name:sv"=>"Republiken Sydafrika", "official_name:ts"=>"Riphabliki ra Afrika Dzonga", "official_name:ve"=>"Riphabuḽiki ya Afurika Tshipembe", "official_name:vi"=>"Cộng hòa Nam Phi"     \N      76
diff --git a/docs/admin/Deployment.md b/docs/admin/Deployment.md
new file mode 100644 (file)
index 0000000..9ef7f48
--- /dev/null
@@ -0,0 +1,141 @@
+# Deploying Nominatim
+
+The Nominatim API is implemented as a PHP application. The `website/` directory
+in the build directory contains the configured website. You can serve this
+in a production environment with any web server that is capable to run
+PHP scripts.
+
+This section gives a quick overview on how to configure Apache and Nginx to
+serve Nominatim. It is not meant as a full system administration guide on how
+to run a web service. Please refer to the documentation of
+[Apache](http://httpd.apache.org/docs/current/) and
+[Nginx](https://nginx.org/en/docs/)
+for background information on configuring the services.
+
+!!! Note
+    Throughout this page, we assume that your Nominatim build directory is
+    located in `/srv/nominatim/build` and the source code in
+    `/srv/nominatim/Nominatim`. If you have put it somewhere else, you
+    need to adjust the commands and configuration accordingly.
+
+    We further assume that your web server runs as user `www-data`. Older
+    versions of CentOS may still use the user name `apache`. You also need
+    to adapt the instructions in this case.
+
+## Making the website directory accessible
+
+You need to make sure that the `website` directory is accessible for the
+web server user. You can check that the permissions are correct by accessing
+on of the php files as the web server user:
+
+``` sh
+sudo -u www-data head -n 1 /srv/nominatim/build/website/search.php
+```
+
+If this shows a permission error, then you need to adapt the permissions of
+each directory in the path so that it is executable for `www-data`.
+
+If you have SELinux enabled, further adjustments may be necessary to give the
+web server access. At a minimum the following SELinux labelling should be done
+for Nominatim:
+
+``` sh
+sudo semanage fcontext -a -t httpd_sys_content_t "/srv/nominatim/Nominatim/(website|lib|settings)(/.*)?"
+sudo semanage fcontext -a -t httpd_sys_content_t "/srv/nominatim/build/(website|settings)(/.*)?"
+sudo semanage fcontext -a -t lib_t "/srv/nominatim/build/module/nominatim.so"
+sudo restorecon -R -v /srv/nominatim/Nominatim
+sudo restorecon -R -v /srv/nominatim/build
+```
+
+## Nominatim with Apache
+
+### Installing the required packages
+
+With Apache you can use the PHP module to run Nominatim.
+
+Under Ubuntu/Debian install them with:
+
+``` sh
+sudo apt install apache2 libapache2-mod-php
+```
+
+### Configuring Apache
+
+Make sure your Apache configuration contains the required permissions for the
+directory and create an alias:
+
+``` apache
+<Directory "/srv/nominatim/build/website">
+  Options FollowSymLinks MultiViews
+  AddType text/html   .php
+  DirectoryIndex search.php
+  Require all granted
+</Directory>
+Alias /nominatim /srv/nominatim/build/website
+```
+
+After making changes in the apache config you need to restart apache.
+The website should now be available on `http://localhost/nominatim`.
+
+## Nominatim with Nginx
+
+### Installing the required packages
+
+Nginx has no built-in PHP interpreter. You need to use php-fpm as a deamon for
+serving PHP cgi.
+
+On Ubuntu/Debian install nginx and php-fpm with:
+
+``` sh
+sudo apt install nginx php-fpm
+```
+
+### Configure php-fpm and Nginx
+
+By default php-fpm listens on a network socket. If you want it to listen to a
+Unix socket instead, change the pool configuration
+(`/etc/php/<php version>/fpm/pool.d/www.conf`) as follows:
+
+``` ini
+; Replace the tcp listener and add the unix socket
+listen = /var/run/php-fpm.sock
+
+; Ensure that the daemon runs as the correct user
+listen.owner = www-data
+listen.group = www-data
+listen.mode = 0666
+```
+
+Tell nginx that php files are special and to fastcgi_pass to the php-fpm
+unix socket by adding the location definition to the default configuration.
+
+``` nginx
+root /srv/nominatim/build/website;
+index search.php;
+location / {
+    try_files $uri $uri/ @php;
+}
+
+location @php {
+    fastcgi_param SCRIPT_FILENAME "$document_root$uri.php";
+    fastcgi_param PATH_TRANSLATED "$document_root$uri.php";
+    fastcgi_param QUERY_STRING    $args;
+    fastcgi_pass unix:/var/run/php-fpm.sock;
+    fastcgi_index index.php;
+    include fastcgi_params;
+}
+
+location ~ [^/]\.php(/|$) {
+    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+    if (!-f $document_root$fastcgi_script_name) {
+        return 404;
+    }
+    fastcgi_pass unix:/var/run/php-fpm.sock;
+    fastcgi_index search.php;
+    include fastcgi.conf;
+}
+```
+
+Restart the nginx and php-fpm services and the website should now be available
+at `http://localhost/`.
+
index ded6929322bcd6afb663075df46976ce69354ce8..334c1b758e07326f336ff6d26c56a04c46540f35 100644 (file)
@@ -187,7 +187,7 @@ enough RAM for PostgreSQL and osm2pgsql as mentioned above. If the system starts
 swapping or you are getting out-of-memory errors, reduce the cache size or
 even consider using a flatnode file.
 
-### Verify import finished
+### Verify the import
 
 Run this script to verify all required tables and indices got created successfully.
 
@@ -197,9 +197,8 @@ Run this script to verify all required tables and indices got created successful
 
 ### Setting up the website
 
-Run the following command to set up the `website/settings-frontend.php`.
-These settings are used in website/*.php files. You can use the website only after this 
-step is completed.
+Run the following command to set up the configuration file for the website
+`settings/settings-frontend.php`. These settings are used in website/*.php files.
 
 ```sh
 ./utils/setup.php --setup-website
@@ -207,6 +206,20 @@ step is completed.
 !!! Note
     This step is not necessary if you use `--all` option while setting up the DB.
 
+Now you can try out your installation by running:
+
+```sh
+make serve
+```
+
+This runs a small test server normally used for development. You can use it
+to verify that your installation is working. Go to
+`http://localhost:8088/status.php` and you should see the message `OK`.
+You can also run a search query, e.g. `http://localhost:8088/search.php?q=Berlin`.
+
+To run Nominatim via webservers like Apache or nginx, please read the
+[Deployment chapter](Deployment.md).
+
 ## Tuning the database
 
 Accurate word frequency information for search terms helps PostgreSQL's query
@@ -247,8 +260,6 @@ entire US adds about 10GB to your database.
         wget https://nominatim.org/data/tiger2019-nominatim-preprocessed.tar.gz
         tar xf tiger2019-nominatim-preprocessed.tar.gz
 
-    `data-source/overview.md` explains how the data got preprocessed.
-
   2. Import the data into your Nominatim database:
 
         ./utils/setup.php --import-tiger-data
@@ -264,3 +275,6 @@ entire US adds about 10GB to your database.
 ```
 
 
+See the [developer's guide](../develop/data-sources.md#us-census-tiger) for more
+information on how the data got preprocessed.
+
index bc97212ee2d663dc4cd1dc0c5556eb3e432c30ba..b9705eb5da1aa8bf1e59ac0e8337c07a61692394 100644 (file)
@@ -43,17 +43,13 @@ For running Nominatim:
   * [PHP](https://php.net) (7.0 or later)
   * PHP-pgsql
   * PHP-intl (bundled with PHP)
-  * a webserver (apache or nginx are recommended)
 
 For running continuous updates:
 
   * [pyosmium](https://osmcode.org/pyosmium/) (with Python 3)
 
-For running tests:
-
-  * [behave](http://pythonhosted.org/behave/)
-  * [nose](https://nose.readthedocs.io)
-  * [phpunit](https://phpunit.de) >= 7.3
+For dependencies for running tests and building documentation, see
+the [Development section](../develop/Development-Environment.md).
 
 ### Hardware
 
@@ -68,9 +64,7 @@ will help considerably to speed up import and queries.
 Even on a well configured machine the import of a full planet takes
 at least 2 days. Without SSDs 7-8 days are more realistic.
 
-## Setup of the server
-
-### PostgreSQL tuning
+## Tuning the PostgreSQL database
 
 You might want to tune your PostgreSQL installation so that the later steps
 make best use of your hardware. You should tune the following parameters in
@@ -110,82 +104,44 @@ Don't forget to reenable them after the initial import or you risk database
 corruption.
 
 
-### Webserver setup
+## Downloading and building Nominatim
 
-The `website/` directory in the build directory contains the configured
-website. Include the directory into your webbrowser to serve php files
-from there.
+### Downloading the latest release
 
-#### Configure for use with Apache
+You can download the [latest release from nominatim.org](https://nominatim.org/downloads/).
+The release contains all necessary files. Just unpack it.
 
-Make sure your Apache configuration contains the required permissions for the
-directory and create an alias:
+### Downloading the latest development version
 
-``` apache
-<Directory "/srv/nominatim/build/website">
-  Options FollowSymLinks MultiViews
-  AddType text/html   .php
-  DirectoryIndex search.php
-  Require all granted
-</Directory>
-Alias /nominatim /srv/nominatim/build/website
+If you want to install latest development version from github, make sure to
+also check out the osm2pgsql subproject:
+
+```
+git clone --recursive git://github.com/openstreetmap/Nominatim.git
 ```
 
-`/srv/nominatim/build` should be replaced with the location of your
-build directory.
-
-After making changes in the apache config you need to restart apache.
-The website should now be available on http://localhost/nominatim.
-
-#### Configure for use with Nginx
-
-Use php-fpm as a deamon for serving PHP cgi. Install php-fpm together with nginx.
-
-By default php listens on a network socket. If you want it to listen to a
-Unix socket instead, change the pool configuration (`pool.d/www.conf`) as
-follows:
-
-    ; Comment out the tcp listener and add the unix socket
-    ;listen = 127.0.0.1:9000
-    listen = /var/run/php5-fpm.sock
-
-    ; Ensure that the daemon runs as the correct user
-    listen.owner = www-data
-    listen.group = www-data
-    listen.mode = 0666
-
-Tell nginx that php files are special and to fastcgi_pass to the php-fpm
-unix socket by adding the location definition to the default configuration.
-
-``` nginx
-root /srv/nominatim/build/website;
-index search.php;
-location / {
-    try_files $uri $uri/ @php;
-}
-
-location @php {
-    fastcgi_param SCRIPT_FILENAME "$document_root$uri.php";
-    fastcgi_param PATH_TRANSLATED "$document_root$uri.php";
-    fastcgi_param QUERY_STRING    $args;
-    fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
-    fastcgi_index index.php;
-    include fastcgi_params;
-}
-
-location ~ [^/]\.php(/|$) {
-    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
-    if (!-f $document_root$fastcgi_script_name) {
-        return 404;
-    }
-    fastcgi_pass unix:/var/run/php7.3-fpm.sock;
-    fastcgi_index search.php;
-    include fastcgi.conf;
-}
+The development version does not include the country grid. Download it separately:
+
+```
+wget -O Nominatim/data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
 ```
 
-Restart the nginx and php5-fpm services and the website should now be available
-at `http://localhost/`.
+### Building Nominatim
+
+The code must be built in a separate directory. Create the directory and
+change into it.
 
+```
+mkdir build
+cd build
+```
+
+Nominatim uses cmake and make for building. Assuming that you have created the
+build at the same level as the Nominatim source directory run:
+
+```
+cmake ../Nominatim
+make
+```
 
 Now continue with [importing the database](Import.md).
diff --git a/docs/develop/Development-Environment.md b/docs/develop/Development-Environment.md
new file mode 100644 (file)
index 0000000..2ebaaed
--- /dev/null
@@ -0,0 +1,170 @@
+# Setting up Nominatim for Development
+
+This chapter gives an overview how to set up Nominatim for developement
+and how to run tests.
+
+!!! Important
+    This guide assumes that you develop under the latest version of Ubuntu. You
+    can of course also use your favourite distribution. You just might have to
+    adapt the commands below slightly, in particular the commands for installing
+    additional software.
+
+## Installing Nominatim
+
+The first step is to install Nominatim itself. Please follow the installation
+instructions in the [Admin section](../admin/Installation.md). You don't need
+to set up a webserver for development, the webserver that is included with PHP
+is sufficient.
+
+If you want to run Nominatim in a VM via Vagrant, use the default `ubuntu` setup.
+Vagrant's libvirt provider runs out-of-the-box under Ubuntu. You also need to
+install an NFS daemon to enable directory sharing between host and guest. The
+following packages should get you started:
+
+    sudo apt install vagrant vagrant-libvirt libvirt-daemon nfs-kernel-server
+
+## Prerequisites for testing and documentation
+
+The Nominatim tests suite consists of behavioural tests (using behave) and
+unit tests (using PHPUnit). It has the following additional requirements:
+
+* [behave test framework](https://github.com/behave/behave) >= 1.2.5
+* [nose](https://nose.readthedocs.org)
+* [pytidylib](http://countergram.com/open-source/pytidylib)
+* [phpunit](https://phpunit.de) >= 7.3
+* [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
+
+The documentation is built with mkdocs:
+
+* [mkdocs](https://www.mkdocs.org/) >= 1.1.2
+
+### Installing prerequisites on Ubuntu/Debian
+
+Some of the Python packages require the newest version which is not yet
+available with the current distributions. Therefore it is recommended to
+install pip to get the newest versions.
+
+To install all necessary packages run:
+
+```sh
+sudo apt install php-cgi phpunit php-codesniffer \
+                 python3-pip python3-setuptools python3-dev
+
+pip3 install --user behave nose mkdocs
+```
+
+The `mkdocs` executable will be located in `.local/bin`. You may have to add
+this directory to your path, for example by running:
+
+```
+echo 'export PATH=~/.local/bin:$PATH' > ~/.profile
+```
+
+If your distribution does not have PHPUnit 7.3+, you can install it (as well
+as CodeSniffer) via composer:
+
+```
+sudo apt-get install composer
+composer global require "squizlabs/php_codesniffer=*"
+composer global require "phpunit/phpunit=8.*"
+```
+
+The binaries are found in `.config/composer/vendor/bin`. You need to add this
+to your PATH as well:
+
+```
+echo 'export PATH=~/.config/composer/vendor/bin:$PATH' > ~/.profile
+```
+
+
+## Executing Tests
+
+All tests are located in the `\test` directory.
+
+### Preparing the test database
+
+Some of the behavioural test expect a test database to be present. You need at
+least 2GB RAM and 10GB disk space to create the database.
+
+First create a separate directory for the test DB and Fetch the test planet
+data and the Tiger data for South Dakota:
+
+```
+mkdir testdb
+cd testdb
+wget https://www.nominatim.org/data/test/nominatim-api-testdata.pbf
+wget -O - https://nominatim.org/data/tiger2018-nominatim-preprocessed.tar.gz | tar xz --wildcards --no-anchored '46*'
+```
+
+Configure and build Nominatim in the usual way:
+
+```
+cmake $USERNAME/Nominatim
+make
+```
+
+Copy the test settings:
+
+```
+cp $USERNAME/Nominatim/test/testdb/local.php settings/
+```
+
+Inspect the file to check that all settings are correct for your local setup.
+
+Now you can import the test database:
+
+```
+dropdb --if-exists test_api_nominatim
+./utils/setup.php --all --osm-file nominatim-api-testdb.pbf 2>&1 | tee import.log
+./utils/specialphrases.php --wiki-import | psql -d test_api_nominatim 2>&1 | tee -a import.log
+./utils/setup.php --import-tiger-data 2>&1 | tee -a import.log
+```
+
+### Running the tests
+
+To run all tests just go to the test directory and run make:
+
+```sh
+cd test
+make
+```
+
+To skip tests that require the test database, run `make no-test-db` instead.
+
+For more information about the structure of the tests and how to change and
+extend the test suite, see the [Testing chapter](Testing.md).
+
+## Documentation Pages
+
+The [Nominatim documentation](https://nominatim.org/release-docs/develop/) is
+built using the [MkDocs](https://www.mkdocs.org/) static site generation
+framework. The master branch is automatically deployed every night on
+[https://nominatim.org/release-docs/develop/](https://nominatim.org/release-docs/develop/)
+
+To build the documentation, go to the build directory and run
+
+```
+make doc
+INFO - Cleaning site directory
+INFO - Building documentation to directory: /home/vagrant/build/site-html
+```
+
+This runs `mkdocs build` plus extra transformation of some files and adds
+symlinks (see `CMakeLists.txt` for the exact steps).
+
+Now you can start webserver for local testing
+
+```
+build> mkdocs serve
+[server:296] Serving on http://127.0.0.1:8000
+[handlers:62] Start watching changes
+```
+
+If you develop inside a Vagrant virtual machine, use a port that is forwarded
+to your host:
+
+```
+build> mkdocs serve --dev-addr 0.0.0.0:8088
+[server:296] Serving on http://0.0.0.0:8088
+[handlers:62] Start watching changes
+```
diff --git a/docs/develop/Documentation.md b/docs/develop/Documentation.md
deleted file mode 100644 (file)
index 0d3c3e0..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# Documentation Pages
-
-The [Nominatim documentation](https://nominatim.org/release-docs/develop/) is built using the [MkDocs](https://www.mkdocs.org/) static site generation framework. The master branch is automatically deployed every night on under [https://nominatim.org/release-docs/develop/](https://nominatim.org/release-docs/develop/)
-
-To preview local changes, first install MkDocs
-
-```
-pip3 install --user mkdocs
-```
-
-If `mkdocs` can't be found after the installation, the $PATH might have not
-been set correctly yet. Try opening a new terminal session.
-
-
-Then go to the build directory and run
-
-```
-make doc
-INFO - Cleaning site directory
-INFO - Building documentation to directory: /home/vagrant/build/site-html
-```
-
-This runs `mkdocs build` plus extra transformation of some files and adds
-symlinks (see `CMakeLists.txt` for the exact steps).
-
-Now you can start webserver for local testing
-
-```
-build> mkdocs serve
-[server:296] Serving on http://127.0.0.1:8000
-[handlers:62] Start watching changes
-```
-
-If you develop inside a Vagrant virtual machine:
-
- * add port forwarding to your Vagrantfile,
-   e.g. `config.vm.network "forwarded_port", guest: 8000, host: 8000`
- * use `mkdocs serve --dev-addr 0.0.0.0:8000` because the default localhost
-   IP does not get forwarded.
diff --git a/docs/develop/Setup.md b/docs/develop/Setup.md
deleted file mode 100644 (file)
index 8a73280..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# Setup Test Environment
-
-To test changes and contribute to Nominatim you should be able to run
-the test suite(s). For many usecases it's enough to create a Vagrant
-virtual machine (see `VAGRANT.md`), import one small country into the
-database.
-
-## Prerequisites
-
-Nominatim supports a range of PHP versions and PHPUnit versions also
-move fast. We try to test against the newest stable PHP release and
-PHPUnit version even though we expect many Nominatim users will install
-older version on their production servers.
-
- * Python 3 (https://www.python.org/)
- * behave test framework >= 1.2.5 (https://github.com/behave/behave)
- * nose (https://nose.readthedocs.org)
- * pytidylib (http://countergram.com/open-source/pytidylib)
- * psycopg2 (http://initd.org/psycopg/)
-
-#### Ubuntu 20
-
-    sudo apt-get install -y phpunit php-codesniffer php-cgi
-    pip3 install --user behave nose
-
-#### Ubuntu 18
-
-    pip3 install --user behave nose
-
-    sudo apt-get install -y composer php-cgi php-cli php-mbstring php-xml zip unzip
-
-    composer global require "squizlabs/php_codesniffer=*"
-    sudo ln -s ~/.config/composer/vendor/bin/phpcs /usr/bin/
-
-    composer global require "phpunit/phpunit=8.*"
-    sudo ln -s ~/.config/composer/vendor/bin/phpunit /usr/bin/
-
-
-#### CentOS 7 or 8
-
-    sudo dnf install -y php-dom php-mbstring
-    pip3 install --user behave nose
-
-    composer global require "squizlabs/php_codesniffer=*"
-    sudo ln -s ~/.config/composer/vendor/bin/phpcs /usr/bin/
-
-    composer global require "phpunit/phpunit=^7"
-    sudo ln -s ~/.config/composer/vendor/bin/phpunit /usr/bin/
-
-## Run tests, code linter, code coverage
-
-See `README.md` in `test` subdirectory.
similarity index 67%
rename from test/README.md
rename to docs/develop/Testing.md
index c2dee41a9ae73d13e8f298760c82793de4b1b1d1..03f9574f0f71e82bdeb2709b3f466fbb02a12bc0 100644 (file)
@@ -1,12 +1,10 @@
-This directory contains functional and unit tests for the Nominatim API.
+# Nominatim Test Suite
 
-Prerequisites
-=============
+This chapter describes the tests in the `/test` directory, how they are
+structured and how to extend them. For a quick introduction on how to run
+the tests, see the [Development setup chapter](Development-Environment.md).
 
-See `docs/develop/Setup.md`
-
-Overall structure
-=================
+## Overall structure
 
 There are two kind of tests in this test suite. There are functional tests
 which test the API interface using a BDD test framework and there are unit
@@ -27,8 +25,7 @@ This test directory is sturctured as follows:
   +-   testdb      Base data for generating API test database
 ```
 
-PHP Unit Tests
-==============
+## PHP Unit Tests (`test/php`)
 
 Unit tests can be found in the php/ directory and tests selected php functions.
 Very low coverage.
@@ -44,14 +41,19 @@ strip and set other parameters.
 It will use (and destroy) a local database 'nominatim_unit_tests'. You can set
 a different connection string with e.g. UNIT_TEST_DSN='pgsql:dbname=foo_unit_tests'.
 
-BDD Functional Tests
-====================
+## BDD Functional Tests (`test/bdd`)
 
 Functional tests are written as BDD instructions. For more information on
-the philosophy of BDD testing, see http://pythonhosted.org/behave/philosophy.html
+the philosophy of BDD testing, see the
+[Behave manual](http://pythonhosted.org/behave/philosophy.html).
+
+The following explanation assume that the reader is familiar with the BDD
+notations of features, scenarios and steps.
 
-Usage
------
+All possible steps can be found in the `steps` directory and should ideally
+be documented.
+
+### General Usage
 
 To run the functional tests, do
 
@@ -81,62 +83,29 @@ The tests can be configured with a set of environment variables (`behave -D key=
                     run, otherwise the result is undefined.
 
 Logging can be defined through command line parameters of behave itself. Check
-out `behave --help` for details. Also keep an eye out for the 'work-in-progress'
+out `behave --help` for details. Also have a look at the 'work-in-progress'
 feature of behave which comes in handy when writing new tests.
 
-Writing Tests
--------------
-
-The following explanation assume that the reader is familiar with the BDD
-notations of features, scenarios and steps.
-
-All possible steps can be found in the `steps` directory and should ideally
-be documented.
-
 ### API Tests (`test/bdd/api`)
 
 These tests are meant to test the different API endpoints and their parameters.
-They require a to import several datasets into a test database. You need at
-least 2GB RAM and 10GB discspace.
-
-
-1. Fetch the OSM planet extract (200MB). See end of document how it got created.
+They require a to import several datasets into a test database.
+See the [Development Setup chapter](Development-Environment.md#preparing-the-test-database)
+for instructions on how to set up this database.
 
-    ```
-    cd Nominatim/data
-    mkdir testdb
-    cd testdb
-    wget https://www.nominatim.org/data/test/nominatim-api-testdata.pbf
-    ```
-
-2. Fetch `46*` (South Dakota) Tiger data
-
-    ```
-    cd Nominatim/data/testdb
-    wget https://nominatim.org/data/tiger2018-nominatim-preprocessed.tar.gz
-    tar xvf tiger2018-nominatim-preprocessed.tar.gz --wildcards --no-anchored '46*'
-    rm tiger2018-nominatim-preprocessed.tar.gz
-    ```
-
-3. Adapt build/settings/local.php settings:
-
-       ```
-    @define('CONST_Database_DSN', 'pgsql:dbname=test_api_nominatim');
-    @define('CONST_Use_US_Tiger_Data', true);
-    @define('CONST_Tiger_Data_Path', CONST_ExtraDataPath.'/testdb');
-    @define('CONST_Wikipedia_Data_Path', CONST_BasePath.'/test/testdb');
-    ```
+The official test dataset was derived from the 180924 planet (note: such
+file no longer exists at https://planet.openstreetmap.org/planet/2018/).
+Newer planets are likely to work as well but you may see isolated test
+failures where the data has changed.
 
-4. Import
+The official test dataset can always be downloaded from
+[nominatim.org](https://www.nominatim.org/data/test/nominatim-api-testdata.pbf)
+To recreate the input data for the test database run:
 
-    ```
-       LOGFILE=/tmp/nominatim-testdb.$$.log
-    dropdb --if-exists test_api_nominatim
-    ./utils/setup.php --all --osm-file ../Nominatim/data/testdb/nominatim-api-testdb.pbf 2>&1 | tee $LOGFILE
-    ./utils/specialphrases.php --wiki-import > specialphrases.sql
-    psql -d test_api_nominatim -f specialphrases.sql 2>&1 | tee -a $LOGFILE
-    ./utils/setup.php --import-tiger-data 2>&1 | tee -a $LOGFILE
-    ```
+```
+wget https://ftp5.gwdg.de/pub/misc/openstreetmap/planet.openstreetmap.org/pbf/planet-180924.osm.pbf
+osmconvert planet-180924.osm.pbf -B=test/testdb/testdb.polys -o=testdb.pbf
+```
 
 #### Code Coverage
 
@@ -146,7 +115,7 @@ On Debian/Ubuntu run:
 
     apt-get install php-codecoverage php-xdebug
 
-The run the API tests as follows:
+Then run the API tests as follows:
 
     behave api -DPHPCOV=<coverage output dir>
 
@@ -155,7 +124,7 @@ the [phpcov](https://github.com/sebastianbergmann/phpcov) tool:
 
     phpcov merge --html=<report output dir> <coverage output dir>
 
-### Indexing Tests (`test/bdd/db`)
+### DB Creation Tests (`test/bdd/db`)
 
 These tests check the import and update of the Nominatim database. They do not
 test the correctness of osm2pgsql. Each test will write some data into the `place`
@@ -171,16 +140,3 @@ needs superuser rights for postgres.
 
 These tests check that data is imported correctly into the place table. They
 use the same template database as the Indexing tests, so the same remarks apply.
-
-
-
-How the test database extract was generated
--------------------------------------------
-The official test dataset was derived from the 180924 planet (note: such
-file no longer exists at https://planet.openstreetmap.org/planet/2018/).
-Newer planets are likely to work as well but you may see isolated test
-failures where the data has changed. To recreate the input data
-for the test database run:
-
-    wget https://ftp5.gwdg.de/pub/misc/openstreetmap/planet.openstreetmap.org/pbf/planet-180924.osm.pbf
-    osmconvert planet-180924.osm.pbf -B=test/testdb/testdb.polys -o=testdb.pbf
index 4b097c8cd5a2f5d17d63385222ba6df506980d15..b055e9f02946e16f981ca7012249d4c9cb8d0604 100644 (file)
@@ -16,19 +16,20 @@ pages:
         - 'FAQ': 'api/Faq.md'
     - 'Administration Guide':
         - 'Basic Installation': 'admin/Installation.md'
-        - 'Importing' : 'admin/Import.md'
-        - 'Updating' : 'admin/Update.md'
+        - 'Import' : 'admin/Import.md'
+        - 'Update' : 'admin/Update.md'
+        - 'Deploy' : 'admin/Deployment.md'
         - 'Nominatim UI'  : 'admin/Setup-Nominatim-UI.md'
         - 'Advanced Installations' : 'admin/Advanced-Installations.md'
         - 'Migration from older Versions' : 'admin/Migration.md'
         - 'Troubleshooting' : 'admin/Faq.md'
     - 'Developers Guide':
-        - 'Overview' : 'develop/overview.md'
+        - 'Setup for Development' : 'develop/Development-Environment.md'
+        - 'Architecture Overview' : 'develop/overview.md'
         - 'OSM Data Import' : 'develop/Import.md'
         - 'Place Ranking' : 'develop/Ranking.md'
         - 'Postcodes' : 'develop/Postcodes.md'
-        - 'Setup Test Environment' : 'develop/Setup.md'
-        - 'Building Documentation' : 'develop/Documentation.md'
+        - 'Testing' : 'develop/Testing.md'
         - 'External Data Sources': 'develop/data-sources.md'
     - 'Appendix':
         - 'Installation on CentOS 7' : 'appendix/Install-on-Centos-7.md'
index 4077d211bc94a211420838ac892cc7bcc4b6e21a..f2c1ab84c56f270b59264c05180bb882c1415ae5 100644 (file)
@@ -18,6 +18,8 @@ function getLabelTag($aPlace, $sCountry = null)
         $sLabel = $aPlace['place_type'];
     } elseif ($aPlace['class'] == 'boundary' && $aPlace['type'] == 'administrative') {
         $sLabel = getBoundaryLabel($iRank/2, $sCountry);
+    } elseif ($aPlace['type'] == 'postal_code') {
+        $sLabel = 'postcode';
     } elseif ($iRank < 26) {
         $sLabel = $aPlace['type'];
     } elseif ($iRank < 28) {
index 0bd23e31cfe57ffb1376b8025574efd738f22a1e..082d1bf58dedb7665eb9c62953fafa607a6cfa07 100644 (file)
@@ -2,8 +2,3 @@
 
 require_once(CONST_BasePath.'/lib/lib.php');
 require_once(CONST_BasePath.'/lib/DB.php');
-
-if (get_magic_quotes_gpc()) {
-    echo "Please disable magic quotes in your php.ini configuration\n";
-    exit;
-}
index 7a7a1e6f757f7591b6dfdd813a13ffd29f8c5429..02b11237f34c4b3d9353a18e07b74c8f88533ce8 100644 (file)
@@ -85,7 +85,7 @@ if (file_exists(CONST_InstallPath.'/settings/local.php')) require_once(CONST_Ins
 // Website settings
 @define('CONST_NoAccessControl', true);
 
-@define('CONST_Website_BaseURL', 'http://'.php_uname('n').'/');
+@define('CONST_Website_BaseURL', '/');
 // Language to assume when none is supplied with the query.
 // When set to false, the local language (i.e. the name tag without suffix)
 // will be used.
index bff9fa6510a12b91e484f4be63e4d704edaac82c..16f2e929b311d11e15b78432c94cf0bb54295119 100644 (file)
@@ -44,7 +44,8 @@
 {
     "keys" : ["boundary"],
     "values" : {
-        "administrative" : "main"
+        "administrative" : "main",
+        "postal_code" : "main"
     }
 },
 {
index 184650f303c95e75479924b5a10a6a6dad9826e4..b90a07b164bb2f53a880ff6934ca91b1af3e9730 100644 (file)
     "keys" : ["boundary"],
     "values" : {
         "place" : "skip",
+        "postal_code" : "main",
         "" : "main,with_name"
     }
 },
index 0c49f23d4daa71185873a6f970180d1ded170640..c57c2c3a82ce6444398deb97c6bdf7d8ee14be8a 100644 (file)
     "keys" : ["boundary"],
     "values" : {
         "place" : "skip",
+        "postal_code" : "main",
         "" : "main,with_name"
     }
 },
index 88b3a741f3d5e85099263d3b954f072c00ede472..196fb434868f69aacf87bdd7b895f80e11c458db 100644 (file)
@@ -180,6 +180,7 @@ BEGIN
   -- Return the record for the base entry.
   FOR location IN
     SELECT placex.place_id, osm_type, osm_id, name,
+           coalesce(extratags->'linked_place', extratags->'place') as place_type,
            class, type, admin_level,
            type not in ('postcode', 'postal_code') as isaddress,
            CASE WHEN rank_address = 0 THEN 100
@@ -198,7 +199,8 @@ BEGIN
       searchcountrycode := NULL;
     END IF;
     countrylocation := ROW(location.place_id, location.osm_type, location.osm_id,
-                           location.name, location.class, location.type, NULL,
+                           location.name, location.class, location.type,
+                           location.place_type,
                            location.admin_level, true, location.isaddress,
                            location.rank_address, location.distance)::addressline;
     RETURN NEXT countrylocation;
index 1a8bbd84412d8fdb09d3f8291c6b13983afde61e..08087172c578f72186620b1b1fe859773bec2617 100644 (file)
@@ -81,7 +81,8 @@ BEGIN
   lookup_word := upper(trim(postcode));
   lookup_token := ' ' || make_standard_name(lookup_word);
   SELECT min(word_id) FROM word
-    WHERE word_token = lookup_token and class='place' and type='postcode'
+    WHERE word_token = lookup_token and word = lookup_word
+          and class='place' and type='postcode'
     INTO return_word_id;
   IF return_word_id IS NULL THEN
     return_word_id := nextval('seq_word');
index 3ddb97c04240225d87345360bbddf7e3ddbd52d7..a935b75a644c260abc1880112d495b8189dd6f8d 100644 (file)
@@ -581,6 +581,15 @@ BEGIN
     RETURN NEW;
   END IF;
 
+  -- Postcodes are just here to compute the centroids. They are not searchable
+  -- unless they are a boundary=postal_code.
+  -- There was an error in the style so that boundary=postal_code used to be
+  -- imported as place=postcode. That's why relations are allowed to pass here.
+  -- This can go away in a couple of versions.
+  IF NEW.class = 'place'  and NEW.type = 'postcode' and NEW.osm_type != 'R' THEN
+    RETURN NEW;
+  END IF;
+
   -- Speed up searches - just use the centroid of the feature
   -- cheaper but less acurate
   NEW.centroid := ST_PointOnSurface(NEW.geometry);
@@ -694,7 +703,7 @@ BEGIN
 
   -- ---------------------------------------------------------------------------
   -- For low level elements we inherit from our parent road
-  IF (NEW.rank_search > 27 OR (NEW.type = 'postcode' AND NEW.rank_search = 25)) THEN
+  IF NEW.rank_search > 27 THEN
 
     --DEBUG: RAISE WARNING 'finding street for % %', NEW.osm_type, NEW.osm_id;
     NEW.parent_place_id := null;
@@ -757,11 +766,6 @@ BEGIN
       -- Performance, it would be more acurate to do all the rest of the import
       -- process but it takes too long
       -- Just be happy with inheriting from parent road only
-      IF NEW.rank_search <= 25 and NEW.rank_address > 0 THEN
-        result := add_location(NEW.place_id, NEW.country_code, NEW.partition, name_vector, NEW.rank_search, NEW.rank_address, upper(trim(NEW.address->'postcode')), NEW.geometry);
-        --DEBUG: RAISE WARNING 'Place added to location table';
-      END IF;
-
       result := insertSearchName(NEW.partition, NEW.place_id, name_vector,
                                  NEW.rank_search, NEW.rank_address, NEW.geometry);
 
index 98e70a4235e07d2586b685ac4d27e73722ed6964..0c8f4c497e613ee394fa1bda41f1191f34122202 100644 (file)
@@ -145,10 +145,6 @@ BEGIN
   THEN
     SELECT * INTO search_rank, address_rank
       FROM get_postcode_rank(country, postcode);
-
-    IF NOT extended_type = 'A' THEN
-      address_rank := 0;
-    END IF;
   ELSEIF extended_type = 'N' AND place_class = 'highway' THEN
     search_rank = 30;
     address_rank = 0;
index 0355a170b4f257815e43e87b47199668ae9af303..b65e465d8fd108d29e12dba93d505ea6a439a6e5 100644 (file)
@@ -1,9 +1,14 @@
 all: bdd php
+no-test-db: bdd-no-test-db php
 
 bdd:
        cd bdd && behave -DREMOVE_TEMPLATE=1
 
+bdd-no-test-db:
+       cd bdd && behave -DREMOVE_TEMPLATE=1 db osm2pgsql
+
 php:
        cd php && phpunit ./
 
-.PHONY: bdd php
+
+.PHONY: bdd php no-test-db
index b521c1714f89a1afc8ef058f29fc851c71ef91b9..e5040f1e247b79ab8bb2808df568ce9dea8436b7 100644 (file)
@@ -182,3 +182,11 @@ Feature: Search queries
         Then results contain
           | class   | type |
           | highway | residential |
+
+
+    # github #1949
+    Scenario: Addressdetails always return the place type
+       When sending json search query "Rotherbaum" with address
+       Then result addresses contain
+         | ID | suburb |
+         | 0  | Rotherbaum |
index ec7eb1be68631cd0a45b5c0cbc3a386f05a42ae5..e94cd4cc2b26b15bf79e02e2d5b12fb2d490b8a7 100644 (file)
@@ -18,7 +18,7 @@ Feature: Structured search queries
           | 22547 |
         Then results contain
           | type |
-          | postcode |
+          | ^post(al_)?code |
         And result addresses contain
           | postcode |
           | 22547 |
index 2fdd281286909c7db801708e266c1c5f1dc5d833..0d4798e8ec95d7ba9e4ad41263280fb70a16be6d 100644 (file)
@@ -139,8 +139,8 @@ Feature: Address computation
             | R1  | boundary | administrative | 6     | 112           | :b0      |
             | R34 | boundary | administrative | 8     | 112 DE        | :b1:E    |
         And the places
-            | osm | class    | type      | addr+postcode | geometry |
-            | R4  | place    | postcode  | 112 DE 34     | :b2:N    |
+            | osm | class    | type        | addr+postcode | geometry |
+            | R4  | boundary | postal_code | 112 DE 34     | :b2:N    |
         And the named places
             | osm | class    | type           | geometry |
             | W93 | highway  | residential    | :w2N     |
index 2b7c8cd86cfc626058ffacde76c02ed3b238ab3a..1a62638dd339e6b028f524573e2b7a5f51131ccd 100644 (file)
@@ -69,10 +69,10 @@ Feature: Import into placex
          | N3   | place | postcode | Y45      | country:gb |
         When importing
         Then placex contains
-         | object | postcode | country_code | rank_search | rank_address |
-         | N1     | E45 2CD  | gb           | 25          | 0 |
-         | N2     | E45 2    | gb           | 23          | 0 |
-         | N3     | Y45      | gb           | 21          | 0 |
+         | object | addr+postcode | country_code | rank_search | rank_address |
+         | N1     | E45 2CD       | gb           | 25          | 5 |
+         | N2     | E45 2         | gb           | 23          | 5 |
+         | N3     | Y45           | gb           | 21          | 5 |
 
     Scenario: wrongly formatted GB postcodes are down-ranked
         Given the places
@@ -82,8 +82,8 @@ Feature: Import into placex
         When importing
         Then placex contains
          | object | country_code | rank_search | rank_address |
-         | N1     | gb           | 30          | 0 |
-         | N2     | gb           | 30          | 0 |
+         | N1     | gb           | 30          | 30 |
+         | N2     | gb           | 30          | 30 |
 
     Scenario: search and address rank for DE postcodes correctly assigned
         Given the places
@@ -95,10 +95,10 @@ Feature: Import into placex
         When importing
         Then placex contains
          | object | country_code | rank_search | rank_address |
-         | N1     | de           | 21          | 0 |
-         | N2     | de           | 30          | 0 |
-         | N3     | de           | 30          | 0 |
-         | N4     | de           | 30          | 0 |
+         | N1     | de           | 21          | 11 |
+         | N2     | de           | 30          | 30 |
+         | N3     | de           | 30          | 30 |
+         | N4     | de           | 30          | 30 |
 
     Scenario: search and address rank for other postcodes are correctly assigned
         Given the places
@@ -115,15 +115,15 @@ Feature: Import into placex
         When importing
         Then placex contains
          | object | country_code | rank_search | rank_address |
-         | N1     | ca           | 21          | 0 |
-         | N2     | ca           | 21          | 0 |
-         | N3     | ca           | 21          | 0 |
-         | N4     | ca           | 21          | 0 |
-         | N5     | ca           | 21          | 0 |
-         | N6     | ca           | 21          | 0 |
-         | N7     | ca           | 25          | 0 |
-         | N8     | ca           | 25          | 0 |
-         | N9     | ca           | 25          | 0 |
+         | N1     | ca           | 21          | 11 |
+         | N2     | ca           | 21          | 11 |
+         | N3     | ca           | 21          | 11 |
+         | N4     | ca           | 21          | 11 |
+         | N5     | ca           | 21          | 11 |
+         | N6     | ca           | 21          | 11 |
+         | N7     | ca           | 25          | 11 |
+         | N8     | ca           | 25          | 11 |
+         | N9     | ca           | 25          | 11 |
 
     Scenario: search and address ranks for boundaries are correctly assigned
         Given the named places
index 863a9b3abcb87fe525363fa2c9f56e964033e1a2..3d1dc489482fb90cc65b730175398804473aff05 100644 (file)
@@ -137,3 +137,22 @@ Feature: Import of postcodes
         And word contains
            | word  | class | type |
            | 01982 | place | postcode |
+
+    Scenario: Different postcodes with the same normalization can both be found
+        Given the places
+           | osm | class | type  | addr+postcode | addr+housenumber | geometry |
+           | N34 | place | house | EH4 7EA       | 111              | country:gb |
+           | N35 | place | house | E4 7EA        | 111              | country:gb |
+        When importing
+        Then location_postcode contains exactly
+           | country | postcode | geometry |
+           | gb      | EH4 7EA  | country:gb |
+           | gb      | E4 7EA   | country:gb |
+        When searching for "EH4 7EA"
+        Then results contain
+           | type     | placename |
+           | postcode | EH4 7EA      |
+        When searching for "E4 7EA"
+        Then results contain
+           | type     | placename |
+           | postcode | E4 7EA      |
similarity index 57%
rename from vagrant/install-on-travis-ci.sh
rename to vagrant/Install-on-Travis-CI.sh
index 3b8ed190460d63d781e4ef5cc3f7915dbbaac8fc..9c1fe367d3bba09c4e2f64b1ac1c35f1a6694eea 100755 (executable)
@@ -1,26 +1,30 @@
 #!/bin/bash
 
 # This script runs in a travis-ci.org virtual machine
-# https://docs.travis-ci.com/user/reference/xenial/
-# Ubuntu 16 (xenial)
+# https://docs.travis-ci.com/user/reference/focal/
+# Ubuntu 20 (focal)
 # user 'travis'
 # $TRAVIS_BUILD_DIR is /home/travis/build/openstreetmap/Nominatim/, for others see
 #   https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
-# Postgres 9.6 installed and started. role 'travis' already superuser
-# Python 3.6
+# Postgres 12 installed and started. role 'travis' already superuser
+# Python 3.8
 # Travis has a 4 MB, 10000 line output limit, so where possible we run script --quiet
 
 
 sudo apt-get update -qq
-sudo apt-get install -y -qq libboost-dev libboost-system-dev \
-                            libboost-filesystem-dev libexpat1-dev zlib1g-dev\
+
+sudo apt-get install -y -qq build-essential cmake g++ libboost-dev libboost-system-dev \
+                            libboost-filesystem-dev libexpat1-dev zlib1g-dev \
                             libbz2-dev libpq-dev libproj-dev \
-                            postgresql-server-dev-9.6 postgresql-9.6-postgis-2.4 postgresql-contrib-9.6 \
-                            apache2 php php-pgsql php-intl
+                            postgresql-server-dev-12 postgresql-12-postgis-3 \
+                            postgresql-contrib postgresql-12-postgis-3-scripts \
+                            php php-pgsql \
+                            php-intl python3-setuptools python3-dev python3-pip \
+                            python3-psycopg2 python3-tidylib git
 
-sudo apt-get install -y -qq python3-dev python3-pip php-cgi
+sudo apt-get install -y -qq php-cgi
 
-pip3 install --quiet behave nose pytidylib psycopg2-binary osmium
+pip3 install --quiet behave nose osmium
 
 # https://github.com/squizlabs/PHP_CodeSniffer
 composer global require "squizlabs/php_codesniffer=*"
@@ -35,22 +39,6 @@ sudo -u postgres createuser -S www-data
 chmod a+x $HOME
 chmod a+x $TRAVIS_BUILD_DIR
 
-
-sudo tee /etc/apache2/conf-available/nominatim.conf << EOFAPACHECONF > /dev/null
-    <Directory "$TRAVIS_BUILD_DIR/build/website">
-      Options FollowSymLinks MultiViews
-      AddType text/html   .php
-      DirectoryIndex search.php
-      Require all granted
-    </Directory>
-
-    Alias /nominatim $TRAVIS_BUILD_DIR/build/website
-EOFAPACHECONF
-
-
-sudo a2enconf nominatim
-sudo service apache2 restart
-
 wget -O $TRAVIS_BUILD_DIR/data/country_osm_grid.sql.gz https://www.nominatim.org/data/country_grid.sql.gz
 
 mkdir build
@@ -61,7 +49,6 @@ make
 
 tee settings/local.php << EOF
 <?php
- @define('CONST_Website_BaseURL', '/nominatim/');
  @define('CONST_Database_DSN', 'pgsql:dbname=test_api_nominatim');
  @define('CONST_Wikipedia_Data_Path', CONST_BasePath.'/test/testdb');
  @define('CONST_Replication_Max_Diff_size', '3');
diff --git a/vagrant/Install-on-Ubuntu-18-nginx.sh b/vagrant/Install-on-Ubuntu-18-nginx.sh
deleted file mode 100755 (executable)
index 382df6b..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/bin/bash
-
-#
-# This is variation of Install-on-Ubuntu.sh showcasing how to use the
-# nginx webserver instead of Apache2. We might eventually merge both
-# files. Right now expect this file to become outdated/unmaintained
-# over time.
-#
-# This file lacks many comments found in Install-on-Ubuntu.sh, you
-# should check that file first to get a basic understanding.
-#
-
-# hacks for broken vagrant box
-sudo rm -f /var/lib/dpkg/lock
-sudo update-locale LANG=en_US.UTF-8
-export APT_LISTCHANGES_FRONTEND=none
-export DEBIAN_FRONTEND=noninteractive
-
-    sudo apt-get update -qq
-    sudo apt-get install -y build-essential cmake g++ libboost-dev libboost-system-dev \
-                            libboost-filesystem-dev libexpat1-dev zlib1g-dev\
-                            libbz2-dev libpq-dev libproj-dev \
-                            postgresql-server-dev-10 postgresql-10-postgis-2.4 \
-                            postgresql-contrib-10 \
-                            nginx php-fpm php php-pgsql \
-                            php-intl python3-setuptools python3-dev python3-pip \
-                            python3-psycopg2 python3-tidylib git
-
-    export USERNAME=vagrant
-    export USERHOME=/home/vagrant
-
-    chmod a+x $USERHOME
-
-# Setting up PostgreSQL
-# ---------------------
-#
-# Tune the postgresql configuration, see same section in Install-on-Ubuntu.sh
-
-    sudo systemctl restart postgresql
-
-    sudo -u postgres createuser -s $USERNAME
-    sudo -u postgres createuser www-data
-
-#
-# Setting up the Nginx Webserver
-# -------------------------------
-#
-# You need to configure php-fpm to listen on a Unix socket. Then create Nginx
-# configuration to forward localhost:80 requests to that socket.
-#
-
-
-sudo tee /etc/php/7.2/fpm/pool.d/www.conf << EOF_PHP_FPM_CONF
-[www]
-; Comment out the tcp listener and add the unix socket
-;listen = 127.0.0.1:9000
-listen = /var/run/php7.2-fpm.sock
-
-; Ensure that the daemon runs as the correct user
-listen.owner = www-data
-listen.group = www-data
-listen.mode = 0666
-
-; Unix user of FPM processes
-user = www-data
-group = www-data
-
-; Choose process manager type (static, dynamic, ondemand)
-pm = ondemand
-pm.max_children = 5
-EOF_PHP_FPM_CONF
-
-
-
-
-sudo tee /etc/nginx/sites-available/default << EOF_NGINX_CONF
-server {
-    listen 80 default_server;
-    listen [::]:80 default_server;
-
-    root $USERHOME/build/website;
-    index search.php index.html;
-    location / {
-        try_files \$uri \$uri/ @php;
-    }
-
-    location @php {
-        fastcgi_param SCRIPT_FILENAME "\$document_root\$uri.php";
-        fastcgi_param PATH_TRANSLATED "\$document_root\$uri.php";
-        fastcgi_param QUERY_STRING    \$args;
-        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
-        fastcgi_index index.php;
-        include fastcgi_params;
-    }
-
-    location ~ [^/]\.php(/|$) {
-        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
-        if (!-f \$document_root\$fastcgi_script_name) {
-            return 404;
-        }
-        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
-        fastcgi_index search.php;
-        include fastcgi.conf;
-    }
-}
-EOF_NGINX_CONF
-
-
-sudo sed -i 's:#.*::' /etc/nginx/sites-available/default
-
-
-#
-# Enable the configuration and restart Nginx
-#
-
-    sudo systemctl stop apache2 # just in case it's installed as well
-    sudo systemctl restart php7.2-fpm nginx
-
-# From here continue in the 'Installing Nominatim' section in
-# Install-on-Ubuntu.sh
-
index 34e6aaa05de10b3b9fcb4dad0fb789eb452d9132..52f01715ef33d42dde5870cd356e5704af320882 100755 (executable)
@@ -18,20 +18,19 @@ export DEBIAN_FRONTEND=noninteractive #DOCS:
 # Make sure all packages are are up-to-date by running:
 #
 
-#DOCS:    :::sh
     sudo apt-get -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" --force-yes -fuy install grub-pc #DOCS:
-    sudo apt-get update -qq
+    sudo apt update -qq
 
 # Now you can install all packages needed for Nominatim:
 
-    sudo apt-get install -y build-essential cmake g++ libboost-dev libboost-system-dev \
-                            libboost-filesystem-dev libexpat1-dev zlib1g-dev\
-                            libbz2-dev libpq-dev libproj-dev \
-                            postgresql-server-dev-10 postgresql-10-postgis-2.4 \
-                            postgresql-contrib-10 postgresql-10-postgis-scripts \
-                            apache2 php php-pgsql libapache2-mod-php \
-                            php-intl python3-setuptools python3-dev python3-pip \
-                            python3-psycopg2 python3-tidylib git
+    sudo apt install -y php-cgi
+    sudo apt install -y build-essential cmake g++ libboost-dev libboost-system-dev \
+                        libboost-filesystem-dev libexpat1-dev zlib1g-dev\
+                        libbz2-dev libpq-dev libproj-dev \
+                        postgresql-server-dev-10 postgresql-10-postgis-2.4 \
+                        postgresql-contrib-10 postgresql-10-postgis-scripts \
+                        php php-pgsql php-intl \
+                        python3-psycopg2 git
 
 
 #
@@ -87,35 +86,6 @@ export DEBIAN_FRONTEND=noninteractive #DOCS:
     sudo -u postgres createuser -s $USERNAME
     sudo -u postgres createuser www-data
 
-#
-# Setting up the Apache Webserver
-# -------------------------------
-#
-# You need to create an alias to the website directory in your apache
-# configuration. Add a separate nominatim configuration to your webserver:
-
-#DOCS:```sh
-sudo tee /etc/apache2/conf-available/nominatim.conf << EOFAPACHECONF
-<Directory "$USERHOME/build/website"> #DOCS:<Directory "$USERHOME/Nominatim/build/website">
-  Options FollowSymLinks MultiViews
-  AddType text/html   .php
-  DirectoryIndex search.php
-  Require all granted
-</Directory>
-
-Alias /nominatim $USERHOME/build/website  #DOCS:Alias /nominatim $USERHOME/Nominatim/build/website
-EOFAPACHECONF
-#DOCS:```
-
-sudo sed -i 's:#.*::' /etc/apache2/conf-available/nominatim.conf #DOCS:
-
-#
-# Then enable the configuration and restart apache
-#
-
-    sudo a2enconf nominatim
-    sudo systemctl restart apache2
-
 #
 # Installing Nominatim
 # ====================
@@ -143,12 +113,53 @@ fi                                 #DOCS:
 # The code must be built in a separate directory. Create this directory,
 # then configure and build Nominatim in there:
 
-    cd $USERHOME                   #DOCS:    :::sh
+    cd $USERHOME
     mkdir build
     cd build
     cmake $USERHOME/Nominatim
     make
 
+
+# Nominatim is now ready to use. You can continue with
+# [importing a database from OSM data](../admin/Import.md). If you want to set up
+# a webserver first, continue reading.
+#
+# Setting up a webserver
+# ======================
+#
+# Option 1: Using Apache
+# ----------------------
+#
+if [ "x$2" == "xinstall-apache" ]; then #DOCS:
+#
+# Apache has a PHP module that can be used to serve Nominatim. To install them
+# run:
+
+    sudo apt install -y apache2 libapache2-mod-php
+
+# You need to create an alias to the website directory in your apache
+# configuration. Add a separate nominatim configuration to your webserver:
+
+#DOCS:```sh
+sudo tee /etc/apache2/conf-available/nominatim.conf << EOFAPACHECONF
+<Directory "$USERHOME/build/website">
+  Options FollowSymLinks MultiViews
+  AddType text/html   .php
+  DirectoryIndex search.php
+  Require all granted
+</Directory>
+
+Alias /nominatim $USERHOME/build/website
+EOFAPACHECONF
+#DOCS:```
+
+#
+# Then enable the configuration and restart apache
+#
+
+    sudo a2enconf nominatim
+    sudo systemctl restart apache2
+
 # You need to create a minimal configuration file that tells nominatim
 # where it is located on the webserver:
 
@@ -159,6 +170,88 @@ tee settings/local.php << EOF
 EOF
 #DOCS:```
 
+# The Nominatim API is now available at `http://localhost/nominatim/`.
+
+fi   #DOCS:
+
+#
+# Option 2: Using nginx
+# ---------------------
+#
+if [ "x$2" == "xinstall-nginx" ]; then #DOCS:
+
+# Nginx has no native support for php scripts. You need to set up php-fpm for
+# this purpose. First install nginx and php-fpm:
+
+    sudo apt install -y nginx php-fpm
+
+# You need to configure php-fpm to listen on a Unix socket.
+
+#DOCS:```sh
+sudo tee /etc/php/7.2/fpm/pool.d/www.conf << EOF_PHP_FPM_CONF
+[www]
+; Replace the tcp listener and add the unix socket
+listen = /var/run/php7.2-fpm.sock
+
+; Ensure that the daemon runs as the correct user
+listen.owner = www-data
+listen.group = www-data
+listen.mode = 0666
+
+; Unix user of FPM processes
+user = www-data
+group = www-data
+
+; Choose process manager type (static, dynamic, ondemand)
+pm = ondemand
+pm.max_children = 5
+EOF_PHP_FPM_CONF
+#DOCS:```
+
+# Then create a Nginx configuration to forward http requests to that socket.
+
+#DOCS:```sh
+sudo tee /etc/nginx/sites-available/default << EOF_NGINX_CONF
+server {
+    listen 80 default_server;
+    listen [::]:80 default_server;
+
+    root $USERHOME/build/website;
+    index search.php index.html;
+    location / {
+        try_files \$uri \$uri/ @php;
+    }
+
+    location @php {
+        fastcgi_param SCRIPT_FILENAME "\$document_root\$uri.php";
+        fastcgi_param PATH_TRANSLATED "\$document_root\$uri.php";
+        fastcgi_param QUERY_STRING    \$args;
+        fastcgi_pass unix:/var/run/php7.2-fpm.sock;
+        fastcgi_index index.php;
+        include fastcgi_params;
+    }
+
+    location ~ [^/]\.php(/|$) {
+        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+        if (!-f \$document_root\$fastcgi_script_name) {
+            return 404;
+        }
+        fastcgi_pass unix:/var/run/php7.2-fpm.sock;
+        fastcgi_index search.php;
+        include fastcgi.conf;
+    }
+}
+EOF_NGINX_CONF
+#DOCS:```
+
+#
+# Enable the configuration and restart Nginx
+#
+
+    sudo systemctl restart php7.2-fpm nginx
+
+# The Nominatim API is now available at `http://localhost/`.
+
+
 
-# Nominatim is now ready to use. Continue with
-# [importing a database from OSM data](../admin/Import.md).
+fi   #DOCS:
index a7029be2e88a8c11167c7590d60e7a5cf5bbe29b..b182ecfd167c381faae60c2c9954085a3537eeb4 100644 (file)
@@ -22,18 +22,18 @@ export DEBIAN_FRONTEND=noninteractive #DOCS:
         -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" \ #DOCS:
         --allow-downgrades --allow-remove-essential --allow-change-held-packages \ #DOCS:
         -fuy install grub-pc #DOCS:
-    sudo apt-get update -qq
+    sudo apt update -qq
 
 # Now you can install all packages needed for Nominatim:
 
-    sudo apt-get install -y build-essential cmake g++ libboost-dev libboost-system-dev \
-                            libboost-filesystem-dev libexpat1-dev zlib1g-dev \
-                            libbz2-dev libpq-dev libproj-dev \
-                            postgresql-server-dev-12 postgresql-12-postgis-3 \
-                            postgresql-contrib postgresql-12-postgis-3-scripts \
-                            apache2 php php-pgsql libapache2-mod-php \
-                            php-intl python3-setuptools python3-dev python3-pip \
-                            python3-psycopg2 python3-tidylib git
+    sudo apt install -y php-cgi
+    sudo apt install -y build-essential cmake g++ libboost-dev libboost-system-dev \
+                        libboost-filesystem-dev libexpat1-dev zlib1g-dev \
+                        libbz2-dev libpq-dev libproj-dev \
+                        postgresql-server-dev-12 postgresql-12-postgis-3 \
+                        postgresql-contrib postgresql-12-postgis-3-scripts \
+                        php php-pgsql php-intl \
+                        python3-psycopg2 git
 
 #
 # System Configuration
@@ -88,35 +88,6 @@ export DEBIAN_FRONTEND=noninteractive #DOCS:
     sudo -u postgres createuser -s $USERNAME
     sudo -u postgres createuser www-data
 
-#
-# Setting up the Apache Webserver
-# -------------------------------
-#
-# You need to create an alias to the website directory in your apache
-# configuration. Add a separate nominatim configuration to your webserver:
-
-#DOCS:```sh
-sudo tee /etc/apache2/conf-available/nominatim.conf << EOFAPACHECONF
-<Directory "$USERHOME/build/website"> #DOCS:<Directory "$USERHOME/Nominatim/build/website">
-  Options FollowSymLinks MultiViews
-  AddType text/html   .php
-  DirectoryIndex search.php
-  Require all granted
-</Directory>
-
-Alias /nominatim $USERHOME/build/website  #DOCS:Alias /nominatim $USERHOME/Nominatim/build/website
-EOFAPACHECONF
-#DOCS:```
-
-sudo sed -i 's:#.*::' /etc/apache2/conf-available/nominatim.conf #DOCS:
-
-#
-# Then enable the configuration and restart apache
-#
-
-    sudo a2enconf nominatim
-    sudo systemctl restart apache2
-
 #
 # Installing Nominatim
 # ====================
@@ -144,12 +115,52 @@ fi                                 #DOCS:
 # The code must be built in a separate directory. Create this directory,
 # then configure and build Nominatim in there:
 
-    cd $USERHOME                   #DOCS:    :::sh
+    cd $USERHOME
     mkdir build
     cd build
     cmake $USERHOME/Nominatim
     make
 
+# Nominatim is now ready to use. You can continue with
+# [importing a database from OSM data](../admin/Import.md). If you want to set up
+# a webserver first, continue reading.
+#
+# Setting up a webserver
+# ======================
+#
+# Option 1: Using Apache
+# ----------------------
+#
+if [ "x$2" == "xinstall-apache" ]; then #DOCS:
+#
+# Apache has a PHP module that can be used to serve Nominatim. To install them
+# run:
+
+    sudo apt install -y apache2 libapache2-mod-php
+
+# You need to create an alias to the website directory in your apache
+# configuration. Add a separate nominatim configuration to your webserver:
+
+#DOCS:```sh
+sudo tee /etc/apache2/conf-available/nominatim.conf << EOFAPACHECONF
+<Directory "$USERHOME/build/website">
+  Options FollowSymLinks MultiViews
+  AddType text/html   .php
+  DirectoryIndex search.php
+  Require all granted
+</Directory>
+
+Alias /nominatim $USERHOME/build/website
+EOFAPACHECONF
+#DOCS:```
+
+#
+# Then enable the configuration and restart apache
+#
+
+    sudo a2enconf nominatim
+    sudo systemctl restart apache2
+
 # You need to create a minimal configuration file that tells nominatim
 # where it is located on the webserver:
 
@@ -160,6 +171,88 @@ tee settings/local.php << EOF
 EOF
 #DOCS:```
 
+# The Nominatim API is now available at `http://localhost/nominatim/`.
+
+fi   #DOCS:
+
+#
+# Option 2: Using nginx
+# ---------------------
+#
+if [ "x$2" == "xinstall-nginx" ]; then #DOCS:
+
+# Nginx has no native support for php scripts. You need to set up php-fpm for
+# this purpose. First install nginx and php-fpm:
+
+    sudo apt install -y nginx php-fpm
+
+# You need to configure php-fpm to listen on a Unix socket.
+
+#DOCS:```sh
+sudo tee /etc/php/7.4/fpm/pool.d/www.conf << EOF_PHP_FPM_CONF
+[www]
+; Replace the tcp listener and add the unix socket
+listen = /var/run/php7.4-fpm.sock
+
+; Ensure that the daemon runs as the correct user
+listen.owner = www-data
+listen.group = www-data
+listen.mode = 0666
+
+; Unix user of FPM processes
+user = www-data
+group = www-data
+
+; Choose process manager type (static, dynamic, ondemand)
+pm = ondemand
+pm.max_children = 5
+EOF_PHP_FPM_CONF
+#DOCS:```
+
+# Then create a Nginx configuration to forward http requests to that socket.
+
+#DOCS:```sh
+sudo tee /etc/nginx/sites-available/default << EOF_NGINX_CONF
+server {
+    listen 80 default_server;
+    listen [::]:80 default_server;
+
+    root $USERHOME/build/website;
+    index search.php index.html;
+    location / {
+        try_files \$uri \$uri/ @php;
+    }
+
+    location @php {
+        fastcgi_param SCRIPT_FILENAME "\$document_root\$uri.php";
+        fastcgi_param PATH_TRANSLATED "\$document_root\$uri.php";
+        fastcgi_param QUERY_STRING    \$args;
+        fastcgi_pass unix:/var/run/php7.4-fpm.sock;
+        fastcgi_index index.php;
+        include fastcgi_params;
+    }
+
+    location ~ [^/]\.php(/|$) {
+        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+        if (!-f \$document_root\$fastcgi_script_name) {
+            return 404;
+        }
+        fastcgi_pass unix:/var/run/php7.4-fpm.sock;
+        fastcgi_index search.php;
+        include fastcgi.conf;
+    }
+}
+EOF_NGINX_CONF
+#DOCS:```
+
+#
+# Enable the configuration and restart Nginx
+#
+
+    sudo systemctl restart php7.4-fpm nginx
+
+# The Nominatim API is now available at `http://localhost/`.
+
+
 
-# Nominatim is now ready to use. Continue with
-# [importing a database from OSM data](../admin/Import.md).
+fi   #DOCS: