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




  • Avatar
    Martin Blaha

    That did it for me, thanks.

    After performing dist-upgrade on my server running Ubuntu 14.04.5 (Plesk Onyx v17.5.3_build1705170317.16 os_Ubuntu 14.04).

  • Avatar

    I have similar issue on Centos...

  • Avatar
    Ivan Postnikov

    Hello @tomaz, could you, please, let me know the exact error message you get?

    This should help to suggest you a solution.

    This bug is registered as specific for Ubuntu 14.04 with systemd or Debian 8.

  • Avatar

    Similar problem here on Centos, after plesk update itself on Aug/06:

    "Can not restart web server: INFO: [Mon Aug 6 12:52:11 -03 2018]: Service: httpd, Action: stop Trying to stop service httpd... WARNING! Some problems are found during attempt to status service pc-remote - control script doesn't exist or isn't executable(see log file: /var/log/plesk/rc_actions.log) Continue... STOP ...."  (very long text)


  • Avatar
    Peter Peterson (Edited )


    I updated fist my ubuntu server from version 14.04 to 16.04. After that I used the installer to upgrade plesk from version 12.5 to Plesk Onyx 17.8.11 Update #16.

    Plesk can't start the apache2 service anymore through apache_control_adapter. There is also a Template Exception but I have no clue where to Search.

    httpdmng --reconfigure-domains fails due to the following exception:

    Details: [2018-08-08 14:14:09.606] 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]
    [2018-08-08 14:14:11.739] ERR [panel] Apache config (15337302900.32783500) generation failed: Template_Exception: Can not restart web server:
    file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
    line: 109
    code: 0
    Can not restart web server:

    Starting or restarting the server with service apache2 start works.

    Thanks you, 


  • Avatar
    Alexandr Shadrin

    Hi @Jorge!

    The resolution in this article is specific for dist-upgrade issues, so the cause of the error that you faced should be different. As the issue occurs after the update, I suggest re-applying the updates:

    # plesk installer update --repatch

    And then executing the following command:

    # plesk repair installation

    In case it will not help, then submit a full request to technical support.

  • Avatar
    Alexandr Shadrin

    Hi @Peter Peterson!


    Could you provide me with the content of /opt/psa/admin/sbin/pleskrc? Also, execute the following command in order to re-read server components and try restart via apache_control_adapter again:

    # plesk sbin packagemng -sdf

  • Avatar
    Peter Peterson

    Hi @Alexandr Shadrin, 


    the plesk sbin packagemng -sdf didnt help. the content of the desired folder is: https://pastebin.com/jmjDHzcf


    Thank you, 


  • Avatar

    Hi @Alexandr Shadrin 
    Thank you so much, it worked!

  • Avatar
    Alexandr Shadrin (Edited )

    Hi again, @Peter Peterson! 

    Script looks fine (in case systemd is used), so I suggest troubleshooting the issue further in the following manner:

    1. Try restarting apache with various methods, for example:

    # service apache2 restart
    # systemctl restart apache2
    # /etc/init.d/apache2 restart
    # /usr/sbin/invoke-rc.d apache2 restart

    Maybe some of them will finish in 0 seconds, then the cause will be the fact that service is disabled. Maybe you will need to run the following command in order to make apache_control_adapter work:

    # update-rc.d mysql enable

  • Avatar
    Alexandr Shadrin

    Hi @Jorge!

    Glad I can help!

Please sign in to leave a comment.

Have more questions? Submit a request