Not sure if this is a coincidence or not, but after the latest mac system update, I was no longer able to start Apache. All I kept getting was the following error message in my apache error logs:
[alert] (EAI 8)nodename nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "[myservername]"
I tried rebooting and stopping/starting MAMP several times, but it always came back to that error and wouldn’t start Apache.
Finally I ran across this post that led me to the right answer:
I’d suggest adding your hostname to /etc/hosts. Something like “127.0.0.1 testbsd” should help.
It worked like a charm. After I added my server name to the hosts file, I could restart Apache just fine.
Thank you forum posters ;)
Thanks for the article.
I had similar issue but I noticed that the domain name in the error message contains my VPN’s domain. If I turned off my VPN, apache restarts no problem. Adding the domain name from the error message to point to 127.0.01 also solves this.
Thanks for the fix. In my case I’d copied over a custom hosts file with the another computer’s name listed for 127.0.0.1 after localhost. Why I did that, who knows. Thanks!