Announcement

Collapse
No announcement yet.

[solved]Is it possible to run apache as root?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [solved]Is it possible to run apache as root?

    EDIT:
    Code:
    we found out that apache is not the only choice for httpd, and now use monkey httpd. Thanks for trying to help
    old message:

    Hello everyone, need help again.

    Introduction to the problem (you can skip reading this)
    Code:
    Me and my team are doing a project for our studies in the univercity that involves booting a linux based os from a USB, that runs a number of virtual machines (using VirtualBox) and does some computations inside the virtual machine. The interface beetween virtual machines and the host is done through a web page(php)
    The exact problem
    Code:
    As our deadline is only a week away, we started connecting the parts and noticed this: only root is able to run virtual machines via the command line. We tried creating a new user that apache would run on, added all the groups root had, but it is no use.
    So I figure we need to run apache as root so it could use bash to run Virtual macines via php. I think this might need to recompile the apache, but I was hoping for an easier solution. Any ideas?
    Join the dark side<br />---------------------------------------------------------------------<br />Samsung NC10 netbook running<br />PCLinuxOS 2010 // Win XP

    #2
    Re: Is it possible to run apache as root?

    Is it possible, yes - is it advisable? No.

    I understand this is happening in a classroom environment but you never run apache as root. If you run apache as root then any web exploit would also have root access. I'm not bright enough to teach the class but I'd be hesitant to give credit to anybody who used this solution. I think it might be wise to find a better way.

    we see things not as they are, but as we are.
    -- anais nin

    Comment


      #3
      Re: Is it possible to run apache as root?

      Originally posted by wizard10000
      Is it possible, yes - is it advisable? No.

      I understand this is happening in a classroom environment but you never run apache as root. If you run apache as root then any web exploit would also have root access. I'm not bright enough to teach the class but I'd be hesitant to give credit to anybody who used this solution. I think it might be wise to find a better way.

      With 5 days remaining it's do something or fail. BTW, the project has no access to the internet
      Also the system boots from an USB flash drive, so I don't imagine any kind of exploit being more dangerous than being used by some idiot (however both situations are unlikely).

      Of course it WON'T be used by no one except our dev team while creating the project, and once by the person who gave us the task.

      so, do you know how to run apache as root or not?
      Join the dark side<br />---------------------------------------------------------------------<br />Samsung NC10 netbook running<br />PCLinuxOS 2010 // Win XP

      Comment


        #4
        Re: Is it possible to run apache as root?

        Originally posted by Gediminas2
        so, do you know how to run apache as root or not?
        Why, yes - yes, I do

        First you edit httpd.conf to specify that apache will run as root then start it by calling apachectl in an .rc3.d script. You should be able to just put a symlink to apachectl in /etc/rc3.d but you might want to look at apachectl first. I'm on a windows machine right now but that should work.

        apache's documentation also shows you how.

        http://httpd.apache.org/docs/2.0/invoking.html
        we see things not as they are, but as we are.
        -- anais nin

        Comment


          #5
          Re: Is it possible to run apache as root?

          Originally posted by wizard10000
          Originally posted by Gediminas2
          so, do you know how to run apache as root or not?
          Why, yes - yes, I do

          First you edit httpd.conf to specify that apache will run as root then start it by calling apachectl in an .rc3.d script. You should be able to just put a symlink to apachectl in /etc/rc3.d but you might want to look at apachectl first. I'm on a windows machine right now but that should work.

          apache's documentation also shows you how.

          http://httpd.apache.org/docs/2.0/invoking.html
          I tried changing the httpd.conf to run as root before writing to this forum. If that had worked I wouldn't have started this topic
          Code:
          Syntax error on line 128 of /etc/httpd/httpd.conf:
          Error:\tApache has not been designed to serve pages while\n\trunning as root. There are known race conditions that\n\twill allow any local user to read any file on the system.\n\tIf you still desire to serve pages as root then\n\tadd -DBIG_SECURITY_HOLE to the CFLAGS env variable\n\tand then rebuild the server.\n\tIt is strongly suggested that you instead modify the User\n\tdirective in your httpd.conf file to list a non-root\n\tuser.\n
          So this means no way other than recompiling? Any other ideas?
          Join the dark side<br />---------------------------------------------------------------------<br />Samsung NC10 netbook running<br />PCLinuxOS 2010 // Win XP

          Comment


            #6
            Re: Is it possible to run apache as root?

            What about granting a non-root user permission to launch VMs?
            we see things not as they are, but as we are.
            -- anais nin

            Comment

            Working...
            X