I have been having issues I can’t narrow down that have been causing Apache to go into a conniption and the websites on my server to go down. The quick duct tape fix has been to login ot the server and restart Apache. This is a manual process though and the site could be down for a while before I get in to do the restart.
There are tons of website monitoring services out there, some free, that can alert you to such a failure. The “free” ones I have found though don’t allow you to do more frequent checking without upgrading to a paid plan. Furthermore, most are only “alert” services and cannot actually intervene and do anything.
I thought there must be a way to do this via a script and a cron job. After some digging around I wasn’t able to find a simple script that would do exactly what I wanted. However I found enough bits and pieces to cobble this together and after some testing it seems to work well. (more…)