Unable to generate Apache configuration files: Template_Exception: Can not restart web server

Created:

2017-01-06 14:30:49 UTC

Modified:

2017-08-08 13:21:05 UTC

2

Was this article helpful?


Have more questions?

Submit a request

Unable to generate Apache configuration files: Template_Exception: Can not restart web server

Applicable to:

  • Plesk for Linux

Symptoms

  1. Ubuntu 14.04 or Debian 8 with systemd is used.

  2. It is not possible to generate Apache configuration files. The following error can be found in /var/log/plesk/panel.log file:

    Details: [2017-01-27 15:43:01] 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]
    Error occured while sending feedback. HTTP code returned: 502
    [2017-01-27 15:43:02] ERR [panel] Apache config (14855280520.33207700) generation failed: Template_Exception: Can not restart web server: httpd stop failed

    file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
    line: 108
    code: 0
    Can not restart web server: httpd stop failed
  3. Upgrade to Plesk Onyx was failed. In /var/log/plesk/install/autoinstaller3.log following errors can be found:
    Failed to issue method call: Unit apache2.service failed to load: No such file or directory. See system logs and 'systemctl status apache2.service' for details.
    /bin/systemctl: invalid option -- 'l'
    Failed to issue method call: Unit mysql.service failed to load: No such file or directory. See system logs and 'systemctl status mysql.service' for details.
    /bin/systemctl: invalid option -- 'l'

Cause

This is Plesk bug with ID #PPPM-5514 which is planned to be fixed in future Plesk updates.

Resolution

As a workaround:

  1. Backup /opt/psa/admin/sbin/pleskrc file:
    # cp -p /opt/psa/admin/sbin/pleskrc{,_backup}
  2. Replace "systemctl" with "systemctl_pp" in /opt/psa/admin/sbin/pleskrc file:
    # sed -i 's/systemctl/systemctl_pp/g' /opt/psa/admin/sbin/pleskrc
    

Note: according to Ubuntu documentation, the advised way is to use upstart on releases prior to Ubuntu 15.04:

"First, it is important to note that systemd is only fully supported in Ubuntu 15.04 and later releases. While systemd is available in prior releases through the Ubuntu repositories, there is a deemphasis of support for these releases as noted here. Hence, it is advised to use the default upstart on prior releases. "

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