Phine Solutions web work notes

Utilize multiple hosting accounts

Filed under: server setup — 1.618 @ 11:00 pm

I have several hosting accounts ranging from shared hosting to VPS. Besides their hosting duties, I also assigned them some additional tasks.

Install cron jobs on a shared hosting account to ping the other servers for uptime. A simple PHP script like this can do the job:

<?php

$url = "http://www.domain.com";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_HEADER, 0);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_exec($ch);

if (curl_errno($ch) != 0) {

  $subject = "Site is down";

  $message = "Site is down at " . date("Y-m-d H:i:s");

  mail("webmaster@domain.com", $subject, $message);

  echo date("Y-m-d H:i:s") . " $url is down \n";

} else {

  echo date("Y-m-d H:i:s") . " $url is up \n";

}


curl_close($ch);

?>

Also, there are several sites that offer free domain monitoring like:

SiteUptime Website Monitoring

Montasitic 

Both of them are pretty solid based on my experience. SiteUptime also offers pinging from west coast server or east coast server. With the combination of the free service and your own monitoring, you can get a decent idea about the stability of the domain you are trying to keep an eye on.

 

Use one account for CVS code repository.

CVS is developer's friend to maintain code.

On server side, to create a CVS repository we can run this command:

cvs init -d ~HOME/project_cvs

On client side, there is a pretty nice tool we can use for CVS utility: Tortoise CVS.

 

Most shared hosting services are loaded utilities; with a little additional SSH can be available too. So why not use them.

1 Comment »

  1. Also try http://mon.itor.us - very powerful monitoring service, also track visits in addition to uptime and performance

    Comment by Avoyan — January 19, 2007 @ 2:08 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

©phinesolutions.com