Problem restarting Apache

July 3, 2013 6.1k views
I have just installed lamp stack on centos, according to the tutorials on DO. Now when I give the command "sudo service httpd restart " it gives the following message " Stopping httpd: [ OK ] Starting httpd: httpd: apr_sockaddr_info_get() failed for cent httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName " BUT when i go to the ip address or the domainname.com it show that apache is installed and even the info.php file which i have created for testing purpose is also being showed in both the IP and domainname.com Can someone please explain me this message. I am using linux for the first time. Thanks for the help in advance.
5 Answers
It's just a warning that your hostname is probably not set up properly. You can safely ignore it as it doesn't affect anything.
What do you have in your /etc/hosts file?
This is the content in /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

You either need to configure DNS correctly, or put your hostname into /etc/hosts. It's not a fatal error, but it does betray poor attention to configuration details.

@hypertextsol,

Do as @Alex recommended; then, make sure your hostname is correctly listed in /etc/hostname.
Have another answer? Share your knowledge.