Enable SPDY for Your Erlang Website
Google’s Strange Loop presentation Making the Web Faster inspired me to enable SPDY on one of my side projects Zin In Sushi. This simple sushi restaurant review site is build in Erlang using Basho’s Webmachine in combination with Erlydtl.
Below is a quick writeup of the steps needed.
- Your Erlang powered website is running on port 3000 (Substitute this with your own magic value) on HTTP.
- You are running a recent version of Ubuntu (I’m running 12.04 LTS).
- Your domain is
The steps in summary:
- Reverse proxy setup with Apache 2
- SSL Setup with Apache 2
- Installation of
$ sudo service apache restart, and you’re done!
Reverse proxy setup with Apache 2
First install Apache 2 if not already present:
proxy_http Apache module to get reverse proxy support:
Add a new site to Apache’s
And past in the following contents (and replace the domain name and ports if needed):
1 2 3 4 5 6 7 8
Enable the site by executing:
Next up; SSL support!
SSL Setup with Apache 2
ssl Apache module to enable SSL:
SSL certificates are not free, so in this article we generate a self signed SSL certificate to keep moving:
Important! When generating the key, make sure the FQDN matches your domain name:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
After generating the required encryption keys, we re-edit the
And append the following configuration code:
1 2 3 4 5 6 7 8 9 10 11 12 13
Important! We need to check if Apache is listening on port 443 (SSL) and virtualhost support is enabled for this.
/etc/apache2/ports.conf should have the following lines enabled:
1 2 3 4
Now we’re in a good shape to add SPDY support
You need to fetch the latest
mod_spdy package from Google:
Check the architecture of your system by running
Install the package by running the following commands:
1 2 3
Le moment suprême
Restart Apache to power up the new configuration:
And browse to your website
https://www.example.org in Google Chrome.
mod_spdy is working, open
chrome://net-internals/#spd just after the first page load. Your server’s domain should be listed in the table under the SPDY sessions heading.gs