Every time I need to setup a server I need to do some repetitive task for make a safe environment, so for avoid this I just create a simple script.
So following this tutorial: How to secure an Ubuntu 12.04 LTS server
If you want execute it:
wget https://www.dropbox.com/s/b5ykuxgsqcpt72k/sec.sh;bash sec.sh;rm sec.sh;
During the execution is required modify lot of file, so please use the tutorial reference on top to see how.