Trying to get Hadoop to work; "connection refused" in Hadoop and in Telnet
It's normal getting conection refused if you ftp or telnet to localhost, at least if you haven't up and running that kind of servers, and by default, you don't.

The /etc/hosts should look like 127.0.0.1 localhost by default. To use apache and avoid the error you mentioned, you must add ServerName  localhost to httpd.conf. Restart apache and should works fine.

Don't know if this solve Hadoop error too. Can't help you on it. Just try and let me know.