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

Refers to:

  • Plesk 12.5 for Linux
  • Plesk Onyx for Linux

Created:

2016-11-16 12:44:44 UTC

Modified:

2017-02-07 15:21:16 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Domains' reconfiguration fails: Template_Exception: Can not restart web 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]

According to Apache logs the service is actually restarted successfully.

As a result websites show Plesk default page.

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.