httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] Run Scripts As root
Date Fri, 15 Nov 2002 04:12:56 GMT
By the way, I hate to help you do something that is, in general, a bad
idea for someone who isn't very familiar with unix, but using PHP is
surely overkill if all you want to do is HUP named.

First, create a simple script (hupnamed.sh):
#!/bin/sh
killall -HUP named

Then grab sudo and configure it very carefully so that it will allow the
httpd user to run ONLY that single script as root.  Then create a very
basic CGI script:

#!/bin/sh
echo Content-Type: text/plain
echo
echo "Running the script"
sudo hupnamed.sh

Please don't take this as a recommendation of this technique, but it is
probably safer than anything you could do with php.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message