LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Unusual Apache issue on my server !!! (https://www.linuxquestions.org/questions/linux-server-73/unusual-apache-issue-on-my-server-4175454847/)

gadikota 03-20-2013 09:12 AM

Unusual Apache issue on my server !!!
 
Experts,

I have a custom application built(previous vendor built it and we took over it with no KT) using CGI and apache. looking at the conf file the apache was serving pages as root as the CGI invokes commands that need to be run as root.(I know this is a bad idea of running apache as root).

All we did is to reboot the server and now the site doesnt come up and httpd service is in "maintenance" state with error.

"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
[ Mar 20 09:53:17 Method "start" exited with status 1 ]"

Couple of questions:

1) would a reboot change any apache binaries that would cause this and need a rebuild of apache ?
2) Is there a easy fix that i can bring the application up by letting apache run as root?

I have been trying to get it working from last 2 days and no luck till now. Any help would be much appreciated.

Thanks in advance.

#root 03-20-2013 09:18 AM

what was the command???

Quote:

service httpd start
or

Quote:

service httpd restart

??????

gadikota 03-20-2013 09:23 AM

Thank you for your reply #root.

I have already done that. HTTPD was online before and after the reboot, it wont come out of maintenance mode. The error i get is that i cant run apache as root.

#root 03-20-2013 09:37 AM

oh yes you did
but i was saying that problem like this occur when you start the service which was already in the start state
for eg you say "service httpd start" while the service was already in the start state
so it is always recommended to use "service httpd restart"
that was the reason, i was asking that which one of the two command was used

gadikota 03-20-2013 09:54 AM

:)

Used

Code:

service httpd stop
and then

Code:

service httpd start
still the problem exists :).

TB0ne 03-20-2013 01:39 PM

Quote:

Originally Posted by gadikota (Post 4915207)
Experts,
I have a custom application built(previous vendor built it and we took over it with no KT) using CGI and apache. looking at the conf file the apache was serving pages as root as the CGI invokes commands that need to be run as root.(I know this is a bad idea of running apache as root). All we did is to reboot the server and now the site doesnt come up and httpd service is in "maintenance" state with error.
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 CFLAGS env variable
        and then 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.
[ Mar 20 09:53:17 Method "start" exited with status 1 ]"

Couple of questions:
1) would a reboot change any apache binaries that would cause this and need a rebuild of apache ?

No. However, if you just updated the server (you don't say anything about what preceded the failure, what changed, what you were doing, etc.), then the Apache binary may have been updated. By default, it's compiled to NOT run as root, ever. The message tells you this, that its a bad idea, and how to do it if you really want to.
Quote:

2) Is there a easy fix that i can bring the application up by letting apache run as root? I have been trying to get it working from last 2 days and no luck till now.
Are you starting Apache when you're logged in as root, or as a regular user? What version/distro of Linux are you using? Have you tried running "apachectl start"?


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