Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have apache httpd 2.2 running as user 'apache'. However, any files it creates are owned by 'nobody'. Also, it can only access things that are accessible by user 'nobody'. It sure seems like apache is running as 'nobody', but the config and ps output below indicate otherwise. What's going on?

From httpd.conf:

User apache
Group apache

apache processes:

# ps aux | grep http
root       380  0.0  0.0  61216   744 pts/0    S+   16:24   0:00 grep http
root     22077  0.0  0.2 266644  8292 ?        Ss   10:22   0:00 /usr/sbin/httpd -k start
apache   22099  0.0  0.1 266776  5980 ?        S    10:22   0:00 /usr/sbin/httpd -k start
apache   22100  0.0  0.1 267048  6172 ?        S    10:22   0:00 /usr/sbin/httpd -k start
apache   22101  0.0  0.1 266776  5972 ?        S    10:22   0:00 /usr/sbin/httpd -k start
apache   22102  0.0  0.1 266912  6028 ?        S    10:22   0:00 /usr/sbin/httpd -k start
apache   22103  0.0  0.1 266776  5964 ?        S    10:22   0:00 /usr/sbin/httpd -k start
apache   22104  0.0  0.1 266776  5976 ?        S    10:22   0:00 /usr/sbin/httpd -k start
apache   22105  0.0  0.1 266908  6040 ?        S    10:22   0:00 /usr/sbin/httpd -k start
apache   22106  0.0  0.1 266776  5960 ?        S    10:22   0:00 /usr/sbin/httpd -k start
apache   23153  0.0  0.1 266776  5976 ?        S    11:01   0:00 /usr/sbin/httpd -k start
apache   23498  0.0  0.1 266912  6104 ?        S    11:13   0:00 /usr/sbin/httpd -k start
apache   25717  0.0  0.1 266776  5940 ?        S    12:40   0:00 /usr/sbin/httpd -k start
share|improve this question
    
Are the files in fact created by apache or something else, e.g. from a process running with suexec? –  SvW May 22 '12 at 21:35
    
It's a RoR app called Redmine that creates the files. Using passenger for mod_rack. Does that help? –  Jeremy Ross May 22 '12 at 21:55
    
Sorry, I know nearly nothing about RoR. –  SvW May 22 '12 at 22:05

1 Answer 1

up vote 3 down vote accepted

This is intended behavior in Passenger.

See here:

A Rails application is started as the owner of the file config/environment.rb, and a Rack application is started as the owner of the file config.ru. So if /home/webapps/foo/config/environment.rb is owned by joe, then Phusion Passenger will launch the corresponding Rails application as joe as well.

To stop this behavior and have the apache stick, set PassengerUserSwitching off.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.