MPM-Event für Apache einrichten: Unterschied zwischen den Versionen

Aus Glaskugel
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „;1. Bearbeite die entsprechende Datei via SSH <code>mcedit /etc/httpd/conf.modules.d/00-mpm.conf</code> ;2. Kommentiere folgenden Eintrag durch Setzen einer…“)
 
Keine Bearbeitungszusammenfassung
 
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 86: Zeile 86:


<code>service httpd restart</code>
<code>service httpd restart</code>
Nützliches Trivia:
:[https://serverpilot.io/docs/fix-apache-error-server-reached-maxrequestworkers-setting/] How to Fix
:[https://httpd.apache.org/docs/2.4/de/mod/prefork.html] Wat is eigentlich MPM
Außerdem interessant in Zusammenhang mit Apache Problemen
:https://support.plesk.com/hc/en-us/articles/214529205-Apache-keeps-going-down-on-a-Plesk-server-server-reached-MaxRequestWorkers-setting
:https://support.plesk.com/hc/en-us/articles/213399589-Websites-on-Plesk-server-are-slow-or-PHP-mail-cannot-be-sent-mod-fcgid-ap-pass-brigade-failed
:https://support.plesk.com/hc/en-us/articles/213374769-Website-or-webmail-shows-500-internal-server-error-on-Plesk-mod-fcgid-read-data-timeout
:https://support.plesk.com/hc/en-us/articles/115004292154-How-to-change-proxy-read-timeout-for-domain-in-Plesk
:https://support.plesk.com/hc/en-us/articles/115000170354-An-operation-or-a-script-that-takes-more-than-60-seconds-to-complete-fails-on-a-website-hosted-in-Plesk-nginx-504-Gateway-Time-out
:https://support.plesk.com/hc/en-us/articles/213934985-Website-is-inaccessible-504-Gateway-Timeout

Aktuelle Version vom 17. Juni 2021, 15:10 Uhr

1. Bearbeite die entsprechende Datei via SSH

mcedit /etc/httpd/conf.modules.d/00-mpm.conf

2. Kommentiere folgenden Eintrag durch Setzen einer Raute "#" aus und deaktiviere somit den Modus prefork
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
3. Aktiviere durch Entfernen der Raute vor diesem Eintrag den Modus "worker"
LoadModule mpm_worker_module modules/mod_mpm_worker.so
4. Ergänze die Folgenden Blöcke im unteren Bereich
<IfModule mpm_worker_module>
        StartServers                    8
        MinSpareThreads                 50
        MaxSpareThreads                 100
        ThreadLimit                     64
        ThreadsPerChild                 64
        MaxRequestWorkers               384
        MaxConnectionsPerChild          10000
        ServerLimit                     6
        GracefulShutdownTimeout         5
</IfModule> 
<IfModule mod_deflate.c>
        <IfModule mod_filter.c>
                # these are known to be safe with MSIE 6
                AddOutputFilterByType DEFLATE text/html text/plain text/xml

                # everything else may cause problems with MSIE 6
                AddOutputFilterByType DEFLATE text/css
                AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
                AddOutputFilterByType DEFLATE application/rss+xml
                AddOutputFilterByType DEFLATE application/xml
        </IfModule>
</IfModule> 

Hinterher sieht die Datei dann so aus

# Select the MPM module which should be used by uncommenting exactly
# one of the following LoadModule lines:

# prefork MPM: Implements a non-threaded, pre-forking web server
# See: http://httpd.apache.org/docs/2.4/mod/prefork.html
# LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

# worker MPM: Multi-Processing Module implementing a hybrid
# multi-threaded multi-process web server
# See: http://httpd.apache.org/docs/2.4/mod/worker.html
# 
LoadModule mpm_worker_module modules/mod_mpm_worker.so

# event MPM: A variant of the worker MPM with the goal of consuming
# threads only for connections with active processing
# See: http://httpd.apache.org/docs/2.4/mod/event.html
#
# LoadModule mpm_event_module modules/mod_mpm_event.so
<IfModule mpm_worker_module>
        StartServers                    8
        MinSpareThreads                 50
        MaxSpareThreads                 100
        ThreadLimit                     64
        ThreadsPerChild                 64
        MaxRequestWorkers               384
        MaxConnectionsPerChild          10000
        ServerLimit                     6
        GracefulShutdownTimeout         5
</IfModule>

<IfModule mod_deflate.c>
        <IfModule mod_filter.c>
                # these are known to be safe with MSIE 6
                AddOutputFilterByType DEFLATE text/html text/plain text/xml

                # everything else may cause problems with MSIE 6
                AddOutputFilterByType DEFLATE text/css
                AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
                AddOutputFilterByType DEFLATE application/rss+xml
                AddOutputFilterByType DEFLATE application/xml
        </IfModule>
</IfModule>
5. Starte den Apache neu

service httpd restart

Nützliches Trivia:

[1] How to Fix
[2] Wat is eigentlich MPM

Außerdem interessant in Zusammenhang mit Apache Problemen

https://support.plesk.com/hc/en-us/articles/214529205-Apache-keeps-going-down-on-a-Plesk-server-server-reached-MaxRequestWorkers-setting
https://support.plesk.com/hc/en-us/articles/213399589-Websites-on-Plesk-server-are-slow-or-PHP-mail-cannot-be-sent-mod-fcgid-ap-pass-brigade-failed
https://support.plesk.com/hc/en-us/articles/213374769-Website-or-webmail-shows-500-internal-server-error-on-Plesk-mod-fcgid-read-data-timeout
https://support.plesk.com/hc/en-us/articles/115004292154-How-to-change-proxy-read-timeout-for-domain-in-Plesk
https://support.plesk.com/hc/en-us/articles/115000170354-An-operation-or-a-script-that-takes-more-than-60-seconds-to-complete-fails-on-a-website-hosted-in-Plesk-nginx-504-Gateway-Time-out
https://support.plesk.com/hc/en-us/articles/213934985-Website-is-inaccessible-504-Gateway-Timeout