How can I setup my apache2 (on Ubuntu 12.04) so that a shell script can easily determine how long the web server was idle? By "idle", I mean "has not served any requests". As this is an internal development server and not a public website, this is very likely to occur in the evenings.
I thought of querying the modification date of the access log, but I don't want to fill the disk with (otherwise unnecessary) logging if I don't have to. Is there another, more elegant way?
Background: This is an Amazon EC2 machine for which I'm paying by the hour, so I want to keep it running only while it is actively used. Note that I already have taken care of scheduling automatic machine startup and an "emergency" button to have it start "right now".