Domains' reconfiguration fails: Template_Exception: Can not restart web server

Created:

2016-11-16 12:44:44 UTC

Modified:

2017-08-17 15:09:10 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Domains' reconfiguration fails: Template_Exception: Can not restart web server

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk Onyx for Linux

Note: This article has the reference to the issue with the fix available:

  • #PPPM-3904 "On Plesk with Apache 2.4, a domain configuration could not be updated because Apache failed to restart."
    Fixed in:
Please consider updating your server:

Symptoms

Ubuntu 12.04 with Apache 2.4 is installed or OS is being upgrading to Ubuntu 14.04 with apache 2.4

Domains reconfiguration fails with the following error:

    ERR [panel] Apache config (14530640570.65770600) generation failed: Template_Exception: Can not restart web server:
file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
line: 110
code: 0
DEBUG [util_exec] [569bfffb2195c] Starting: send-error-report /opt/psa/admin/bin/send-error-report

From the `/var/log/plesk/panel.log`:

DEBUG [util_exec] [45f53d4fd8587abc1e746ad36b388503][0] Starting: apache_control_adapter --restart --restart-interval 0 --http-port 80 --https-port 443
ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/apache_control_adapter' '--restart' '--restart-interval' '0' '--http-port' '80' '--https-port' '443'] with exit code [255]

It is not possible to manage Apache service in Home > Tools & Settings > Services Management with the following error:

"Error: Unable to make action: Unable to manage service by apache_control_adapter: ('start', 'web'). Error: "

According to Apache logs the service is actually restarted successfully.

Cause

The apache_control_adapter utility monitors a wrong pid-file. This issue has been considered as software issue #PPPM-3904 and will be fixed in future Plesk updates.

Resolution

  1. Change apache PID file location in /etc/apache2/envvars to make utility /opt/psa/admin/bin/apache_control_adapter work properly:

    # grep -i pid /etc/apache2/envvars
    export APACHE_PID_FILE=/var/run/apache2.pid
  2. Restart apache.

  3. If does not help, find what pid file Apache monitors

    # strace /opt/psa/admin/bin/apache_control_adapter --restart --restart-interval 0 --http-port 80         --https-port 443
    ...
    nanosleep({0, 500000000}, NULL) = 0
    open("/var/run/apache2/apache2.pid", O_RDONLY) = -1 ENOENT (No such file or directory)
    nanosleep({0, 500000000}, NULL) = 0
    open("/var/run/apache2/apache2.pid", O_RDONLY) = -1 ENOENT (No such file or directory)
  4. Create the symbolic link to pid file from strace :

    # ln -s /var/run/apache2.pid /var/run/apache2/apache2.pid

Note : This error may appear on Plesk upgrade to 12.5 or OS dist-upgrade.

Have more questions? Submit a request
Please sign in to leave a comment.