Benutzer-Werkzeuge

Webseiten-Werkzeuge


ubuntu:nginx_webserver

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
ubuntu:nginx_webserver [2019/04/13 18:08] – [Konfiguration] weitere Erklärungen Sebastian Hetzelubuntu:nginx_webserver [2023/10/22 09:58] (aktuell) – [Ubuntu 18.04 + 22.04: Nginx] und Sebastian Hetzel
Zeile 1: Zeile 1:
-====== Ubuntu 18.04: Nginx ======+====== Ubuntu 18.04 und 22.04: Nginx ======
  
 ===== Installation ===== ===== Installation =====
Zeile 188: Zeile 188:
 <file | /etc/php/7.2/fpm/php.ini> <file | /etc/php/7.2/fpm/php.ini>
 [...] [...]
-short_open_tag = Off+short_open_tag = On
 [...] [...]
 open_basedir = /var/www/:/tmp/:/dev/urandom open_basedir = /var/www/:/tmp/:/dev/urandom
Zeile 198: Zeile 198:
 <file | /etc/php/7.2/cli/php.ini> <file | /etc/php/7.2/cli/php.ini>
 [...] [...]
-short_open_tag = Off+short_open_tag = On
 [...] [...]
 open_basedir = /var/www/:/tmp/:/dev/urandom open_basedir = /var/www/:/tmp/:/dev/urandom
Zeile 204: Zeile 204:
 expose_php = Off expose_php = Off
 [...] [...]
 +</file>
 +
 +==== Tuning und Fehlerbehebung ====
 +
 +=== server reached pm.max_children setting, consider raising it ===
 +
 +Logfile (PHP-FPM):
 +<file>
 +[23-Apr-2019 19:37:52] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
 +[23-Apr-2019 21:08:16] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
 +[23-Apr-2019 21:10:12] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it
 +</file>
 +
 +<file | /etc/php/7.2/fpm/pool.d/www.conf>
 +; The number of child processes to be created when pm is set to 'static' and the
 +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
 +; This value sets the limit on the number of simultaneous requests that will be
 +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
 +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
 +; CGI. The below defaults are based on a server without much resources. Don't
 +; forget to tweak pm.* to fit your needs.
 +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
 +; Note: This value is mandatory.
 +pm.max_children = 8
 +</file>
 +
 +<code># service php7.2-fpm restart</code>
 +
 +===== Nginx: Handling =====
 +
 +==== Konfiguration prüfen vor Neustart des Dienstes ====
 +
 +<code>
 +# service nginx configtest
 + * Testing nginx configuration                 [fail]
 +</code>
 +
 +Was sagt das Errorlog?
 +> **/var/log/nginx/error.log**
 +
 +<file>
 +2019/12/07 17:06:07 [emerg] 14795#14795: "fastcgi_split_path_info" directive is not allowed here in /etc/nginx/snippets/fastcgi-php.conf:2
 +2019/12/07 17:07:07 [emerg] 14859#14859: "fastcgi_split_path_info" directive is not allowed here in /etc/nginx/snippets/fastcgi-php.conf:2
 +</file>
 +
 +===== Reverse-Proxy =====
 +
 +==== Virtual Host anlegen ====
 +
 +
 +<file | /etc/nginx/sites-available/your_domain>
 +server {
 +    listen 80;
 +    listen [::]:80;
 +
 +    server_name your_domain www.your_domain;
 +        
 +    location / {
 +        proxy_pass app_server_address;
 +        include proxy_params;
 +    }
 +}
 +</file>
 +
 +==== Proxyparameter festlegen ====
 +
 +<file | /etc/nginx/proxy_params>
 +proxy_set_header Host $http_host;
 +proxy_set_header X-Real-IP $remote_addr;
 +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 +proxy_set_header X-Forwarded-Proto $scheme;
 </file> </file>
ubuntu/nginx_webserver.1555171704.txt.gz · Zuletzt geändert: von Sebastian Hetzel

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki