in reply to Trapping apache start stop

The Apache (re)starting can be very easy - put the
<Perl> #your code </Perl>
section into your httpd.conf, or use PerlPostConfigHandler. The Apache stopping - I have no clear idea.