Apache cannot find server name
Tagged:  •  

When starting Apache for the first time, I came across this error message in httpd-error.log:

unable to find IPv4 address of "servername"

The solution was obvious, but couldn't think of it immediately. So by writing it down here I'm sure I'll never forget.

Add the hostname to /etc/hosts!

127.0.0.1 servername

Alternatively just use the

Alternatively just use the ServerName directive in your apache config file.

Already tried

Well, that's what I initially tried, but Apache refused to start whatever I set it to. Still I think I'm doing something wrong.