Enable http2 on Debian 9 with Apache 2.4.25 & ISPConfig

Discussion in 'Installation/Configuration' started by Christoph80, Sep 5, 2019.

  1. Christoph80

    Christoph80 New Member

    Hi there!
    Since hours I try to enable the http2-module on my Debain-9-Server, running Apache 2.4.25 and ISPConfig 3.1.15.
    First of all: The module is successfully loaded, i checked it several times.
    Unfortunately there are a lot of tutorials in the web, each of them prefer another way to get http2 enabled - in my case: Nothing work :-(
    My first and simple try - Using the Web-Interface of ISPC: Websites -> mydomain.xy -> SSL -> Activate SPDY/HTTP2 (Apache Restart)
    Second try - Using Web-Interface again: System -> Severconfig -> Web -> SSL -> SPDY/HTTP2
    Third try: Editing the Vhosts for may websites manually:
    Code:
    <VirtualHost *:443>
    Protocols h2 http/1.1
    # ...
    # ...
    </VirtualHost>
    Last code I also tried in the global config-files, but nothing worked for me.

    Is there anybody who can help?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You have to switch Apache from mpm_prefork to an event module which supports http/2 like mpm_event. As long as mpm_prefork is used (which does not support http/2, ispconfig must reject to enable http/2). And be aware that mod_php will stop working. Then Login to ispconfig and enable http/2, that's all. And do not edit any config files manually as this will likely break your server.
     
  3. Christoph80

    Christoph80 New Member

    Thanks for replying...
    My new problem

    Code:
    a2dismod mpm_prefork
    a2enmod mpm_event
    systemctl restart apache2
    After these steps my Apache2 will not come up again. Message:
    and
    Code:
       Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Thu 2019-09-05 16:13:22 CEST; 15s ago
      Process: 5723 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
      Process: 5736 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
    Can't find useful information in apache2 error.log.

    Is there something else I have to do?
     
  4. Steini86

    Steini86 Active Member

    Have you disabled mod_php? (I think it should have been automatically)
    a2dismod mod_php
    a2enmod proxy_fcgi
    what is the output of "apache2ctl configtest"?
    what is the output of "systemctl status apache2.service"
    what is the output of "journalctl -xe" after trying to start apache2?
     
  5. Christoph80

    Christoph80 New Member

    systemctl status apache2.service
    Code:
    apache2.service - The Apache HTTP Server
       Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Thu 2019-09-05 17:46:33 CEST; 10s ago
      Process: 23128 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
      Process: 11047 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
      Process: 23136 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
    
    Sep 05 17:46:33 XXX systemd[1]: Starting The Apache HTTP Server...
    Sep 05 17:46:33 XXX apachectl[23136]: AH00534: apache2: Configuration error: No MPM loaded.
    Sep 05 17:46:33 XXX apachectl[23136]: Action 'start' failed.
    Sep 05 17:46:33 XXX apachectl[23136]: The Apache error log may have more information.
    Sep 05 17:46:33 XXX systemd[1]: apache2.service: Control process exited, code=exited status=
    Sep 05 17:46:33 XXX systemd[1]: Failed to start The Apache HTTP Server.
    Sep 05 17:46:33 XXX systemd[1]: apache2.service: Unit entered failed state.
    Sep 05 17:46:33 XXX systemd[1]: apache2.service: Failed with result 'exit-code'.
    apache2ctl configtest
    Code:
    AH00534: apache2: Configuration error: No MPM loaded.
    Action 'configtest' failed.
    The Apache error log may have more information.
    journalctl -xe
    Code:
    -- Unit apache2.service has finished shutting down.
    Sep 05 19:20:35 XXX systemd[1]: apache2.service: Unit entered failed state.
    Sep 05 19:20:35 XXX systemd[1]: apache2.service: Failed with result 'exit-code'.
    Sep 05 19:20:35 XXX systemd[1]: Starting The Apache HTTP Server...
    -- Subject: Unit apache2.service has begun start-up
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    --
    -- Unit apache2.service has begun starting up.
    Sep 05 19:20:35 XXX apachectl[5754]: AH00534: apache2: Configuration error: No MPM loaded.
    Sep 05 19:20:35 XXX apachectl[5754]: Action 'start' failed.
    Sep 05 19:20:35 XXX apachectl[5754]: The Apache error log may have more information.
    Sep 05 19:20:35 XXX systemd[1]: apache2.service: Control process exited, code=exited status=
    Sep 05 19:20:35 XXX systemd[1]: Failed to start The Apache HTTP Server.
    -- Subject: Unit apache2.service has failed
    -- Defined-By: systemd
    -- Support: https://www.debian.org/support
    --
    -- Unit apache2.service has failed.
    --
    -- The result is failed.
     
  6. Steini86

    Steini86 Active Member

    Are you sure "a2enmod mpm_event" worked?
    "Configuration error: No MPM loaded" looks like no MPM module is loaded ;-)
     
  7. Christoph80

    Christoph80 New Member

    Yes, that's the fact.
    If I do "a2enmod mpm_event" (of course) I get the message:
    So I do "a2dismod mpm_prefork" first. After that my Apache2 do not start again, even if i follow up with
    Code:
    a2enmod mpm_event
    // Apache Restart
     
  8. Steini86

    Steini86 Active Member

    I do not understand, what you did in which order. Do this and post the output:

    Code:
    a2dismod mod_php
    a2dismod mpm_prefork
    a2enmod mpm_event
    a2enmod proxy_fcgi
    apache2ctl configtest
    systemctl start apache2
     
  9. Christoph80

    Christoph80 New Member

    Funny... a2dismod mod_php get the following Output: ERROR: Module "mod_php" does not exist!
     
  10. Christoph80

    Christoph80 New Member

    OK... After doing all your steps (post #8) I get the message:
     
  11. Steini86

    Steini86 Active Member

    it is probably mod_php5 mod_php7.0 mod_php7.2, depending on your system. Use "a2dismod" to see your options. You can also use wildcards like mod_php*
     
  12. Christoph80

    Christoph80 New Member

    OK, here are my choices for "a2dismod":
    As you can see, there is only "php5", no "mod_php", no "mod_php5*7*XX" or anything else.
    After your steps from Post#8 the configtest outputs:
    Code:
    AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:73
    AH00526: Syntax error on line 183 of /etc/apache2/sites-enabled/100-MYDOMAIN.com.vhost:
    Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
    Action 'configtest' failed.
     
  13. Steini86

    Steini86 Active Member

    The setting in question only works with mod_php. Probably you should change the PHP Version of all your websites to from mod_php to "PHP-FPM" prior to removing mod_php ;-)
     
  14. Christoph80

    Christoph80 New Member

    OK, can I do the change from "mod_php" to "PHP_FPM" by using the Web-Interface from ISPCONFIG? Or is there more to do - manually?
     
  15. Steini86

    Steini86 Active Member

    If you have installed and set up php_fpm, this should be all you have to do. If not, you have to install php_fpm first and set it up correctly in ispconfig. Try changing one website first and see if everything works. If you have used a recent guide to install ispconfig, everything should be set up already.
     
  16. Christoph80

    Christoph80 New Member

    Thanks for your engagement :)
    But it's still not working. My steps.
    1. Changed my Website Configuration in ISPConfig-Webinterface from "mod_php" to "PHP-FPM"
    2. Checking phpinfo(); - seems to be ok, it shows: Server API FPM/FastCGI
    3. Activated "SPDY/HTTP2" in ISPConfig for my Website in SSL-Configurations.
    General Info: The Website works fine, but elements still served via HTTP1.1 (checked via Chrome-Developer-Console)
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    Please run this command and post the result:

    apachectl -M | grep http2_module
     
  18. Christoph80

    Christoph80 New Member

    apachectl -M | grep http2_module
    Code:
    AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:73
    AH00180: WARNING: MaxRequestWorkers of 300 exceeds ServerLimit value of 256 servers, decreasing MaxRequestWorkers to 256. To increase, please see the ServerLimit directive.
     http2_module (shared)
    EDIT: Maybe it's a problem with the message I posted on #10 in this timeline?
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    The Namevirtualhost message is ok, the other Warning should be fixed.
     
  20. Christoph80

    Christoph80 New Member

    OK, fixed the Warning. New Output:
    Code:
    AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:73
     http2_module (shared)
    
     

Share This Page