I'm still no closer to solving the problems I'm having with mod_mono. It means having to restart the apache server at least twice a day, leaving large gaps in the day where this blog is completely inaccessible.

Until such time as I can trace and resolve the mod_mono issue, I've decided to resort to an ugly hack. Yes, you guessed it: automatically restarting the server if the blog goes down.

There are native Linux solutions to this very problem. System Integrity Monitor is one of them, but I was unable to make it work for my mod_mono driven virtual host, so I decided to roll my own solution.

The idea here is to periodically poll the blog and determine whether there are any HTTP errors returned. If an error is returned, we simply restart apache and send an email off to ourselves notifying us of the action.

There are native Linux commands that could be compiled into a bash script to do all of this. But since I'm a windows programmer, it's way easier writing a simple .NET console application to do the work. In my implementation, I only need to know if the blog returns anything other than the requested page and a 200 response code. More...


I am a software developer / architect currently interested in combining .NET technologies with open-source operating systems. 

I am a member of the open-source BlogEngine.NET development team and focus mainly on ensuring Mono compatibility for the project.

twitter

BlogEngine.NET


At StayUnlimited Cape Town accommodation we help you choose from and book guest houses, self catering apartments, bed & breakfasts, luxury villas and hotel accommodation.