Différences entre les versions de « Overpass »

De Wiki de Geonov
Ligne 44 : Ligne 44 :
sudo a2enmod rewrite
sudo a2enmod rewrite
</syntaxhighlight>
</syntaxhighlight>
Fichier de configuration "/etc/apache2/sites-available/000-default.conf" :
<syntaxhighlight lang="conf" gutter="false" toolbar="false">
<VirtualHost *:80>
ServerName nom_de_domaine
ServerAdmin mail_de_contact
DocumentRoot /var/www/html
DirectoryIndex index.html interpreter
ExtFilterDefine gzip mode=output cmd=/bin/gzip
ScriptAlias /api /opt/osm-3s/osm-3s_v0.7.56.9/cgi-bin/
LogLevel error
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/opt/osm-3s/osm-3s_v0.7.56.9/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
</VirtualHost>
</syntaxhighlight>
Activation et redémarrage du service :
<syntaxhighlight lang="bash" gutter="false" toolbar="false">
sudo systemctl enable apache2
sudo systemctl restart apache2
</syntaxhighlight>
== Pare-feu ([[Nftables]]) ==
<syntaxhighlight lang="conf" gutter="false" toolbar="false">
inet filter input tcp dport {80,443} ct state new,established accept
inet filter output tcp sport {80,443} ct state established accept
</syntaxhighlight>


https://wiki.openstreetmap.org/wiki/Overpass_API/Installation
https://wiki.openstreetmap.org/wiki/Overpass_API/Installation

Version du 19 avril 2021 à 12:51

Overpass est une API permettant d'interroger des données OSM.

1 Installation d'un serveur Overpass (Debian)

1.1 Création d'un utilisateur système spécifique

sudo adduser overpass --system --shell /bin/bash --group

1.2 Création des répertoires nécessaires

sudo mkdir -p "/opt/osm-3s/database/"
sudo mkdir "/opt/osm-3s/replicate/"
sudo mkdir "/opt/osm-3s/logs/"
sudo chown overpass:overpass -R /opt/osm-3s

1.3 Téléchargement et compilation d'Overpass

sudo wget https://dev.overpass-api.de/releases/osm-3s_v0.7.56.9.tar.gz -P /usr/local/src/
sudo tar -xvf /usr/local/src/osm-3s_v0.7.56.9.tar.gz -C /usr/local/src/
sudo chown overpass:overpass -R /usr/local/src/osm-3s_v0.7.56.9
cd /usr/local/src/osm-3s_v0.7.56.9
sudo -u overpass ./configure CXXFLAGS="-O2" --prefix=/opt/osm-3s/osm-3s_v0.7.56.9
sudo apt-get install -y g++ make expat libexpat1-dev zlib1g-dev
sudo -u overpass make
sudo -u overpass make install

1.4 Installation d'Apache

sudo apt-get install -y apache2 libapache2-mod-auth-openidc python-certbot-apache
sudo a2enmod cgid
sudo a2enmod ext_filter
sudo a2enmod headers
sudo a2enmod setenvif
sudo a2enmod rewrite

Fichier de configuration "/etc/apache2/sites-available/000-default.conf" :

<VirtualHost *:80>
	ServerName nom_de_domaine
	ServerAdmin mail_de_contact
	DocumentRoot /var/www/html
	DirectoryIndex index.html interpreter
	ExtFilterDefine gzip mode=output cmd=/bin/gzip
	ScriptAlias /api /opt/osm-3s/osm-3s_v0.7.56.9/cgi-bin/
	LogLevel error
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
	<Directory "/opt/osm-3s/osm-3s_v0.7.56.9/cgi-bin/">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Require all granted
	</Directory>
</VirtualHost>

Activation et redémarrage du service :

sudo systemctl enable apache2
sudo systemctl restart apache2

1.5 Pare-feu (Nftables)

inet filter input tcp dport {80,443} ct state new,established accept
inet filter output tcp sport {80,443} ct state established accept


https://wiki.openstreetmap.org/wiki/Overpass_API/Installation