You are not going to arrange reliable self-detection. A machine can log "yep, I seem to be here" but it won't be able to log if it is off or completely hung as it will be, well, off or completely hung. Also you can check that your webserver is running locally, and would be able to log a network outage that affects everything the server can see (by requesting objects from the outside world with libcurl,or just sending out ping requests) but you'll not be able to detect a finer grained fault that stops apache being visible to the outside world.
There are many cheap monitoring services out there though and some, like pingdom, offer free accounts that you can monitor one service with. I would suggest you try something like that.
As per the discussion in the comments attached to your question, there are many tools that allow a machine to monitor its own status as well as (or instead of others). I use collectd (found in the Debian and Ubuntu standard repositories, and probably similarly easy to get hold of in other distros) to collect data on CPU load, I/O load, memory use and many other variables and a slightly modified version of this cgi script to draw graphs of the resulting datasets. Useful for monitoring oddities like the inexplicable CPUD load increase I seen VMWare VMs impose (which goes away once you reboot the VM, only to slowly climb back up again). There are a number of similar tools so you should be able to find one that operates close to how you want it too. collectd has many built-in plugins and you can write your own in C, perl or just a shell script if you need something that isn't there as standard.
I'd still recommend an external monitor too though, given several providers will monitor one server at a reasonable frequency for nothing.