RE: [PHP] Is it possible to restart Windows Apache (service) on a PHP script?
| From: | Daevid Vincent | Date: | Mon, 22 Oct 2007 20:31:22 +0000 |
| Subject: | RE: [PHP] Is it possible to restart Windows Apache (service) on a PHP script? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263520@lists.php.net to get a copy of this message | ||
DOH!. I'm sorry I didn't read the fact that this was on Windows. My bad...
Um. Out of curiosity, why would you run LAMP as WAMP? It just seems so
wrong. Not to start an OS religion war, I use XP all day long, but I would
never use it as my dedicated web server -- that's why God invented
Unix/Linux. Best tool for the job and all that stuff... You're just asking
for all kinds of headaches and limitations (such as the one you're
encountering now) by using the back of a screwdriver to hammer a nail
IYKWIM. You'll poke your eye out! :)
> -----Original Message-----
> From: Daevid Vincent [mailto:daevid@daevid.com]
> Sent: Monday, October 22, 2007 1:26 PM
> To: php-general@lists.php.net
> Subject: RE: [PHP] Is it possible to restart Windows Apache
> (service) on a PHP script?
>
> What we do is setup 'sudo' to run certain commands (or a
> shell/ruby script
> for example), then have PHP/Apache exec() the script via sudo
> (or use a DBUS
> call to a 'root' enabled ruby daemon), which then restarts apache or
> whatever we want.
>
> Be VERY careful with the way you do this or you can give
> crackers all kinds
> of ways to cause you pain.
>
>
> For example:
>
> root@daevid111:/etc# cat /etc/sudoers
> Cmnd_Alias CHMOD = /bin/chmod
> Cmnd_Alias REBOOT = /sbin/reboot, /sbin/shutdown
>
> root ALL=(ALL) ALL
> www-data ALL=NOPASSWD: /bin/date, /sbin/hwclock,
> REBOOT, /usr/bin/dpkg,
> /usr/sbin/chpasswd,
> /usr/bin/passwd, /usr/sbin/srvwatch,
> /usr/sbin/srvtalk
>
> Then in the PHP web page:
>
> exec("/usr/bin/sudo /sbin/reboot");
>
>
> D.Vin
>
> "Voice or no voice, the people can alway be brought to the
> bidding of the
> leaders. This is easy. All you have to do is tell them that
> they are being
> attacked, and denounce the pacifists for a lack of patriotism
> and exposing
> the country to danger. It works the same in every country." --Hermann
> Goering, Hitler's Reich Marshall at the Nuremberg Trials After WWII
>
> Sound like G.W.Bush?
>
>
>