I've had an issue on a server for a little while now where Apache works fine, but apachectl configtest throws a warning.
# apachectl configtest
httpd: apr_sockaddr_info_get() failed for foo.example.com+
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Everything worked, so I never dug too deep, but each time I saw the message I got a little more annoyed. I thought there might be a hidden character in my httpd.conf file, but the actual issue wasn't related to Apache at all – it was the machine's hostname. I never noticed it because with a machine named foo.example.com I'd only see username@foo at a stock bash command prompt.
Running hostname showed that the the hostname had a trailing +
# hostname
foo.example.com+
It was easily fixed by running:
# hostname foo.example.com


