Server & OS

How to Enable HTTP/2.0 in Apache

페이지 정보

본문

HTTP/2 (HTTP/2.0) is the major upgrade over older version HTTP/1.1 protocol.HTTP/1 was released in 1997 and after a long time the HTTP/2 is released in 2015. HTTP/2 protocol is based on SPDY (generally known as speedy). Some of the key improvements of HTTP/2 are:

  • Server push: Server will pro-actively sent components to clients, So clients doesn’t need to wait for sending requests to server.
  • Multiplexing: Reducing number of active connection by bundling multiple HTTP requests from client and sent to server.
  • Encryption: efficiently use to encryption with TLS protocol in HTTP/2 over HTTP/1.1.
  • HTTP header compression: Compressed headers will reduce the overhead of additional requests to web server.

Enable HTTP2.0 in Apache

This article will help you to enable HTTP/2.0 in Apache web server on CentOS / Red Hat/ Debian and Ubuntu systems.

Install or Update Apache

HTTP/2 protocol supported over Apache version >=2.4.17. So make sure that your Apache version supporting HTTP/2 protocol. If you have not installed Apache or using older version upgrade it first. Use the following commands to add PPA for installing latest Apache2 version on your Ubuntu system.

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/apache2
$ sudo apt-get update
$ sudo apt-get install apache2

Verify Apache Version

After successful installation of Apache2 web server on your system, make sure you have Apache >=2.4.17, Earlier version does not supports HTTP/2 protocol.

$ apache2 -v

Server version: Apache/2.4.17 (Ubuntu)
Server built:   2015-11-05T00:00:00

Enable HTTP/2 in Apache

HTTP/2 protocol requires SSL/TLS virtual hosts. You can’t use HTTP/2 protocol without SSL/TLS enabled websites. Now edit your website VirtualHost and add http2 keyword in listen section.

$ sudo a2enmod http2
$ sudo service apache2 restart

Verify HTTP/2

Now configure a VirtualHost with SSL for your domain and use following online tool for testing HTTP/2 support on your website.

https://tools.keycdn.com/http2-test

관련자료

등록된 댓글이 없습니다.
Today's proverb
우정에 정력을 쏟아라. 그러면 당신에게 돌아오는 대가는 놀라울 만큼 만족스러울 것이다. 친구들이 당신을 필요로 할 때 당신이 그들에게 도움을 준다면, 당신이 후원과 위안을 얻기 위해 그들을 필요로 할 때 좋은 친구들이 도움을 줄 것이다. 롱펠로우가 말했듯이 친구를 가지려면 친구가 되어라. (어니 젤린스키 "결혼하지 않는 즐거움"中에서)