in reply to restart apache web server from CGI script

Hi
This might be a little long winded but safer then running the script as root.

Why don't you perfom some kind of request in your CGI which creates a text file somewhere in f.e. /tmp if a certain condition returns true. Then you let root or Administrator run a task every minute to check if this file exists. If so, root / Administrator can restart you Apache Server.

You also might want to include " if ($^O eq Win32) {...} elsif ($^O eq Linux) {...}

Marcel

  • Comment on Re: restart apache web server from CGI script

Replies are listed 'Best First'.
Re^2: restart apache web server from CGI script
by avo (Pilgrim) on Jan 04, 2006 at 18:59 UTC
    I was just thinking if one can't create an Apache module to control the service/daemon ? I know this is a funny way of doing it, but it will allow Apache to selfrestart upon request either via web or internaly calling a function... It's just a tought. I've been using Sudo in other scripts... on top of everything this is one user machine - ie the user is root, and the machine is running Intranet, which means - no Internet access is provided to the computer, which solves the security issues.