How to enable http2 in ispconfig3

Discussion in 'General' started by Oitsuki, Oct 27, 2017.

  1. Oitsuki

    Oitsuki Member

    I saw this tuto how to include http2 inside ispconfig.

    Coul you confirm me if it's correct. I don't want to make a an mistake.

    <code>
    nano /usr/local/ispconfig/server/conf/nginx_vhost.conf.master

    Replace :

    listen <tmpl_var name=’ip_address’>:443 ssl;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    <tmpl_if name=’ipv6_enabled’>
    listen [<tmpl_var name=’ipv6_address’>]:443 ssl;
    </tmpl_if>
    ssl_certificate <tmpl_var name=’document_root’>/ssl/<tmpl_var name=’ssl_domain’>.crt;
    ssl_certificate_key <tmpl_var name=’document_root’>/ssl/<tmpl_var name=’ssl_domain’>.key;
    </tmpl_if>

    by :

    <tmpl_if name=’ssl_enabled’>
    listen <tmpl_var name=’ip_address’>:443 ssl http2;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    <tmpl_if name=’ipv6_enabled’>
    listen [<tmpl_var name=’ipv6_address’>]:443 ssl http2;
    </tmpl_if>
    ssl_certificate /etc/letsencrypt/live/<tmpl_var name=’domain’>/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/<tmpl_var name=’domain’>/privkey.pem;
    </tmpl_if>
    </code>
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    copy the file /usr/local/ispconfig/server/conf/nginx_vhost.conf.master to /usr/local/ispconfig/server/conf-custom/nginx_vhost.conf.master

    and then edit the /usr/local/ispconfig/server/conf-custom/nginx_vhost.conf.master file in that way.
     
  3. Oitsuki

    Oitsuki Member

    Do the have something else to make to activate the protocol ?
    Note I am under apache2
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The above config is for nginx web servers, not apache.
     
  5. gral

    gral Member

    Hello, the files into conf-custom dir override the default config ?
     
  6. HSorgYves

    HSorgYves Active Member HowtoForge Supporter

  7. Oitsuki

    Oitsuki Member

    In this case wahtis the process to enable http2 ? Do you write a tuto?
     
  8. HSorgYves

    HSorgYves Active Member HowtoForge Supporter

    Enable mod_http2, I think that's it, but I never tried.
     
  9. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    This http2 feature will be properly added in 3.2. In 3.1, I still manually edit the vhost to use it since I am using nginx. For apache, as stated above, you might need to enable its module first but I am not sure since I am not using apache anymore.
     
  10. Oitsuki

    Oitsuki Member

    Ok, I find a solution but what is the best

    /etc/apache2/sites-available
    to test
    <code>sudo a2enmod http2</code>
    and restart apache2

    Number 1 : Install all the website
    /etc/apache2/sites-available
    <code>vi mydomain.com</code>
    under ServerAdmin add
    <code>Protocols h2 http/1.1</code>
    restart apache2
    make the same thing for all website

    Number 2 : Install all the website
    <code>vi 000-default.conf</code>
    below DocumentRoot
    add <code>Protocols h2 http/1.1<code>
    For futur website I think ?
     
    Last edited: Oct 29, 2017
  11. Kwun Yeung

    Kwun Yeung New Member

    I have to add the apache directive to the site options directly to enable http2.

    Sites -> Your domain -> Options

    Under "Apache Directives", put

    Protocols h2 h2c http/1.1

    Save it and it works.
     
    ahrasis, biforme and till like this.
  12. brody182

    brody182 Member

    Enable SPDY/HTTP2 Option does not work... and it ONLY displays on admin login

    http2.png
     
    Last edited: Jul 19, 2018
  13. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

  14. brody182

    brody182 Member

    Adding this to apache2.conf does not work

    Code:
    Protocols h2 h2c http/1.1
    ProtocolsHonorOrder On
    
    does it have something to do with
    Debian 9: 9.5 released
     
    Last edited: Jul 19, 2018
  15. brody182

    brody182 Member

    need to disable
    mpm_prefork

    but only enable with
    mpm_worker and mpm_event

    what is the proper way to do this in ispconfig?
     
  16. GrafPorno

    GrafPorno New Member

    ahrasis likes this.
  17. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    on debian 9 you do
    Code:
    a2dismod mpm_prefork
    a2enmod mpm_worker
    a2enmod http2
    
    I'm not sure if they have fixed the mpm_event in debian 9.5 but I wouldn't bet / risk that.
    And mabye you add this to /etc/apache2/mods-available/http2.conf ( since there is none ) or into conf-available - dir and enable said files.
     
  18. brody182

    brody182 Member

    mpm_event is the way to go!
     
  19. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    it is, for some... but it has a nasty bug since 2012 or 2014 at least which can drive you nuts!
    the last time I tested with at least debian 9.4 it was still in there, but not in 10, I doubt this has changed.

    keep in mind event and worker are not much different. event does have some tradeoffs worker doesn't have. it depends on your environment which to choose, and if u use keepalive.
     
    Last edited: Jul 20, 2018
  20. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    By now I already forgot almost all about apache2. But with regards to mpm_worker vs mpm_event, this link has some good explanation.
     

Share This Page