Server Hygiene Tip: Does your server seem to need you to go in every few days and restart the Apache Web Service via SSH or your control panel? If so, you might want to consider an automated solution.
Each night at 1:00 am, you can have a simple script run that restarts the Apache Web Server Service (httpd) automatically. This will help clean out any out-of-control processes and make the server run a lot faster.
Please note that this may not work on all servers. Please proceed at your own risk. Please also note that this fix may kick off legitimate visitors on your site if they are doing something at 1:00 am. If you’d like us to help you with this, we can help on an hourly basis (fill out the contact form at the bottom of the page).
Restart Apache via CronTab each day: Add this Crontab entry onto your server (this will run the script every day at 1:00 am server time): 0 1 * * * /root/scripts/restarthttpdservice.sh > /dev/null 2>&1
Here’s the contents of the file, restarthttptdservice.sh: #!/bin/sh/etc/init.d/httpd stop /etc/init.d/httpd start
This should do it. Good luck!