[Gllug] Perl Question

Simon Wilcox essuu at ourshack.com
Mon Mar 10 16:08:37 UTC 2003


On Mon, 2003-03-10 at 15:23, Robert Wood wrote:
> Hiya,
> 
>         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?
> 
> Any pointers will be greatly appreciated

Run a shell script from cron as a different user that looks for a newer
httpd.conf than some reference file, run apachectl (using sudo probably)
and then touch the reference file.

Then your apache user never has an opportunity to run privileged
commands.

Simon.

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




More information about the GLLUG mailing list