Apache running root-owner scripts

I have been toying with this problem for a while. I need to be able to have a PHP or Perl script, called from a web browser through Apache, to be able to execute some commands on the server which are owned by root (i.e. shutdown).

Apache will not run as root, so I cannot solve it by running the server as root, which would solve the problem, but would cause an inherently dangerous situation with other parts of the site.

suExec will not allow scripts owned by root to be run, nor for scripts to be run with root privleges.

My only thought as to how to do it would be to open an SSH connection to the server, and execute the commands that way, but that seems silly, and would have a rather high overhead for the commands that need to be run.

I know this is potentially dangerous, but I can secure it once I figure out _how_ to do it in the first place... Apache running root-owner scripts

Thanks in advance!

J.

 

 

 

 

Top