Running Fedora 9/10, Apache 2, PHP 5...
Can I run a shell script as root, from a PHP script using exec()?
Do I just give Apache root priveleges, and then add
You don't want to give Apache root.
There's another solution to your problem. The problem is that Apache cannot kill the process because it is owned by root. What you can do is change the owner to 'www-data' which is what Apache is identified as.
If the process is a service and starts up on boot you can add the
sudo -u www-data
so that www-data would be the owner of that process and hence running the shut-down script would work.