If you're looking for how to update your Amazon Elastic Load Balancer, click here instead.
The recently discovered
"Heart Bleed" bug in OpenSSL is an extremely critical security issue. Fixing it is relatively simple now that Ubuntu has pushed out changes to their repositories containing a fixed version of OpenSSL.
The following steps need to be run on each server that you generated a certificate or private key on. If you are using one certificate on multiple servers, then the cert needs to be revoked and regenerated on one of them and then pushed to each of the other servers.
UPDATE: Thanks to anonymous commenter for pointing out that relying solely on the build information is not completely accurate. Versions earlier than 1.0.1 are not vulnerable (although you should upgrade now that a fix is live for the latest version).
First, to make sure you (for some reason) don't have the latest version, run the following commands:
openssl version -b
openssl version -a
The response will look like:
OpenSSL 1.0.1 14 Mar 2012
built on: Wed Jan 8 20:45:51 UTC 2014
If the date is not more recent than older than "Mon Apr 7 20:33:29 UTC 2014" and the version is 1.0.1, then you are vulnerable to the Heart Bleed bug.
UPDATE: Reworded the above to make it clearer that the vulnerable versions were built before April 7th.
UPDATE: As James points out in the comments, different versions may have been built at different times, thus you should rely only on the date, not the time. Anything before Apr 7 is considered vulnerable.
Next, update your repositories:
sudo apt-get update
Once this finishes, upgrade openssl:
sudo apt-get upgrade openssl
sudo apt-get install openssl libssl1.0.0
UPDATE: use the install command to upgrade only openssl and libssl rather than upgrading everything on the server.
Once the upgrade finishes, check the version again. It should now read "Apr 7" or later.
Now, you need to regenerate your certificate using a new private key. This process is the same as it as always been, but I am including the link here for posterity's sake:
(Use step 3 and replace the key and cert names with your existing ones to overwrite them).
Once finished, you need to restart your Apache server and any services using SSL.
Update: Now with video: