Setup a http/2.0 web server via nginx

nginx now supports http/2.0
My blog is now http2.0 enabled!

nginx supports http/2.0 since version 1.9.5, if you have your own ssl cert for your own domain, you can now easily setup a http/2.0 enabled web server via nginx!

I’ll use Ubuntu 14.04 LTS as an example here, and assume you already have a https enabled site via old versions of nginx.

Add nginx mainline repository from nginx.org:

[bash]
$ sudo sh -c ‘echo deb http://nginx.org/packages/mainline/ubuntu/ `lsb_release -cs` nginx > /etc/apt/sources.list.d/nginx_mainline.list’
[/bash]

Add PGP key for apt:

[bash]
$ curl http://nginx.org/keys/nginx_signing.key | sudo apt-key add –
[/bash]

Update apt repository local cache:

[bash]
$ sudo apt-get update
[/bash]

Remove old nginx(remember to backup your configs!):

[bash]
$ sudo apt-get remove nginx nginx-extra nginx-common
[/bash]

閱讀全文

Convert your Ubuntu/Debian between different versions, like Desktop to Server

There is a very useful tool under Debian/Ubuntu GNU/Linux called tasksel, which can help us “convert” our Debian/Ubuntu between versions.

Install via apt-get/aptitude:

peter@peter-lab ~ $ sudo apt-get install tasksel
[sudo] password for peter:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
tasksel-data
The following NEW packages will be installed:
tasksel tasksel-data
0 upgraded, 2 newly installed, 0 to remove and 46 not upgraded.
Need to get 36.0 kB of archives.
After this operation, 385 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ubuntu.mirror/ubuntu/ trusty/main tasksel-data all 2.88ubuntu15 [6,366 B]
Get:2 http://ubuntu.mirror/ubuntu/ trusty/main tasksel all 2.88ubuntu15 [29.7 kB]
Fetched 36.0 kB in 0s (363 kB/s)
Preconfiguring packages ...
Selecting previously unselected package tasksel-data.
(Reading database ... 229261 files and directories currently installed.)
Preparing to unpack .../tasksel-data_2.88ubuntu15_all.deb ...
Unpacking tasksel-data (2.88ubuntu15) ...
Selecting previously unselected package tasksel.
Preparing to unpack .../tasksel_2.88ubuntu15_all.deb ...
Unpacking tasksel (2.88ubuntu15) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for menu (2.1.46ubuntu1) ...
Setting up tasksel-data (2.88ubuntu15) ...
Setting up tasksel (2.88ubuntu15) ...
Processing triggers for menu (2.1.46ubuntu1) ...

and run:

peter@peter-lab ~ $ sudo tasksel

It’ll show you a menu like this:

tasksel_menu
閱讀全文

nginx now supports http/2.0

From this commit: 257b51c37c5a: The HTTP/2 implementation

The HTTP/2 implementation (RFC 7240, 7241). The SPDY support is removed, as it’s incompatible with the new module.

nginx http/2.0 support has been implemented since 12 days ago, and the SPDY support was removed, the new version came after, nginx v1.9.5 was tagged since 39 hours ago, we can now download it from its download page, and there are also linux pre-built packages: http://nginx.org/en/linux_packages.html

For more info about http 2.0, see the links below: