Author |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3093 Location: Hilversum, NL, EU
|
Posted: Sat 10 Oct '15 10:29 Post subject: mod_http2 :: HowTo & Info & Tips |
|
|
Apache 2.4.17 contains mod_http2 (formely mod_h2) and other necessary changes needed for mod_http2. Mod_http2 is contributed by Stefan Eissing (greenbytes GmbH), a great job.
A short intro HTTP/2 is at https://http2.akamai.com/ and https://en.wikipedia.org/wiki/HTTP/2
H2 requires OpenSSL 1.0.2 and it is advised to use the Modern compatibility ciphers at : https://www.apachelounge.com/viewtopic.php?p=38292 They give with SSLLabs a good score and in Chrome "using modern cipher suite".
The h2 protocol (http/2 over TLS/1.2) is the only protocol that the current major browsers support, like Chrome, Firefox, IOS9, Win10. The h2c (http/2 over http and no browser currently supports it) is a non-encrypted protocol that mod_http2 also supports and maybe the browsers will chill out eventually and support it. After all, not everything needs encryption and therefor a waste of resources on both ends of a connection.
There are two new core directives available, Protocols and ProtocolsHonorOrder. In the case of mod_h2 for h2:
Code: | LoadModule http2_module modules/mod_http2.so
<IfModule http2_module>
ProtocolsHonorOrder On
Protocols h2 http/1.1
</IfModule>
|
For more info and configuration, see: http://icing.github.io/mod_h2/howto.html and https://httpd.apache.org/docs/2.4/mod/mod_http2.html
To see if your browser is using HTTP/2, Chrome has a nice extension HTTP/2 and SPDY indicator, with Windows 10 you can see it with F12 / Network, and Firefox has HTTP/2 and SPDY indicator
See also for Curl with http/2: https://www.apachelounge.com/viewtopic.php?t=6784
Please post issues with mod_http2 in the Apache forum.
Last edited by Steffen on Mon 12 Oct '15 21:59; edited 1 time in total |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3093 Location: Hilversum, NL, EU
|
Posted: Mon 12 Oct '15 21:58 Post subject: http/2 requests are still showed as http/1.1. |
|
|
In access log and mod_status http/2 requests are still showed as http/1.1.
If you want see HTTP/2 in the log:
add %H to the end of your LogFormat string where it will not break any log readers.
Is going to be fixed in the next release (already in trunk).
Last edited by Steffen on Tue 13 Oct '15 13:50; edited 1 time in total |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3093 Location: Hilversum, NL, EU
|
Posted: Tue 13 Oct '15 12:35 Post subject: |
|
|
Be sure that :
<IfModule http2_module>
ProtocolsHonorOrder On
Protocols h2 h2c http/1.1
</IfModule>
is placed after
LoadModule http2_module modules/mod_http2.so
I was trying h2c and the IfModule was only picked up when it is after the Loadmodule line. |
|
Back to top |
|
icing
Joined: 22 Sep 2015 Posts: 41 Location: Münster, Germany
|
Posted: Tue 13 Oct '15 13:23 Post subject: |
|
|
No need to place an 'IfModule' around it:
ProtocolsHonorOrder On
Protocols h2 h2c http/1.1
are both core directives and the protocols named are just strings. You could as well write:
Protocols ugga ftp agga h2 websocket spdy/3.1 http/1.1
without needing to make sure that all those modules have been loaded. Unknown/Unimplemented protocol strings will just have no effect. |
|
Back to top |
|
lunter
Joined: 12 May 2011 Posts: 10
|
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1264 Location: Amsterdam, NL, EU
|
|
Back to top |
|
nickgearls
Joined: 07 Jul 2016 Posts: 9
|
Posted: Wed 23 Aug '17 16:20 Post subject: Re: mod_http2 :: HowTo & Info & Tips |
|
|
Any info on how to compile it with Visual Studio? |
|
Back to top |
|