diff --git a/de/installation/installation_ubuntu.rst b/de/installation/installation_ubuntu.rst index f1c5e82f..11688f92 100644 --- a/de/installation/installation_ubuntu.rst +++ b/de/installation/installation_ubuntu.rst @@ -16,12 +16,12 @@ Voraussetzungen * Apache Installation mit folgenden aktivierten Modulen: * mod_rewrite * libapache2-mod-php +* alternativ: nginx-Installation mit folgenden aktivierten Modulen: + * php-fpm * PostgreSQL Installation * Es wird empfohlen, eine PostgreSQL Datenbank für Mapbender zu verwenden. * Es wird empfohlen, einen eigenen Datenbankbenutzer für den Zugriff auf die Mapbender Datenbank anzulegen. -Als Webserver kann auch nginx verwendet werden. In dieser Anleitung wird darauf nicht weiter eingegangen. - Vorbereitung ------------ @@ -71,6 +71,50 @@ Aktivieren der Seite und Apache neu starten: a2ensite mapbender.conf service apache2 reload + +Konfiguration nginx +------------------- + +Alternativ zu Apache kann auch nginx verwendet werden. +Dafür muss eine eigene Konfiguration in ``/etc/nginx/sites-available`` angelegt werden: + +.. code-block:: nginx + + server { + listen 80; + listen [::]:80; + server_name mapbender.localhost # bitte anpassen + + # SSL-Konfiguration wird hier empfohlen sofern der Mapbender nicht lokal ausgeführt wird + + root /var/www/mapbender/application/public; + + index index.php; + + location / { + # Versuche zunächst als Datei auszuliefern, dann als Verzeichnis, + # alles andere wird an die index.php weitergeleitet + try_files $uri $uri/ /index.php$is_args$args; + } + + # PHP-Skripte an den FastCGI server weitergeben + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php8.3-fpm.sock; # bitte anpassen, wenn eine andere PHP-Version verwendet wird + } + + # Zugriff auf Apache-Konfiugurationsdateien verbieten + location ~ /\.ht { + deny all; + } + } + +Aktivieren der Seite und nginx neu starten: + +.. code-block:: bash + + ln -s /etc/nginx/sites-available/mapbender /etc/nginx/sites-enabled/ + systemctl restart nginx Verzeichnisrechte diff --git a/de/installation/installation_windows.rst b/de/installation/installation_windows.rst index 4f46a6ee..aa3d1d24 100644 --- a/de/installation/installation_windows.rst +++ b/de/installation/installation_windows.rst @@ -22,7 +22,8 @@ Voraussetzungen * Es wird empfohlen, einen eigenen Datenbankbenutzer für den Zugriff auf die Mapbender Datenbank anzulegen. -Als Webserver kann auch Nginx verwendet werden. In dieser Anleitung wird darauf nicht weiter eingegangen. +Als Webserver kann auch Nginx verwendet werden, der für Windows aber als Beta-Version betrachtet wird. Sollte es trotzdem + gewünscht sein, nginx auf Windows zu verwenden, kann die gleiche Konfiguration wie für die Linux-Installation verwendet werden. Konfiguration PHP diff --git a/en/installation/installation_ubuntu.rst b/en/installation/installation_ubuntu.rst index 73cebd1e..303d5fb0 100644 --- a/en/installation/installation_ubuntu.rst +++ b/en/installation/installation_ubuntu.rst @@ -16,12 +16,12 @@ Requirements * Apache installation with the following modules activated: * mod_rewrite * libapache2-mod-php +* alternatively: nginx installation with the following modules activated: + * php-fpm * PostgreSQL Installation * It is recommended to use a PostgreSQL database for Mapbender. * It is recommended to create a database user to access the Mapbender database. -Nginx can also be used as web server (this will not be discussed in detail here). - Preparation ----------- @@ -72,6 +72,51 @@ Activate the site and reload Apache: a2ensite mapbender.conf service apache2 reload +Configuration nginx +------------------- + +As an alternative to apache2, nginx can also be used as webserver. +To use Mapbender in nginx, create a configuration file within ``/etc/nginx/sites-available``: + +.. code-block:: nginx + + server { + listen 80; + listen [::]:80; + server_name mapbender.localhost # change this to your needs + + # recommended to setup ssl here when not in a local environment + + root /var/www/mapbender/application/public; + + index index.php; + + location / { + # First attempt to serve request as file, then + # as directory, then redirect to index.php + try_files $uri $uri/ /index.php$is_args$args; + } + + # pass PHP scripts to FastCGI server + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php8.3-fpm.sock; # change this when using another PHP version + } + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + location ~ /\.ht { + deny all; + } + } + +Activate the new site and restart nginx: + +.. code-block:: bash + + ln -s /etc/nginx/sites-available/mapbender /etc/nginx/sites-enabled/ + systemctl restart nginx + Directory rights ---------------- diff --git a/en/installation/installation_windows.rst b/en/installation/installation_windows.rst index 73a31e95..9dd9b88a 100644 --- a/en/installation/installation_windows.rst +++ b/en/installation/installation_windows.rst @@ -22,8 +22,8 @@ Requirements * It is recommended to create a database user to access the Mapbender database. -Nginx can also be used as web server, but it will not be discussed in this manual. - +As a web server, you can also use nginx, which is considered a beta version for Windows. If you still want to use it, + you can use the same configuration file as in the Linux installation guide. Configuration PHP -----------------