Jump to content


Photo

Cron To Check That Domains Are Running


  • Please log in to reply
3 replies to this topic

#1 amssb

amssb

    New Member

  • Members
  • Pip
  • 1 posts

Posted 25 July 2009 - 08:59 AM

Hi,

I have a dedicated server (lamp & cpanel) under which I host different web domains:
www.domain1.com, www.domain2.com, www.domain3.com, www.domain4.com, ...

I'm upset because sometimes (rarely, though) I discovered (by opening www.domainX.com in the browser) that my domains did not work and I had to restart apache using my root privileges.

Do you have any idea how can I automatically check if such a situation occurs again? A cron job or something like that?

Thanks a lot for your time,
Sorin

#2 noahgift

noahgift

    New Member

  • Members
  • Pip
  • 5 posts

Posted 04 September 2010 - 06:35 PM

QUOTE (amssb @ Jul 25 2009, 12:59 PM) <{POST_SNAPBACK}>
Hi,

I have a dedicated server (lamp & cpanel) under which I host different web domains:
www.domain1.com, www.domain2.com, www.domain3.com, www.domain4.com, ...

I'm upset because sometimes (rarely, though) I discovered (by opening www.domainX.com in the browser) that my domains did not work and I had to restart apache using my root privileges.

Do you have any idea how can I automatically check if such a situation occurs again? A cron job or something like that?

Thanks a lot for your time,
Sorin



Sorin,

Sure, there are a bunch of different ways to do this. Here is one easy way off the top of my head. Write a functional test using webtest, or twill that "asserts" some unique property of your domains. You could then run a cron every 15 minutes, or hour, depending on how much you care if your site is down, and put logic inside that restarts apache if your functional test fails.

In sudo code it would look like this:

try:
functional_test()
except AssertionError:
print "True"






Here is a article I wrote that has some more information about functional testing:

http://www.ibm.com/d.../wa-aj-testing/







#3 kellylummus

kellylummus

    New Member

  • Members
  • Pip
  • 1 posts

Posted 12 October 2010 - 12:01 AM

I have a dedicated server (lamp & cpanel) under which I host different web domains: www.domain1.com, www.domain2.com, www.domain3.com, www.domain4.com, ...
I'm upset because sometimes (rarely, though) I discovered (by opening www.domain X.com in the browser) that my domains did not work and I had to restart Apache using my root privileges.


____________
VLC Download


#4 t onroed

t onroed

    New Member

  • Members
  • Pip
  • 1 posts
  • Gender:Male

Posted 17 May 2012 - 11:08 AM

Have you checked the error log to see if there are some problems? Or maybe there are problems with some module crashing. Check your config too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users