I know this is an old thread, but this is a new answer. I got an AI tip when I posed this problem to Google just now, so I can't provide an authoritative link, but here's what worked for me.
First, as a diagnostic I edited the URL in my browser from localhost:8888/tree to 127.0.0.1:8888/tree and that gave me some reasonable content. Then I edited /etc/hosts, found this:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
and deleted the last two definitions of local host. Problem solved. For now. Who knows what will happen when IPv6 takes over the world?