It’s because your server-name is missing in httpd.conf file..
sudo vim /etc/apache2/httpd.conf
Insert the following line at the httpd.conf: ServerName localhost
Just restart the Apache: sudo /etc/init.d/apache2 restart
if you don’t have httpd.conf under /etc/apache2, you should have apache2.conf – simply add following line
or
if you have installed httpd in installation directory then edit /etc/httpd/conf/httpd.conf and add following line in the file.
ServerName localhost
then restart apache2/httpd service