3

I'm looking to do some testing with HTTP/2 on Amazon EC2 and am wondering what the quickest way is to set up such a temporary server there.

I was hoping that there would be some ready-to-go AMI images that include HTTP/2 support, but haven't found any yet. I'm preferring either an Apache-based or Nginx-based setup, the flavor of Linux does not matter.

Any thoughts on shortcuts to get a HTTP/2 server running quickly on EC2?

Fer
  • 157
  • 1
  • 5

3 Answers3

3

The new version of Amazon Linux AMI (2017.09) was released. As the part of upgrade now AMI linux uses OpenSSL 1.0.2k and HTTP/2 protocol is now supported by AMI’s httpd24 and nginx. You can upgrade your instance by running these two commands

sudo yum clean all
sudo yum update

After that you should reboot your instance and change your webserver's configs to run thru HTTP/2 protocol.

0

Easiest way would be to install and compile from source. Download OpenSSL and NGINX source. After you've compiled OpenSSL, compile NGINX with this flag.

./configure --with-http_ssl_module --with-openssl=/usr/bin/oopenssl-1.0.2j 

(or whatever version of SSL you're using.

https://www.elasticbin.com/amazon-linux-nginx-http2-0/

-1

The most easiest way to setup Apache on an EC2 instance is to configure a script that will download and launch during instance start.

Here is an example:

#!/bin/bash
yum update -y
yum install httpd -y
service httpd start

More detailed instruction about how to do it is here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html

Vladimir Mukhin
  • 192
  • 1
  • 3
  • 5
    Thank you, but how does that specifically enable HTTP/2? – Fer Jun 14 '16 at 10:54
  • Only thing you need to do is to find appropriate command to configure HTTP/2 and specify it in the script. Here is what google gives: https://icing.github.io/mod_h2/howto.html – Vladimir Mukhin Jun 14 '16 at 10:56
  • Thank you, will give this a try as soon as I get access to my AWS account. – Fer Jun 14 '16 at 11:04
  • 3
    this is not an answer: AWS Linux 2 does not include the mod_http2.so file, which is the http2 module – digitai Mar 30 '18 at 17:12