We had already discussed about Heartbleed bug in previous post, We will analyze in OpenSSL/TLS security status in Ubuntu 13.04 or 12.04

Before beginning, need to check the existing version,

# openssl version
OpenSSL 1.0.1c 10 May 2012

OpenSSL-1.0.1c version will not protect your system from  hacker and they can easily get actual content from the system. So we should upgrade to the latest version

Before upgrade need to completely uninstall the existing version,
# apt-get purge openssl

And so, you want to download the latest edition using wget command.
wget https://www.openssl.org/source/openssl-1.0.1g.tar.gz

Note : For more packages refer to the page : https://www.openssl.org/source/
# tar -xf openssl-1.0.1g.tar.gz

# cd openssl-1.0.1g

# ./config

# make

# make test

# make install

ln -s /usr/local/ssl/bin/openssl  /usr/bin/openssl

Now check the upgraded version,
# openssl version
OpenSSL 1.0.1g 7 Apr 2014

One time you have performed all updates you need to reboot the system to prepare all the necessary changes.