LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   "apache" user in cgi-bin scripts (https://www.linuxquestions.org/questions/linux-server-73/apache-user-in-cgi-bin-scripts-661848/)

cool47 08-10-2008 05:06 PM

"apache" user in cgi-bin scripts
 
hi,

In my rhel5 machine, when i execute just command "whoami" as a root in web server it showing that output is "apache". why?
eg:
#lynx www.example.com/cgi-bin/test.sh
vi test.sh
#! /bin/bash
whoami
set
env
(everything of apache)
but the user and group of test.sh is root.

so when i use the find command

#find / -type f -group apache
only file in /usr/sbin/suexec

why like this?. Actually i want the o/p as root .

thanks in advance.

Mr. C. 08-10-2008 05:10 PM

Apache runs as a non-privileged user/group; the user/group is configurable, but should not be root for security reasons.

What reason makes you believe you need apache to run as root?

cool47 08-10-2008 05:19 PM

thanks for your comments. No reason for that. Just for curiosity how do i run as a root ?

Mr. C. 08-10-2008 05:27 PM

In httpd.conf:

# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User www
Group www


All times are GMT -5. The time now is 12:51 PM.