HTTP/2 with ispconfig

Discussion in 'General' started by pecka33, Sep 8, 2021.

  1. pecka33

    pecka33 Member

    Hello,

    is here any settings for ISPConfig, where i should set HTTP/2 procotol for my sites? I am using Dediban 11 with latest ISPConfig and all works fine. But i am not sure what excatly i have to do. I found this tutorial, but i am not sure if can i use it for debian 11 https://www.howtoforge.com/how-to-enable-http-2-in-apache/

    I am using sites with PHP 5.6 and 7.4. for both i have set Fast-CGI for PHP.

    Thanks
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I thought that is already available and usable in ISPConfig and you don't have to do anything except to enable http2 in your web server software?
     
  3. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    The above is true, are you using NGINX or Apache2?

    By the way, Debian 11 is not supported by ISPConfig yet.
     
  4. pecka33

    pecka33 Member

    Thank you. I can not found any settings for HTTP/2 in ISPConfig. I am using apache2.

    I enabled modules

    Code:
    sudo a2enmod ssl
    sudo a2enmod http2
    
    restart apache, but still does not work form me support http/2.

    In vhost of my sitec i can see

    Code:
    <IfModule mod_http2.c>
                Protocols h2 http/1.1
            </IfModule>
    
    I know about ispconfig with debian 11, when i did upgrade to debian 11 i dont know that and is not possible to downgrade, but all works fine.
     
  5. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    I think the command would be
    Code:
    a2enmod http2
    a2enconf php7.4-fpm
    systemctl reload apache2
    a2dismod php7.4
    systemctl restart apache2
    a2dismod mpm_prefork
    a2enmod mpm_event
    systemctl restart apache2
     
  6. pecka33

    pecka33 Member

    Thanks. I tried to run your commands but my apache does not work. I get error

    Code:
    [email protected]:~# a2enmod http2
    a2enconf php7.4-fpm
    systemctl reload apache2
    a2dismod php7.4
    systemctl restart apache2
    a2dismod mpm_prefork
    a2enmod mpm_event
    systemctl restart apache2
    Module http2 already enabled
    Enabling conf php7.4-fpm.
    To activate the new configuration, you need to run:
      systemctl reload apache2
    ERROR: Module php7.4 does not exist!
    Module mpm_prefork disabled.
    To activate the new configuration, you need to run:
      systemctl restart apache2
    Considering conflict mpm_worker for mpm_event:
    Considering conflict mpm_prefork for mpm_event:
    Enabling module mpm_event.
    To activate the new configuration, you need to run:
      systemctl restart apache2
    Job for apache2.service failed because the control process exited with error code.
    See "systemctl status apache2.service" and "journalctl -xe" for details.
    [email protected]:~# systemctl restart apache2
    Job for apache2.service failed because the control process exited with error code.
    See "systemctl status apache2.service" and "journalctl -xe" for details.
    
    And my ispconfig stop working too. What can i do? please?
     
  7. pecka33

    pecka33 Member

    In systemctl i can see

    Code:
    ● apache2.service - The Apache HTTP Server
         Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Wed 2021-09-08 12:11:49 CEST; 1min 59s ago
           Docs: https://httpd.apache.org/docs/2.4/
        Process: 476875 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
            CPU: 142ms
    
    Sep 08 12:11:49 vm28069 systemd[1]: Starting The Apache HTTP Server...
    Sep 08 12:11:49 vm28069 apachectl[476878]: [Wed Sep 08 12:11:49.433160 2021] [:crit] [pid 476878:tid 140401625328960] Apache is running a threaded MPM, but your PHP Module is not compiled >
    Sep 08 12:11:49 vm28069 apachectl[476878]: AH00013: Pre-configuration failed
    Sep 08 12:11:49 vm28069 apachectl[476875]: Action 'start' failed.
    Sep 08 12:11:49 vm28069 apachectl[476875]: The Apache error log may have more information.
    Sep 08 12:11:49 vm28069 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
    Sep 08 12:11:49 vm28069 systemd[1]: apache2.service: Failed with result 'exit-code'.
    Sep 08 12:11:49 vm28069 systemd[1]: Failed to start The Apache HTTP Server.
    
     
  8. pecka33

    pecka33 Member

    Solved, i run this

    Code:
    sudo a2dismod mpm_event
    
    sudo a2enmod mpm_prefork
    
    
    and restart apache. Do you know that i get this error when i used commands you wrote me?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Which disables HTTP/2 as mpm_prefork does not support HTTP/2. I thought you wanted to enable it?
     
  10. pecka33

    pecka33 Member

    Thank you. Yes, i would like to use HTTP/2 for my domains with apache, but when i run commands from Th0m, apache was down. So i run commands i wrote up and works.
    At least i run just a2enmod http2, get message that http2 is enabled, but when i test if for my domains, is not enabled.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Regarding your error, you seem to have mod_php enabled, that's why it failed when you enabled mpm_event. Disable mod_php and then change the mpm module.
     
  12. pecka33

    pecka33 Member

    Thahnk you. So i have to disable mod_php with sudo a2dismod mod_php and enable a2enmod mpm_event? I am worry if after this change will be everything working fine.

    I am not sure, but http2 should works with mod_php too or only with mpm_event?

    Thank you!
     
  13. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Yes, mod_php should not be used anymore. http2 only works with mpm_event. When disabling mod_php, software like PHPMyAdmin will use PHP-FPM.
     
  14. pecka33

    pecka33 Member

    Thank you! So i should just run commands i wrote up and that should be all? HTTP2 i have enable. Thanks.
     
  15. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Yes.
     
  16. pecka33

    pecka33 Member

    Thank you. I tried to run sudo a2dismod mod_php, but i get error that Module mod_php does not exist!


    Any idea? If not, i have to check my server again.
     
  17. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Try
    Code:
    a2dismod php7.4
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess he is using an older mod_php version, as disabling mod_php 7.4 did caused this error above:

    ERROR: Module php7.4 does not exist!

    maybe he has still PHP 7.3 ?
     
  19. pecka33

    pecka33 Member

    Thank you. Yes, i have installed PHP 7.3 too, but for my sites i am using for one php 5.6 and for second php 7.4. I will try to find solution
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    It is perfectly fine that you have PHP 7.3 installed as additional PHP version, there are no changes needed. You just have to disable mod_php and to do that, you must know which mod_php version you have enabled. And my best guess is that it's 7.3 at the moment, so you disable it with:

    a2dismod php7.3
     

Share This Page