[Fixed] Name or service not known: mod_unique_id: unable to find IPv4 address of
After completing a new cPanel / Plesk / Apache web server setup I observed that Apache web service is not running. On trying to restart the http service, it failed with Apache http error logs as below:
"[alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "server.example.com"
Configuration Failed"
Initially, I suspected that it might an issue with the Apache configuration. Therefore I verified the syntax of the Apache http config file using below command:
/etc/init.d/httpd configtest
Unfortunately, there were no issues with the Apache http configuration file.
After verifying couple of things, I casually checked the /etc/hosts file and noticed that entries of localhost and server hostname were not correct. I made necessary corrections in that file which looked as below.
127.0.0.1 localhost 192.168.1.101 WEBSERVER
Note: Please input your server hostname instead of WEBSERVER as shown in above example.
Post making changes the Apache web service started without any error and not warning messages were observed in the log.
If any feedback, queries are always welcome!