Ubuntu 20.04 HTTP/2 aktivieren  [GELÖST]

Diskussionen zur Bedienung von KeyHelp.
mfeicht
Posts: 53
Joined: Fri 8. Mar 2019, 09:24

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by mfeicht »

Ich habe auf einem der betroffenen Server eine Test-Seite angelegt, bei der man das Problem gut sehen kann: https://test.mcsr-home.de/

Hier die Apache Modul Liste:

Code: Select all

 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgid_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 expires_module (shared)
 fcgid_module (shared)
 filter_module (shared)
 headers_module (shared)
 http2_module (shared)
 include_module (shared)
 mime_module (shared)
 mpm_prefork_module (shared)
 negotiation_module (shared)
 php7_module (shared)
 proxy_module (shared)
 proxy_fcgi_module (shared)
 proxy_http_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 socache_shmcb_module (shared)
 ssl_module (shared)
 status_module (shared)
 suexec_module (shared)
KeyHelp läuft auf allen Server, bei denen das Problem auftritt, auf Version 21.2.

Zusätzlich zur KeyHelp Installation sind bei einigen Servern noch NodeJs, NPM und der Zabbix Agent installiert. Die betroffenen Server laufen alle bei Hetzner. Allgemein an Hetzner kann es aber aus meiner Sicht nicht liegen, da ich dort noch andere Server habe, die auch auf Ubuntu laufen, aber nur Nginx installiert haben. Darauf funktioniert HTTP/2 einwandfrei.
Auf einem anderen Server, der das gleiche Setup nutzt, aber bei AWS läuft, funktioniert HTTP/2 problemlos (ohne dass ich etwas gemacht habe).

Auf allen Server wurde KeyHelp frisch installiert und kein OS-Upgrade durchgeführt.

Wie von dir @pandinusimperator beschrieben könnte das das Problem sein. Hier der Auszug aus dem Log:

Code: Select all

[http2:warn] [pid 1799548] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by Alexander »

Dann einmal die folgenden Befehle testen. Wie gesagt mpm_prefork sollte eigentlich gar nicht laufen, stattdessen mpm_worker.

Code: Select all

a2dismod mpm_prefork  mpm_event ;
a2enmod mpm_worker ;
service apache2 restart ;
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
mfeicht
Posts: 53
Joined: Fri 8. Mar 2019, 09:24

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by mfeicht »

Beim ersten Befehl erscheint diese Meldung:

Code: Select all

ERROR: The following modules depend on mpm_prefork and need to be disabled first: php7.4
Module mpm_event already disabled
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by Alexander »

Ja das gehört da auch nicht hin. Und wird seitens KeyHelp auch während der Installation deaktiviert. Kannst du mal das /var/log/keyhelp/install.log anhängen. Nur den Teil, wo der Apache Installiert wird interessiert mich.

Code: Select all

a2dismod php7.4
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
mfeicht
Posts: 53
Joined: Fri 8. Mar 2019, 09:24

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by mfeicht »

Hier der Auszug aus dem Installations- log:

Code: Select all

================================================================================
  Apache web server
