Beaglebone webserver monitoring. Please help!

Hello I just received my beaglebone yesterday. Does anyone know of there is a way to run a script once someone has accessed a page on the boards server? By the way I am trying to make a web enables coffee machine.

CGI scripts and php are exactly for this.