Question: Unable to start Apache on a Plesk server: Unable to find IPv4 address of server.example.com
Applicable to:
Symptoms- Apache fails to start. One of the following error messages appears in the Apache error log file:
- on CentOS/RHEL-based distributions: /var/log/httpd/error_log
- on Debian/Ubuntu-based distributions: /var/log/apache2/error.log
(
EAI 2)Name or service not known: AH01564: unable to find IPv4 address of "server.example.com"
AH00016: Configuration Failed(EAI 3)Temporary failure in name resolution: AH01564: unable to find IPv4 address of "ip-203-0-113-2"
AH00016: Configuration Failed
- The following email notification might be sent to Plesk administrator:
Unable to generate the web server configuration file on the host <server.example.com> because of the following errors: Template_Exception: Can not restart web server: file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php line: 109 code: 0
Unable to generate the web server configuration file on the host <server-hostname> because of the following errors:
Template_Exception: Can not restart web server: Apache is down, start it instead of graceful Apache is down, start it instead of graceful
CauseThere is no IPv4 address specified in the /etc/hosts file for the server name configured in /etc/hostname file.
Resolution1.Log in to Plesk.
2.Go to
Tools & Settings > Server Settings.3.In the
Full hostname field, set the server hostname.
4.Click
OK.5.Go to
Tools & Settings > Services Management and make sure
Web Server (Apache) is started.
Command-line instructions1.Connect to the Plesk server via SSH.
2.Open the file /etc/hosts in a text editor. In this example, we are using the vi editor:
# vi /etc/hosts
3.Add a valid <IPv4 hostname> configuration:, for example:
203.0.113.2 server.example.com
- Server hostname can be edited in the file /etc/hostname or can be found with the command hostname.
4.Reboot the server.
5.Verify that Apache has been started:
- on CentOS/RHEL-based distributions:
# service httpd status
- on Debian/Ubuntu-based distributions:
# service apache2 status