0

Enable SPDY on Debian

0 Flares Filament.io 0 Flares ×

Few months back Google announced that moving your site to HTTPS will give you a boost in ranking, though the boost in very minor at the moment but later Google has said that its weight will increase so its a good time enable HTTPS on your server. There are other advantages of HTTPS as well but they all come with performance tradeoff due to number of extra “handshake” packets in initial communication, extra CPU cycles require to encrypt/decrypt data, no caching on HTTPS etc.

So what to do?

Don’t worry you can still do few things to improve your site performance and one is use of SPDY with HTTPS which will give you a little boost by compressing request and response headers, use of multiplexed requests over a single connection etc. The process is very simple and just require couple of minutes (providing your site is already configured with standard HTTPS/SSL)

Apache:

First download your the required package from https://developers.google.com/speed/spdy/mod_spdy/. As I have Debian 64bit so I will go for 64bit package


wget https://dl-ssl.google.com/dl/linux/direct/mod-spdy-beta_current_amd64.deb

Install the .deb that you downloaded

dpkg -i mod-spdy-*.deb
apt-get -f install

Enabled the Apache module

a2enmod spdy
/etc/init.d/apache2 restart

There is one more change in order to make SPDY working that in activate the mod from Apache mod_spdy config so edit spdy.conf and make sure you have below line.


SpdyEnabled on

Restart apache so new changes take effect.


/etc/init.d/apache2 restart

Now you are ready to test the SPDY functionality, you can test by various methods. Easiest is to visit spdycheck.org and test your site, another way to install SPDY indicator Chrome extension which will show you a Green lightning icon along with SPDY protocol version in browser address bar if site is SPDY enabled. Another way to test is to visit your site in Chrome then open a new tab as below which will show you the SPDY status.

chrome://net-internals/#spdy

Once all good add SPDY repository in your list you get the latest package automatically. Create a new file /etc/apt/sources.list.d/mod-spdy.list and add the repo.


/etc/apt/sources.list.d/mod-spdy.list
deb http://dl.google.com/linux/mod-spdy/deb/ stable main

Test whether the newly added repository is working.


apt-get update
apt-get upgrade

Nginx:

Nginx above v1.5 support SPDY 3 protocol so make sure you have installed the latest version of it. You can check your nginx version by below

nginx -V

Make sure you you see --with-http_spdy_module in the list of compiled modules. To enable it you just need to add spdy option in your ssl listener so your new config will looks like below.


server {
listen 443 ssl spdy;
...
...
}

After saving the new config just restart the nginx service.

/etc/init.d/nginnx restart

If all good your site is ready to ROCK!!

0 Flares Twitter 0 Facebook 0 LinkedIn 0 Google+ 0 Filament.io 0 Flares ×

Leave a Reply

Your email address will not be published. Required fields are marked *