Google's SPDY protocol offers several advantages over serving traffic via HTTP/HTTPS. But, if you want to use SPDY, you're going to have to take a few additional steps to set it up. The good thing is that if you happen to be using Apache on recent Debian or RPM-based systems, installing and using SPDY is a simple matter.

Installing SPDY Packages

Right now, Google is providing binary packages for Debian or RPM-based systems with Apache 2.2.4 or greater. If your system is Debian or Fedora/Red Hat-based, you should have little trouble getting SPDY running. If not, Google also provides the source code for the SPDY module, and you can compile the module if necessary.

Before installing SPDY, you will need to have an SSL certificate to use SPDY since it uses SSL. This can be a self-signed certificate, though Chrome will give some pretty evil-looking errors when accessing a site with a self-signed certificate. For testing SPDY, this is merely a small annoyance. If you're actually looking to deploy SPDY to a production site, though, it's probably much better to go ahead and buy a certificate signed by a recognized authority. (There is a way to turn off SSL, but it's not recommended for anything but debugging.)

If this is the first time you've set up SSL on Debian-based systems, see the Debian Administration tutorial on configuring SSL. The Linode library has a Fedora 14 tutorial that should work with later versions of Fedora. See the CentOS guide if you're using RHEL, CentOS or another RHEL-based distribution.

Next step is to get the right package for your system. My server is a Linode VPS and runs Ubuntu 10.04 LTS, and it's a 32-bit system. The 32-bit Debian package worked just fine for that, but Google also provides a 64-bit Debian package and 32-bit and 64-bit RPMs as well. All of the packages are on the mod_spdy page under the Google Developers site.

You might run into a few snags if you're using an RPM-based system, like openSUSE, that isn't quite what the Google packagers were expecting. Nick Robinson has provided some instruction for getting the binaries installed on openSUSE 12.1 that may prove useful if the RPM doesn't work for you.

For Debian systems, you should use dpkg to install the module, like so:

dpkg -i mod-spdy-beta_current_i386.deb

Note that that's the current package name; it will likely change soon when Google decides to move the module from beta to stable. (One hopes this will happen faster than Gmail moving out of beta status...)

Google also says that you need to run apt-get -f install, but this had no effect on my system. Presumably, some systems require installing additional dependencies.

Next, you'll need to restart Apache for the new module to be recognized. The packages automatically add the spdy.conf and spdy.load files for Apache, so that SPDY will start automatically when Apache starts.


Once you have the SPDY module installed and enabled, use Chrome to visit a page on your site with HTTPS. You can go to chrome://net-internals/#spdy in Chrome to see whether SPDY is enabled, and chrome://net-internals/#events&q=type:SPDY_SESSION%20is:active will show live and active sessions.

I do recommend doing extensive testing before pushing a SPDY deployment live. So far, I've been having no problem with my WordPress blog, but I have found a few glitches with my Piwik install. Apparently, other users have encountered this as well. I suggest watching the mod-spdy-discuss list if you're working with SPDY.

If you decide you don't want to use SPDY until it moves out of beta, you can turn it off without needing to remove the packages. Open the spdy.conf file (under /etc/apache2/mods-available on Debian systems) and turn SpdyEnabled to off. You'll need to restart Apache for that to take effect.

There's talk of SPDY becoming an official Apache module (though it's written in C++ and official modules need to be in C), so it may be even easier to get SPDY in the not-too-distant future. Until then, it's still pretty trivial to install SPDY, and you should be able to have it up and running in less than 30 minutes.