Hi,
I have a ensim webppliance server with some sites on it and my primary site is made in PHP and I want to take it to the next level and allow it create sites automaticly on signup. I have downloaded SUDO and installed it, but I was just wondering if anyone has done something like this, or anyone who knows how to do this could help me out...i'm stuck...i can't figure out how to make anything work..

Thanks,
Dan

    Well, at the most basic, you have to add a profile for the owner of the web server process to /etc/sudoers.

    This opens up many security related problems though so make sure you read up on the subject before opening up your server too much.

    Once you've got sudoers configured, you'll be able to issue shell commands as root from within your php apps through back-ticks, exec and etc. ie.

    sudo <command>

      a month later

      I have read up all about sudo and understand how I want to set it up and how I am going to use it but I am stuck on one thing: how can i access it through a PHP script? First off, i have made a php script and executed it through PHP's CLI and it read like this:

      <?php $query =  "sudo -l"; 
      $results = shell_exec($query); 
      echo $results; ?>

      and when I executed that it gave me a bunch of info about the use i executed from. Now when i tried the same thing from a script through apache, liek the url www.fast-build.com/test.php it didn't do anything. And also, how can i enter my SUDO password through a call to SUDO. Any help would be greatly apricated. Thanks.

        Write a Reply...