- Plesk for Linux
Websites become temporarily unavailable when applying configuration changes. How to set up Apache restart every day at a certain time?
Plesk does not have a direct functionality to schedule Apache restarts at a particular time of the day.
There are two options to implement it:
- Configure Apache to keep established HTTP connections when applying new configuration:
- configure Apache graceful restart
- set Apache restart interval to 0 in Tools & Settings > Apache Web Server
- install Watchdog extension to monitor Apache
- Create a scheduled task to restart Apache every day:
- log in to Plesk
- set Apache restart interval to
9999in Tools & Settings > Apache Web Server
- go to Tools & Settings > Schedule Tasks and add the task, for example, for CentOS/RHEL/CloudLinux:
Note: for Debian/Ubuntu, the command should be "/usr/sbin/service apache2 restart".
In case the first option is applied, the websites will always stay accessible. However, in certain environments, Apache graceful restart may not be stable. For this reason, Watchdog service monitor should be installed.