Problem restarting Apache

Posted July 3, 2013 14.5k 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 for ServerName " BUT when i go to the ip address or the 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 Can someone please explain me this message. I am using linux for the first time. Thanks for the help in advance.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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 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.


Do as @Alex recommended; then, make sure your hostname is correctly listed in /etc/hostname.