You can take a look here
for a howto.
To compile software from sources in Centos, you need to install the Development Tools
yum groupinstall 'Development Tools'
Apart from that, as you can see in the previous link, the only extra packages you might need is openssl-devel and zlib-devel, if you choose to add ssl and mod_deflate support in apache.