7

I would like to install mod_http2. I currently have Debian 8 with Apache 2.4.10.

I understand that it's probably not a good idea to try to manually install a later version of Apache. So, for this reason, I am considering upgrading to Debian 9. Will this allow me to use HTTP/2?

I've also read that full support for Debian 8 ends in May so I would like to upgrade for that reason also. Are there any downsides to upgrading?

Braiam
  • 35,991
sdexp
  • 207
  • 3
    Be aware PHP7 and MySQL 5.7 are significantly different from the previous versions. I would not advise migrating to Debian 9 without doing tests to your applications and define a migration plan. – Rui F Ribeiro Mar 12 '18 at 10:48
  • And you can't run mod_php (in particular, mod_prefork) with HTTP/2, so you'll have to use php-fpm. At that point you may as well just switch to nginx. – Michael Hampton Mar 12 '18 at 16:18
  • I've never used Nginx. Would the version of Nginx available on Debian 8 be able to use HTTP/2? (In this case, I'm just going to upgrade Debian but I'm interested to know.) – sdexp Mar 13 '18 at 02:17
  • To answer my own question, yes it does but I believe it has to be installed via Jessie Backports. – sdexp Mar 13 '18 at 02:23

1 Answers1

10

Will this allow me to use HTTP/2?

Yes, it will allow you to use it.

Are there any downsides to upgrading?

Not really, no.


First, you will need to enable the module:

sudo a2enmod http2

You can then simply add a line to this file:

/etc/apache2/apache2.conf

The line should look like:

# Enabling HTTP/2 (NPN)
Protocols h2 http/1.1

Finally, please restart your Apache.

  • 2
    cool idea. +1 for both the answer and question. – Rui F Ribeiro Mar 12 '18 at 10:14
  • 3
    Thanks guys. Having just set up HTTP/2 for Ubuntu 16.04 I'll just say that anyone reading this and wondering why HTTP/2 doesn't work will probably need to a2dismod mpm_prefork then run PHP with FastCGI instead. Not all the guides tell you this, so I thought it might be useful to someone. – sdexp Mar 12 '18 at 10:42
  • 1
    Thank you sdexp for the tip! I found this article which @Vlastimil posted his exact steps here that worked for me. – KrzysztofPrugar Sep 30 '18 at 17:37