All of the sudden, my development Apache webserver on my Macbook Pro stopped working. I found the soution here:
http://hintsforums.macworld.com/showthread.php?t=83942
Hi aaron. I had exactly the same problem. “Safari can’t connect to the server.
Safari can’t open the page “http://localhost/” because it could not connect to the server “localhost”.
Using Terminal and issuing a “sudo apachectl -t” showed that I had a syntax error in line 1 of my httpd.conf file. I think it happened when I edited the file using Text Wrangler, and accidently saved it with hard-coded line-numbers prefixed to the lines; of course – apache didn’t understand the 1st line, which was “1 #”. Once I fixed that and restarted apache, everything started working as it used to in Mac OS X 10.4.10.