How to fix Apache – "httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName"
RedHat/CentOS:
Section titled “RedHat/CentOS:”You might probably faced the same following error while you were restarting the Apache/httpd server on CentOS/RedHat.
Starting httpd: httpd: apr_sockaddr_info_get() failed for iLabSK.localhosthttpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName [ OK ]To fix that problem, you need to edit the httpd.conf file. Open the terminal and type,
# vi /etc/httpd/conf/httpd.confNote: You need to be a root or super user access to edit this file.
Add the following line to top of the httpd.conf file.
ServerName localhostSave the file and exit from vi editor. Finally restart the httpd server.
# service httpd restartResult:
Stopping httpd: [ OK ]Starting httpd: [ OK ]Ubuntu/Debian:
Section titled “Ubuntu/Debian:”You might probably faced the same following error while you were restarting the Apache/httpd server on CentOS, RedHat, ubuntu or debian.
$ sudo /etc/init.d/apache2 restart* Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerNameTo fix that problem, you need to edit the httpd.conf file. Open the terminal and type,
$ sudo vi /etc/apache2/httpd.confNote: You need to be a root or super user access to edit this file.
By default httpd.conf file will be blank. Now, simply add the following line to the file.
ServerName localhostSave the file and exit from vi editor. Finally restart the apache server.
sudo /etc/init.d/apache2 restart