================================================================================

  exec  | apt-get install -y apache2 libapache2-mod-fcgid apache2-suexec-custom
          Reading package lists...
          Building dependency tree...
          Reading state information...
          The following additional packages will be installed:
            apache2-data apache2-utils
          Suggested packages:
            apache2-doc www-browser
          Recommended packages:
            ssl-cert
          The following NEW packages will be installed:
            apache2 apache2-data apache2-suexec-custom apache2-utils
            libapache2-mod-fcgid
          0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
          Need to get 418 kB of archives.
          After this operation, 2,205 kB of additional disk space will be used.
          Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2-data all 2.4.41-4ubuntu3.1 [158 kB]
          Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2-utils amd64 2.4.41-4ubuntu3.1 [83.8 kB]
          Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2 amd64 2.4.41-4ubuntu3.1 [95.5 kB]
          Get:4 http://archive.ubuntu.com/ubuntu focal/universe amd64 libapache2-mod-fcgid amd64 1:2.3.9-4 [64.9 kB]
          Get:5 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 apache2-suexec-custom amd64 2.4.41-4ubuntu3.1 [15.6 kB]
          Fetched 418 kB in 0s (2,174 kB/s)
          Selecting previously unselected package apache2-data.
          (Reading database ... ^M(Reading database ... 5%^M(Reading database ... 10%^M(Reading database ... 15%^M(Reading database ... 20%^M(Reading database ... 25%^M(Reading database ... 30%^M(Reading
 database ... 35%^M(Reading database ... 40%^M(Reading database ... 45%^M(Reading database ... 50%^M(Reading database ... 55%^M(Reading database ... 60%^M(Reading database ... 65%^M(Reading database ...
70%^M(Reading database ... 75%^M(Reading database ... 80%^M(Reading database ... 85%^M(Reading database ... 90%^M(Reading database ... 95%^M(Reading database ... 100%^M(Reading database ... 33824 files a
nd directories currently installed.)
          Preparing to unpack .../apache2-data_2.4.41-4ubuntu3.1_all.deb ...
          Unpacking apache2-data (2.4.41-4ubuntu3.1) ...
          Selecting previously unselected package apache2-utils.
          Preparing to unpack .../apache2-utils_2.4.41-4ubuntu3.1_amd64.deb ...
          Unpacking apache2-utils (2.4.41-4ubuntu3.1) ...
          Selecting previously unselected package apache2.
          Preparing to unpack .../apache2_2.4.41-4ubuntu3.1_amd64.deb ...
          Unpacking apache2 (2.4.41-4ubuntu3.1) ...
          Selecting previously unselected package libapache2-mod-fcgid.
          Preparing to unpack .../libapache2-mod-fcgid_1%3a2.3.9-4_amd64.deb ...
          Unpacking libapache2-mod-fcgid (1:2.3.9-4) ...
          Selecting previously unselected package apache2-suexec-custom.
          Preparing to unpack .../apache2-suexec-custom_2.4.41-4ubuntu3.1_amd64.deb ...
          Unpacking apache2-suexec-custom (2.4.41-4ubuntu3.1) ...
          Setting up libapache2-mod-fcgid (1:2.3.9-4) ...
          Package apache2 is not configured yet. Will defer actions by package libapache2-mod-fcgid.
          Setting up apache2-suexec-custom (2.4.41-4ubuntu3.1) ...
          update-alternatives: using /usr/lib/apache2/suexec-custom to provide /usr/lib/apache2/suexec (suexec) in auto mode
          Setting up apache2-data (2.4.41-4ubuntu3.1) ...
          Setting up apache2-utils (2.4.41-4ubuntu3.1) ...
          Setting up apache2 (2.4.41-4ubuntu3.1) ...
          Enabling module mpm_event.
          Enabling module authz_core.
          Enabling module authz_host.
          Enabling module authn_core.
          Enabling module auth_basic.
          Enabling module access_compat.
          Enabling module authn_file.
          Enabling module authz_user.
          Enabling module alias.
          Enabling module dir.
          Enabling module autoindex.
          Enabling module env.
          Enabling module mime.
          Enabling module negotiation.
          Enabling module setenvif.
          Enabling module filter.
          Enabling module deflate.
          Enabling module status.
          Enabling module reqtimeout.
          Enabling conf charset.
          Enabling conf localized-error-pages.
          Enabling conf other-vhosts-access-log.
          Enabling conf security.
          Enabling conf serve-cgi-bin.
          Enabling site 000-default.
          info: Executing deferred 'a2enmod fcgid' for package libapache2-mod-fcgid
          Enabling module fcgid.
          Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service.
          Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service.
          Processing triggers for systemd (245.4-4ubuntu3.3) ...
          Processing triggers for man-db (2.9.1-1) ...
          Processing triggers for ufw (0.36-6) ...
  exec  | grep -q -F "Include keyhelp/keyhelp.conf" /etc/apache2/apache2.conf || printf "\n#Include KeyHelp vHosts\nInclude keyhelp/keyhelp.conf\n" >> /etc/apache2/apache2.conf
  exec  | mkdir -p -m 0755 /etc/apache2/keyhelp/
  exec  | mkdir -p -m 0755 /etc/apache2/keyhelp/vhosts/
  exec  | mkdir -p -m 0755 /etc/apache2/keyhelp/htpasswd/
  exec  | touch /etc/apache2/keyhelp/subdomain_catch_all.conf

  files | apache/2.4-fcgid/keyhelp.conf => /etc/apache2/keyhelp/keyhelp.conf
  files | apache/2.4/webmail_redirect.conf => /etc/apache2/keyhelp/webmail.conf
  files | apache/2.4-fcgid/autoconfig.conf => /etc/apache2/keyhelp/autoconfig.conf
  files | apache/acme.conf => /etc/apache2/conf-available/acme.conf
  files | apache/ports.conf => /etc/apache2/ports.conf
  files | apache/security.conf => /etc/apache2/conf-available/security.conf
  files | apache/suexec_www-data => /etc/apache2/suexec/www-data
  files | apache/mod_http2.conf => /etc/apache2/mods-available/http2.conf
  files | apache/mod_ssl.conf.twig => /etc/apache2/mods-available/ssl.conf
  files | apache/mod_fastcgi.conf => /etc/apache2/mods-available/fastcgi.conf
  files | apache/mod_mime.conf => /etc/apache2/mods-available/mime.conf
  files | apache/other-vhosts-access-log.conf => /etc/apache2/conf-available/other-vhosts-access-log.conf
  files | apache/apache2.service => /lib/systemd/system/apache2.service

  exec  | mkdir -p -m 0755 /home/keyhelp/www/cgi-bin
  exec  | mkdir -p -m 0755 /home/keyhelp/www/roundcube
  exec  | mkdir -p -m 0755 /home/keyhelp/www/rainloop
  exec  | mkdir -p -m 0755 /home/keyhelp/www/phpmyadmin
  exec  | mkdir -p -m 0755 /home/keyhelp/www/adminer
  exec  | mkdir -p -m 0755 /home/keyhelp/www/kh.webstats
  exec  | mkdir -p -m 0750 /var/log/apache2/keyhelp
  exec  | rm -f /home/keyhelp/www/webmail
  exec  | ln -s roundcube /home/keyhelp/www/webmail
  exec  | rm -f /home/keyhelp/www/db-administration
  exec  | ln -s phpmyadmin /home/keyhelp/www/db-administration
  exec  | a2enmod actions fcgid alias auth_digest suexec deflate expires headers ssl rewrite include http2 cgid
          Enabling module actions.
          Module fcgid already enabled
          Module alias already enabled
          Considering dependency authn_core for auth_digest:
          Module authn_core already enabled
          Enabling module auth_digest.
          Enabling module suexec.
          Considering dependency filter for deflate:
          Module filter already enabled
          Module deflate already enabled
          Enabling module expires.
          Enabling module headers.
          Considering dependency setenvif for ssl:
          Module setenvif already enabled
          Considering dependency mime for ssl:
          Module mime already enabled
          Considering dependency socache_shmcb for ssl:
          Enabling module socache_shmcb.
          Enabling module ssl.
          See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create self-signed certificates.
          Enabling module rewrite.
          Considering dependency mime for include:
          Module mime already enabled
          Enabling module include.
          Enabling module http2.
          Enabling module cgid.
          To activate the new configuration, you need to run:
            systemctl restart apache2
  exec  | a2enmod proxy proxy_fcgi
          Enabling module proxy.
          Considering dependency proxy for proxy_fcgi:
          Module proxy already enabled
           Enabling module proxy_fcgi.
          To activate the new configuration, you need to run:
            systemctl restart apache2
  exec  | a2dissite 000-default
          Site 000-default disabled.
          To activate the new configuration, you need to run:
            systemctl reload apache2
  exec  | a2enconf acme
          Enabling conf acme.
          To activate the new configuration, you need to run:
            systemctl reload apache2
  exec  | a2enmod access_compat
          Considering dependency authn_core for access_compat:
          Module authn_core already enabled
          Module access_compat already enabled
  exec  | apt-get remove -y libapache2-mod-php5
          Reading package lists...
          Building dependency tree...
          Reading state information...
          Package 'libapache2-mod-php5' is not installed, so not removed
          0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  exec  | a2dismod php7.4
          Module php7.4 already disabled
  exec  | a2dismod mpm_prefork
          Module mpm_prefork already disabled
  exec  | a2dismod mpm_event
          Module mpm_event disabled.
          To activate the new configuration, you need to run:
            systemctl restart apache2
  exec  | a2enmod mpm_worker
          Considering conflict mpm_event for mpm_worker:
          Considering conflict mpm_prefork for mpm_worker:
          Enabling module mpm_worker.
          To activate the new configuration, you need to run:
            systemctl restart apache2
  exec  | systemctl daemon-reload
  exec  | service apache2 restart
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by Alexander »

Okay, da wurde auch alles korrekt deaktiviert, die erneute Aktivierung der problematischen Module "php7.4" und "mpm_prefork" muss also von anderer Stelle vorgenommen worden sein. KeyHelp rührt das nach der Installation nicht mehr an.

Funktioniert denn nun HTTP2?
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
mfeicht
Posts: 53
Joined: Fri 8. Mar 2019, 09:24

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by mfeicht »

Jetzt funktioniert HTTP/2. Folgendes habe ich gemacht:

Code: Select all

a2dismod php7.4
a2dismod mpm_prefork  mpm_event ;
a2enmod mpm_worker ;
service apache2 restart ;
Ich beobachte das mal, ob es evtl. nach einiger Zeit wieder nicht mehr funktioniert. Mir fällt aber nichts ein, was das Problem verursacht haben könnte, da ich die Sachen, die hier noch zusätzlich installiert sind, auch auf anderen Server installiert habe, wo es ohne Probleme läuft.

Danke für eure Hilfe!
pandinusimperator
Posts: 19
Joined: Tue 24. Aug 2021, 22:34

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by pandinusimperator »

Hauptsache es läuft.

Und es hat sicher nichts mit Keyhelp zu tun, denn nach der Installation lief http2 damals, irgendwann dann nicht mehr. Bei mir war es einer der schmalbrüstigeren Hetzner Cloud Server, der neben Keyhelp nichts anderes installiert hatte. Ich hatte damals ein Apache2-Update in Verdacht. Aber nachvollziehen konnte ich das nicht mehr. Zu spät bemerkt. :roll:
User avatar
MLan
Posts: 466
Joined: Wed 20. Sep 2017, 23:05
Location: @home

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by MLan »

pandinusimperator wrote: Thu 28. Oct 2021, 18:37 -----Bei mir war es einer der schmalbrüstigeren Hetzner Cloud Server, der neben Keyhelp nichts anderes installiert hatte. Ich hatte damals ein Apache2-Update in Verdacht. Aber nachvollziehen konnte ich das nicht mehr. Zu spät bemerkt. :roll:
Weil du das gerade so erwähnt hast, habe ich mal auf die schnelle ein paar Server von mir durchgeschaut.
Aufgefallen ist mir, dass bei den schmalbrüstigeren Cloud Servern, alle bis auf einen kein HTTP2 mehr hatten.
Bei den Bare-Metal-Servern sieht bis jetzt alles OK aus.
Also habe ich den letzen Cloud Server genommen und ein upgrade gemacht

Code: Select all

Setting up libapache2-mod-php7.3 (7.3.31-1~deb10u1) ...
Module mpm_worker disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
und damit war das http2 weg.

Nun ein

Code: Select all

a2dismod php7.3
a2dismod mpm_prefork  mpm_event ;
a2enmod mpm_worker ;
service apache2 restart ;
und alles läuft wieder.

Und nun werde ich mal die ganzen kisten durchgehen. :shock:

Gruß Mlan

PS:
Es war alles Debian 10
mfeicht
Posts: 53
Joined: Fri 8. Mar 2019, 09:24

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by mfeicht »

pandinusimperator wrote: Thu 28. Oct 2021, 18:37 Hauptsache es läuft.

Und es hat sicher nichts mit Keyhelp zu tun, denn nach der Installation lief http2 damals, irgendwann dann nicht mehr. Bei mir war es einer der schmalbrüstigeren Hetzner Cloud Server, der neben Keyhelp nichts anderes installiert hatte. Ich hatte damals ein Apache2-Update in Verdacht. Aber nachvollziehen konnte ich das nicht mehr. Zu spät bemerkt. :roll:
Das kann bei mir auch der Fall sein. Auf den Hetzner Cloud Servern habe ich nichts anderes gemacht, als auf denen bei AWS. Und bei AWS läuft es ohne Probleme :D
User avatar
24unix
Posts: 1560
Joined: Sun 21. Jun 2020, 17:16
Location: Kollmar
Contact:

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by 24unix »

Alexander wrote: Thu 28. Oct 2021, 11:02 Dann einmal die folgenden Befehle testen. Wie gesagt mpm_prefork sollte eigentlich gar nicht laufen, stattdessen mpm_worker.
Warum eigentlich worker?
Ich habe mal ein paar Benchmarks mit einer mittleren Seite gemacht, da war event deutlich performanter.
mfg Micha
--
If Bill Gates had a nickel for every time Windows crashed …
… oh wait, he does.
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by Alexander »

Btw. ab 22.1 kann der Admin dann wählen, welchen MPM er verwenden möchte (KeyHelp -> Konfiguration -> Web-Server).

Neuer Standard für Neu-Installationen ist dann mpm_event.
Existierende KeyHelp Instanzen bleiben auf mpm_worker (bereits vom Admin vorgenommene eigene Konfigurationen werden aber berücksichtigt/ausgelesen).
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Blackmoon
Posts: 345
Joined: Sat 1. Dec 2018, 16:42

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by Blackmoon »

TOP! Kann es kaum erwarten.
racmo
Posts: 26
Joined: Fri 22. Apr 2016, 17:16

Re: Ubuntu 20.04 HTTP/2 aktivieren

Post by racmo »

Kleiner Hinweis, bei mir ist es durch ein gestriges Update unter Debian 11.6 wieder dazu gekommen:

Code: Select all

Setting up libapache2-mod-php7.4 (7.4.33-1+deb11u3) ...
Module mpm_event disabled.
Enabling module mpm_prefork.
apache2_switch_mpm Switch to prefork
Wer also Debian einsetzt, vielleicht mal prüfen!
Post Reply