How to resolve apr_sockaddr_info_get() failed error

If you made some changes in "ports.conf" file and when restarting the apache server getting the below error:

prafulkmr@Blackpanther:~$ sudo /etc/init.d/apache2 restart 
sudo: unable to resolve host Blackpanther
 * Restarting web server apache2                          
AH00112: Warning: DocumentRoot [/var/www/html] does not exist
AH00557: apache2: apr_sockaddr_info_get() failed for Blackpanther
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
    

A 3 step guide will help you to resolve this issue. You just need to follow the below step and edit the "ports.conf" file and add the below line as suggested. Restart the apache server and error will gone.

  • Step 1: Open ports.conf file :
    	sudo  vim  /etc/apache2/ports.conf
    	
    
  • Step 2: Add below line in th ports.conf file:
    	ServerName localhost
    	
    	press "esc" and "colon ie : "
    	Write wq - it will Save  and  exit your ports.conf file.
    
    
  • Step 3: Restart apache server:
    	prafulkmr@Blackpanther:~$ sudo /etc/init.d/apache2 restart 
    sudo: unable to resolve host Blackpanther
     * Restarting web server apache2                 [ OK ] 
     

All done, now you will not get"apr_sockaddr_info_get() failed" error anymore.

Posted in Apache, Linux | Tagged , , , | Comments Off

Comments are closed.