[Gllug] Perl Question

Jason Clifford jason at ukpost.com
Mon Mar 10 15:28:36 UTC 2003


On Mon, 10 Mar 2003, Robert Wood wrote:

>         I have written a Perl script that adds a virtual host to the
> end of my httpd.conf file from input i give it on a form, and now i
> need the script to run apachectl after its done it, but since this is
> a root command, how can i get the script to run it?

You can use sudo to call it from your script.

This does introduce a security risk however so make sure you have 
sanitised your environment first and that nobody else can execute 
scripts/CGI on the server as that user.

Jason Clifford
-- 
UKFSN.ORG		Finance Free Software while you surf the 'net
http://www.ukfsn.org/		Get the T-Shirt Now


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list