HTTP2 support in MAMP Pro
Asked Answered
K

4

14

Is there any way to enable HTTP2 support in MAMP Pro? I want to test and improve some of my local development websites with HTTP2 support.

I've been searching for a while now, but haven't found a single solution.

Kantar answered 16/11, 2016 at 16:2 Comment(2)
I would recommend a docker setup instead of MAMP. With docker you will be much more flexible.Nonessential
Did you solve it? Would like to know too.Varanasi
P
3

Recently I configured HTTP2 for NodeJS APP on MAMP Pro with NGINX. I wrote short article about it https://www.linkedin.com/pulse/nodejs-http2-server-mamp-pro-nginx-sergei-iastrebov/ I think it'll help you.

Pedaiah answered 7/6, 2018 at 10:53 Comment(0)
R
2

As Tarun has stated the versions of Apache and Nginx included in MAMP pro do not support HTTP/2. Additionally HTTP/2 requires a modern version of OpenSSL (1.0.2) to support HTTP/2 on most browsers.

Your best options are therefore to change Apache and/or Nginx to support this. You can then copy the appropriate config to connect up to the rest of the MAMP stack (e.g. MySQL, PHP..etc.).

If you are on Windows then ApacheHaus and Apache Lounge offer up to date Apache versions with HTTP/2 support. Or if you prefer Nginx then can download these directly from Nginx.

If you are on MacOS then Homebrew allows you to install up to date versions of Apache and Nginx.

Alternatively you can use a Docker image if set up for that, or can compile from source (relatively simple for MacOS as very similar as for linux, but a good bit more complicated for Windows).

Rosenwald answered 9/4, 2018 at 17:1 Comment(0)
P
0

If you are using Nginx you can just add following code into your server block or http block (for global) to the nginx.conf

add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";

Otherwise, if Apache you can do above, then open Nginx setting and enable "Use Nginx as a Reverse Proxy of Apache"

Portraiture answered 20/2, 2018 at 22:31 Comment(0)
O
0

For MAMP Pro v4.0.0

C:\>F:\MAMP\bin\nginx\nginx.exe -V
nginx version: nginx/1.13.1
built by cl 16.00.40219.01 for 80x86
built with OpenSSL 1.0.1m 19 Mar 2015
TLS SNI support enabled
configure arguments: --with-cc=cl --builddir=objs --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe
--http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs/lib/pcre --with-zl
ib=objs/lib/zlib --with-openssl=objs/lib/openssl --with-select_module --with-http_ssl_module --add-module=c:/MinGW/msys/1.0/home/Nebojsa/subsmodule/ngx_http_substitutions_filter_module

Nginx is not built with HTTP2 support

C:\>F:\MAMP\bin\apache\bin\httpd.exe -V
Server version: Apache/2.2.31 (Win32)
Server built:   May  6 2016 10:19:53
Server's Module Magic Number: 20051115:40
Server loaded:  APR 1.5.2, APR-Util 1.5.4
Compiled using: APR 1.5.2, APR-Util 1.5.4
Architecture:   32-bit
Server MPM:     WinNT
  threaded:     yes (fixed thread count)
    forked:     no
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/winnt"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/apache"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error.log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

If you look at Apache HTTP2 module

Apache Module mod_http2

Available Languages: en

Description: Support for the HTTP/2 transport layer

Status: Extension

Module Identifier: http2_module

Source File: mod_http2.c

Compatibility: Available in version 2.4.17 and later

The minimum version of Apache is not met with MAMP Pro 4 using Apache 2.2.31.

So you can't use the HTTP2 module. It is better off to use other newer version apache through docker or directly to work with HTTP2

Organon answered 5/4, 2018 at 8:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.