The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Apache won't start - httpd configtest won't run as root??

Discussion in 'EasyApache' started by linearfusion, Oct 4, 2006.

  1. linearfusion

    linearfusion Member

    Joined:
    Aug 31, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I am having a problem getting apache to start... when I try to run httpd configtest, it says that I can't because I am basically logged in as root... another thing - when I check the /etc/httpd/logs/error_log, it says that apache has not been designed to serve pages while running as root???

    I appreciate any help!
     
  2. designeru

    designeru Well-Known Member

    Joined:
    Nov 2, 2005
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Hint!

    Try:
    # /usr/local/apache/bin/httpd -c /usr/local/apache/conf/httpd.conf

    and let us know the errors.

    Anyway, the basic fix will be /scripts/easyapache or WHM -> Apache update.
     
  3. linearfusion

    linearfusion Member

    Joined:
    Aug 31, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    From the console it gives this error:

    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.

    From the rebuild in WHM, it says:

    httpd has failed, please contact the sysadmin.
    ./build install
    Executing /scripts/postbuildapache (if exists)...Done
    /etc/rc.d/init.d/httpd start: httpd could not be started
    initfpsuexec: using apache 1.x support

    Attempting to restart httpd

    Waiting for httpd to restart....
    .
    .
    .
    .
    .
    .
    .
    .
    .
    .
    finished.




    httpd status




    httpd has failed, please contact the sysadmin.
     
  4. jester.ro

    jester.ro Well-Known Member
    PartnerNOC

    Joined:
    Feb 6, 2004
    Messages:
    304
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bucharest, Romania
    cPanel Access Level:
    DataCenter Provider
    look in /etc/httpd/conf/httpd.conf

    and search for these

    User nobody
    Group nobody


    I think yours are

    User root
    Group root

    Running apache as root is a BIG mistake.
    If you find User root in httpd.conf change it to nobody and the broup too. And then restart httpd.
     
  5. linearfusion

    linearfusion Member

    Joined:
    Aug 31, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    They actually say:
    User nobody
    Group nodody
     
  6. designeru

    designeru Well-Known Member

    Joined:
    Nov 2, 2005
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Hint!

    search in httpd.conf a directive named:

    "User root"

    This can be added at a user (VHosts) too ;). Modify it so the root user won't appear in the httpd.conf file.
     
  7. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    You might want to check on gid/uid of root. Using your favorite editor,
    pico /etc/passwd
    and make sure that this directive is there:
    root:x:0:0:root

    In /etc/group, it should be
    root:x:0:root

    No other entry in both files should have gid/uid of root (0).
     
  8. linearfusion

    linearfusion Member

    Joined:
    Aug 31, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    I ended up getting cPanel support on the problem. Thanks to all who helped! Ends up, one of our other accounts was given 'root' access... I appreciate all of the suggestions!
     
Loading...

Share This Page