LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Running Apache as root user on an embedded distribution (https://www.linuxquestions.org/questions/linux-general-1/running-apache-as-root-user-on-an-embedded-distribution-482317/)

sharad 09-11-2006 02:16 AM

Running Apache as root user on an embedded distribution
 
Hi all,

I have compiled Apache-1.3.33 and mod_ssl-2.8.22 and I am running it on my own embedded distribution. Initially I configured it with User "#0" and Group "#0" for root, but it didn't work. Then I configured it for another user with User "#500" and Group "#500" in httpd.conf file and the listening ports were 8080 & 8443. With this configuration it works.
But some webpages are not accessible as I have to run apache as root for that purpose.

Please tell me the way to run apache as root. because any other way is not of use for me.

Thank you,
Sharad

zhangmaike 09-11-2006 03:01 AM

Running apache as root is a Bad Idea.

Here's the error that pops up when I attempt to do so:
Code:

Error:  Apache has not been designed to serve pages while
        running as root.  There are known race conditions that
        will allow any local user to read any file on the system.
        If you still desire to serve pages as root then
        add -DBIG_SECURITY_HOLE to the EXTRA_CFLAGS line in your
        src/Configuration file and rebuild the server.  It is
        strongly suggested that you instead modify the User
        directive in your httpd.conf file to list a non-root
        user.

If you are having permissions problems, running the affected program as root is the wrong way of solving them. Change the permissions of the files/directories as necessary, or add the user that apache runs as to a group with rights to those files/directories (NOT the root group). If apache runs as the nobody user (it does on my system), you'll probably want to create a special apache group and user, and then change the ownership of those files as necessary.


All times are GMT -5. The time now is 05:52 AM.