Issue
When I ran the following command to restart Apache server, I got the following error messages:
$apachectl -k restart
AH00557: apache2: apr_sockaddr_info_get() failed for work
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
However, with these error messages, Apache server is working fine.
Solution
These error messages happen because Apache was installed and no setup has been done. To fix this problem, simply set the ServerName in the configuration file like the followings:
echo "ServerName localhost" > /etc/apache2/conf-available/666-ServerName.conf
Then, activate the configuration like this.
a2enconf 666-ServerName
Re-run
apachectl -k restart
Both messages AH00557 & AH00558 should not appear.