How to set up Apache to restart daily in Plesk

Follow

Comments

4 comments

  • Avatar
    Robert Tucker

    A cron job in Ubuntu to restart the apache2 service fails:

     

    Task "service apache2 restart" completed with error in 0 seconds, output:

    /bin/sh: 1: service: not found

    This work perfectly from the command line.

    0
    Comment actions Permalink
  • Avatar
    Robert Tucker

    In addition a domain with webmail disabled keeps popping up in the tempate errors. e.g.

    Error: Can not reconfigure web server configurations: Unable to execute httpdmng: [2020-09-20 21:01:01.767] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/apache_control_adapter' '--restart' '--restart-interval' '0' '--http-port' '7080' '--https-port' '7081'] with exit code [255]
    [2020-09-20 21:01:02.860] ERR [panel] Apache config (16006355310.09269600) generation failed: Template_Exception: Can not restart web server:
    file: /opt/psa/admin/plib/Service/Driver/Web/Server/Apache.php
    line: 122
    code: 0
    Can not restart web server:

    And then all apache driven sites fail.  I cant add a cron job to restart it as I get the error above.  This problem is causing MAJOR disruption as all webmail sites go offline.

    I have rebuilt the templates, I have removed the templates - they keep coming back

    0
    Comment actions Permalink
  • Avatar
    Julian Bonpland Mignaquy

    Robert Tucker Hi!, please open a support ticket with us so i can work on this issue https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support-

    0
    Comment actions Permalink
  • Avatar
    Fernando

    Hello Rbbert Tucker,

    You need to provide the full path to service.

     

    /usr/sbin/service apache2 restart

     

    This worked for me

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request