How to enable/disable Apache graceful restart in Plesk

Follow

Comments

14 comments

  • Avatar
    David Schroff

    The manual does not notice how to enable this change:

    /usr/local/psa/admin/bin/httpdmng --reconfigure-all
    0
    Comment actions Permalink
  • Avatar
    Pavel Rozental

    Hello David, article is correct. It's not needed to run httpdmng command to apply changes. 

    -1
    Comment actions Permalink
  • Avatar
    Justin

    No David is correct. I run a webapp from within Plesk, and simply completing this database edit did not do the job. My logs showed:

    503 POST {my uri} HTTP/1.0

    (104)Connection reset by peer: AH01075: Error dispatching request to :, referer: {my uri}

    Thank you David for posting the final step.

    0
    Comment actions Permalink
  • Avatar
    Bulat Tsydenov

    s intende@Justin, Hi!

    Let me try to explain to you how it works and why it is actually not required to run httpdmng utility.

    The solution from this article is to add a particular parameter to Pleks database. Every time when Plesk runs reconfiguration of some configuration files, it checks the value of 'restart_apache_gracefully' parameter. If it is true, then Plesk will restart apache gracefully. If you run httpdmng after these steps, it will not make anything to achieve what this article is intended for. 

    As for the errors, I believe they could have been resolved by running httpdmng to fix them, however, the cause of them different and the solution from this article makes nothing to fix them. 

    1
    Comment actions Permalink
  • Avatar
    Stéphan Schamp

    To enable:

    INSERT INTO psa.misc VALUES ('restart_apache_gracefully', 'true') ON DUPLICATE KEY UPDATE val='true';

     

    To disable:

     

    INSERT INTO psa.misc VALUES ('restart_apache_gracefully', 'false') ON DUPLICATE KEY UPDATE val='false';

    0
    Comment actions Permalink
  • Avatar
    Rhein Web

    VERY VERY HELPFULL TO AVOID 502 NGINX ERRORS !!!

    0
    Comment actions Permalink
  • Avatar
    Luis Zubeldia

    quick way to check if grafecull restart is active?

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Luis Zubeldia
    This command will do the trick: plesk db "select * from misc where param = 'restart_apache_gracefully';" . It will either show the "true" or "false" value or it won't show anything - it means that graceful restart is disabled.

    0
    Comment actions Permalink
  • Avatar
    Peter Wise

    If you want to do this completely from within Plesk:

    • Tools & Settings > Database Servers > Wrench icon - to open root phpMyAdmin panel
    • Open psa database
    • Open misc table
    • You can search for restart_apache_gracefully to see if it exists already. Edit it if it does. If not, insert a new row with param set to restart_apache_gracefully and val set to true
    • Recommended to also go to Tools & Settings > Apache Web Server and set Apache restart interval to 300 or something similar (only do apache restarts every 5 minutes instead of immediately as settings changes require)
    • Now go to Tools & Settings > Services Management and press the restart button for the apache service
    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Peter Wise
    Thank you for the detailed steps! I am sure that other Plesk users will find it really helpful.

    0
    Comment actions Permalink
  • Avatar
    Charley

    The "What's new" page of Plesk 18 Obsidian states the following : 

    "Apache graceful restart is now strong enough to be set as the default to reduce downtime for websites."

     

    Could a Plesk Team member confirm if Apache Graceful restart is enabled by default on Plesk Obsidian ? Or should we still enable it ourselves ? 

    0
    Comment actions Permalink
  • Avatar
    Anzhelika Khapaknysh

    Hi @Charley,

    On new servers, where Plesk Obsidian has been installed from the scratch, the Apache graceful restart is enabled by default with Apache restart interval=0.
    You can check it in Tools & Settings > Apache Web Server.

    On servers, where Plesk has been updated to Plesk Obsidian, for example from Plesk Onyx, Apache graceful restart still being disabled.

    1
    Comment actions Permalink
  • Avatar
    Charley

    Thanks @Anzhelika-Khapaknysh !

    May I suggest that someone from Plesk update this article to clarify this and explain that apache2 graceful restart are now strong enough ? :)

    0
    Comment actions Permalink
  • Avatar
    Kuzma Ivanov

    Hi Charley,

    Thanks for your suggestion!

    We've updated the article with Plesk Obsidian instructions :)

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request