As root, run 'visudo' and add something similar to these lines:
Code:
Cmnd_Alias APACHECMDS = /path/to/command/for/apache/user/to/run
apacheusername ALL = APACHECMDS NOPASSWD
If you need to allow it to run multiple commands, add a backslash to the Cmnd_Alias line like this:
Code:
Cmnd_Alias APACHECMDS = /path/to/command/for/apache/user/to/run \
/path/to/second/command/for/apache/to/run
You can keep adding back slashes and more commands for as long as you like