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

linearfusion

Member
Aug 31, 2006
9
0
151
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!
 

designeru

Well-Known Member
Nov 2, 2005
83
0
156
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.
 

linearfusion

Member
Aug 31, 2006
9
0
151
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.
 

jester.ro

Well-Known Member
PartnerNOC
Feb 6, 2004
304
0
166
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.
 

designeru

Well-Known Member
Nov 2, 2005
83
0
156
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.
 

AndyReed

Well-Known Member
PartnerNOC
May 29, 2004
2,221
4
193
Minneapolis, MN
linearfusion said:
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???
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).
 

linearfusion

Member
Aug 31, 2006
9
0
151
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!