How to Enable HTTP/2 on CWP7 – Centos Web Panel

by Sandy

HTTP/2 will make our applications faster, simpler, and more robust — a rare combination — by allowing us to undo many of the HTTP/1.1 workarounds previously done within our applications and address these concerns within the transport layer itself. Even better, it also opens up a number of entirely new opportunities to optimize our applications and improve performance!

How to Enable IPv6 on CWP Centos WebPanel

Apache HTTP to HTTPS htaccess redirect on CWP – Centos WebPanel

How to Enable HTTP/2 for Apache in CWP with mod_http2 module -NEW

The primary goals for HTTP/2 are to reduce latency by enabling full request and response multiplexing, minimize protocol overhead via efficient compression of HTTP header fields, and add support for request prioritization and server push. To implement these requirements, there is a large supporting cast of other protocol enhancements, such as new flow control, error handling, and upgrade mechanisms, but these are the most important features that every web developer should understand and leverage in their applications.

HTTP/2 does not modify the application semantics of HTTP in any way. All the core concepts, such as HTTP methods, status codes, URIs, and header fields, remain in place. Instead, HTTP/2 modifies how the data is formatted (framed) and transported between the client and server, both of which manage the entire process, and hides all the complexity from our applications within the new framing layer. As a result, all existing applications can be delivered without modification.

In this tutorial we’ll cover how to enable HTTP/2 on CWP7 – CENTOS 7

Follow this steps to One by One :

On CWP you need to have Nginx + Apache or Nginx + Apache + Varnish installed and ensure SSL certs are installed for your domain names in order to enable HTTP/2, you can enable free SSL provided by Letsencryt too.

Step 1 :

Enable/install Nginx + Apache or Nginx + Apache + Varnish

Step 2 :

Navigate to

cd /etc/nginx/conf.d/vhosts/

Edit your site ssl config :

I’m using https://tut.mysterydata.com for testing purpose :

here you can see http 2 is not enabled tested with this site : https://tools.keycdn.com/http2-test


Now edit nginx vhost ssl config, how to find the ssl config for ssl is easy simply search “yourdoamin.com_ssl.conf” prefix at /etc/nginx/conf.d and ensure you have latest version of centos/rhel 7, you can update your os to latest version via “yum update

nano tut.mysterydata.com_ssl.conf

and replace/add this, compare the changes :

server {
listen 144.217.209.165:443;

to :

server {
listen 144.217.209.165:443 ssl http2;

add this line only : ssl http2;

then restart the nginx server :

service nginx restart

Congratulations you’ve now HTTP/2 enabled on CWP7 tested with this site : https://tools.keycdn.com/http2-test

Another Method :

This process will install HTTP/2 to all of your websites with ssl.

GO to and edit Nginx SSL template :

nano /usr/local/cwpsrv/htdocs/resources/conf/web_servers/vhosts/nginx/default.stpl

FInd this line

listen %ip%:%nginx_port% %http2%;

And replace with this line :

listen %ip%:%nginx_port% ssl http2;

Save it and rebuild the VHost :

GO to CWP ADMIN >> Webserver Settings >> Select WebServers >> choose Nginx & Varnish & Apache (or any with NGINX) >> Save & Rebuild Configuration

that’s it you’re done.

If this post helps you in any way please consider a donation

Donate with PayPal :

md-donate

Donate with Paytm :

md-donate

You may also like

6
Leave a Reply

avatar
4 Comment threads
2 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
5 Comment authors
Ferdosi BegumDavidsandy b.Bendadi Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
dadi
Guest
dadi

thank mat.
I have search many page and found this article.
I can not find this easy tutorial in CWP forum. And i found it in your website.
Thank you so much.
You save my time alot.

Warm regards

Ben
Guest
Ben

I join @dadi with everything he wrote
Thank you for this article, this was very helpful!

David
Guest

Gee… that simple? Thanks a lot! Works like a charm!

Ferdosi Begum
Guest
Ferdosi Begum

Great Man!! Its working! Simple and easy CWP7 Tutorial ever!