MPM-Event für Apache einrichten

Aus Glaskugel
Version vom 20. Januar 2021, 14:21 Uhr von Standard (Diskussion | Beiträge) (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…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen
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