Symptoms
-
Apache on Plesk server cannot be started manually or Apache is not started automatically after a server reboot. 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 - On CentOS/RHEL-based distributions:
-
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
OR
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
Cause
There is no IPv4 specified in the /etc/hosts
file for the server name configured in /etc/hostname
file.
Resolution
- Log into Plesk
- Navigate to Tools & Settings > Server Settings in “Full hostname” set the server hostname and click “OK” button. Note that the server name should include domain part, for example: server.example.com
Command line
-
Connect to the server via SSH
-
Edit the file
/etc/hosts
and add valid <IPv4 hostname> configuration:Note: If the system has configured ‘manage_etc_hosts‘ as True, check this KB article.
203.0.113.2 server.example.com
- Server hostname can be edited in the file
/etc/hostname
or it can be found with the commandhostname
- Server hostname can be edited in the file
-
Reboot the server
-
Verify that Apache has been started:
-
On CentOS/RHEL-based distributions:
# service httpd status
-
On Debian/Ubuntu-based distributions:
# service apache2 status
-