• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Upgrading Ubuntu 14.04 to Latest Nginx to Support HTTP2

By Abhishek Ghosh August 22, 2016 5:23 pm Updated on August 22, 2016

Upgrading Ubuntu 14.04 to Latest Nginx to Support HTTP2

Advertisement

Most webmaster and sysadmins has upgraded their setup to Ubuntu 16.04 LTS now. But Not all has upgraded, some of them wants HTTP/2 on Ubuntu 14.04 LTS. Here Are Steps For Upgrading Ubuntu 14.04 to Latest Nginx to Support HTTP2 With Troubleshooting Error. Removal of current Nginx not needed.. Nginx Has No Support For this Upgrade. This is not recommended, we can not give whether HTTP/2 will work or not. But this upgrade is on live website without any downtime and avoid white page error while forcing upgrade. We are forcing the upgrade, it is not normal upgrade.

Upgrading Ubuntu 14.04 to Latest Nginx to Support HTTP2

 

Steps Before Upgrading Ubuntu 14.04 to Latest Nginx to Support HTTP2 : Changes on Config Files

 

You must take backup of /etc/nginx/nginx.conf and /etc/nginx/sites-enabled/default or /etc/nginx/sites-enabled/ directory (depends on how many vHosts you have, name of the files). You can copy-paste the files as secret gist on GitHub gist for easy work. First, you need some changes on /etc/nginx/sites-enabled/default. Normally we use something like –

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
server {
        listen 443 ssl spdy default;
        listen [::]:443 ssl spdy default;
        root /path/to/webroot;
        index index.php index.html;
        server_name thecustomizewindows.com www.thecustomizewindows.com;
        error_log /var/log/nginx/error.log;
    
        location ~ \.php$ {
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
                           }
}

You need to change include fastcgi_params to include fastcgi.conf, change listen 443 ssl spy default to listen 443 ssl http2 default_server, remove any SPDY related directives like add header for NPN, SPDY compression etc. HTTP/2 has a big blacklist of old and insecure ciphers, so we must avoid them. You should have –

Advertisement

---

Vim
1
ssl_prefer_server_ciphers on;.

Do the changes and save that file.

/etc/nginx/nginx.conf needs uncomments these directives –

Vim
1
2
limit_zone slimits $binary_remote_addr 5m;
limit_conn slimits 5;

Make sure that limit_req_zone looks like this –

Vim
1
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;

Also, change the fastcgi cache path. Save the files.

 

Steps Before Upgrading Ubuntu 14.04 to Latest Nginx to Support HTTP2 : Changes on Repository Information

 

cd to /etc/apt/sources.list.d/ and do ls to see if any nginx.list present. If present simply delete with rm command. Now edit the /etc/apt/sources.list file to add :

Vim
1
2
deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx

Save it. Thereafter wget wget nginx_signing.key as written here –

So, you’ll run :

Vim
1
2
3
cd ~
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key

You’ll get OK response. Run –

Vim
1
sudo apt-get update && sudo apt-get upgrade

There will be no change on version of Nginx.

 

Upgrading Ubuntu 14.04 to Latest Nginx to Support HTTP2

 

Above steps deliberately done as we switching to Nginx’s repo. Now run –

Vim
1
add-apt-repository ppa:nginx/development

You’ll get a whooping big response :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
This PPA contains the latest 'Mainline' Release version of the nginx web server software.  (Formerly known as the "Development Version" of nginx)
 
The following releases of Ubuntu (including in-development releases) are supported in this PPA:
* Precise (12.04)
* Trusty (14.04)
* Xenial (16.04)
* Yakkety (16.10)
 
The following releases of Ubuntu will soon become End of Life, and therefore will receive no more updates beyond 1.11.2:
* Wily (15.10)
 
The following releases of Ubuntu are no longer supported, and have had their packages removed from the PPA:
* Lucid (10.04)
* Maverick (10.10)
* Natty (11.04)
* Oneiric (11.10)
* Quantal (11.10)
* Raring (13.04)
* Saucy (13.10)
* Utopic (14.10)
More info: https://launchpad.net/~nginx/+archive/ubuntu/development
Press [ENTER] to continue or ctrl-c to cancel adding it

You will get prompts like :

Vim
1
2
3
4
Configuration file '/etc/nginx/nginx.conf'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:

After all completed run :

Vim
1
sudo apt-get update && sudo apt-get upgrade

Then replace /etc/nginx/nginx.conf and /etc/nginx/sites-enabled/default with our modified files as written in under Changes on Config Files subheader. Run nginx -t and reboot the server on successful output. After making sure that your website is running, run nginx -V and nginx -v to check the output. You should have ngx_http_v2_module and version will be like nginx/1.11.3 or above.

Now, test with some browser tool or third part web based tool. Browse your website’s non-cached pages to make sure that visitors are not getting white pages.

 

You Broken My Server. Give My Old Ngix Back!

 

Do the opposite changes on Repository Information, remove PPAs by deleting the .list files from /etc/apt/sources.list.d directory and two lines we which we added to /etc/apt/sources.list file. Also run :

Vim
1
sudo add-apt-repository --remove ppa:nginx/development

This won’t uninstall packages but the official repositories. You will fully remove the nginx, reboot, then run normal command to install nginx-extras, use the backup of backup of /etc/nginx/nginx.conf and /etc/nginx/sites-enabled/default. It is difficult because the repo of Official Ubuntu and Nginx are different. apt-get downgrade does not exist but near similar way actually exists.

Tagged With paperuri:(2c557f7d9f36e3865a31bdbd4cdc02e8) , HTTP2
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Upgrading Ubuntu 14.04 to Latest Nginx to Support HTTP2

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

  • Install Nginx HTTP/2 With ALPN on Ubuntu 14.04 From ondrej/nginx PPA

    In our previous guide, we have shown how to easily upgrade Nginx on Ubuntu 14.04 for HTTP/2 support. The required changes in the /etc/nginx/sites-enabled/default file, /etc/nginx/nginx.conf file and limitations of that way of installation has been discussed on this article. In this guide, we will show how to install Nginx HTTP/2 with ALPN on Ubuntu […]

  • Steps To Install Nginx Plus on Ubuntu Server (HP Cloud)

    Here Are the Steps To Install Nginx Plus on Ubuntu Server Running on HP Cloud. Nginx Plus is the Paid Version of Nginx with Extra Features.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy