2

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
Shane Madden
  • 114,520
  • 13
  • 181
  • 251
Jeremy Ross
  • 123
  • 4

1 Answers1

4

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.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251