Configuring user switching with Apache

584 views
Skip to first unread message

marko

unread,
Apr 11, 2012, 3:02:44 PM4/11/12
to phusion-...@googlegroups.com
Hi,

I'm trying to configure user switching for the Phusion Passenger Apache module
and being a Rails newbie I'd like to check the configuration with some more experienced Passenger users.

Here're the relevant pieces of configuration:

# configured in "server config" context
User apache
# configured in "server config" context
PassengerUser app1
PassengerDefaultUser app1

config/environment.rb is owned by "app1" account.

This configuration results in the following processes being spawned:

root     15424     1  0 21:44 ?        00:00:00 /usr/sbin/httpd
root     15426 15424  0 21:44 ?        00:00:00 PassengerWatchdog
root     15429 15426  0 21:44 ?        00:00:00 PassengerHelperAgent
root     15431 15429  0 21:44 ?        00:00:00 Passenger spawn server                                                                                                                            
nobody   15434 15426  0 21:44 ?        00:00:00 PassengerLoggingAgent
...
apache   15447 15424  0 21:44 ?        00:00:00 /usr/sbin/httpd
apache   15448 15424  0 21:44 ?        00:00:00 /usr/sbin/httpd
app1 15467 15431  1 21:44 ?        00:00:00 Passenger ApplicationSpawner: /opt/myapproot                                                                                     
app1 15474     1  0 21:44 ?        00:00:00 Rails: /opt/myapproot                                                                                                            
app1 15482     1  0 21:44 ?        00:00:00 Rails: /opt/myapproot                 

Does this look normal?

The application appears to be working properly.
Application root in /opt/myapproot is owned by "app1" account and the log and temp files (session, cache etc.) are created with the proper account (app1).

I'm just wondering about some of the Passenger processes running as root and nobody.

Apache httpd is v2.2.15 and it's been installed from a package using RHEL 6 package management.
Passenger v3.0.11 has been compiled from source.

marko

Hongli Lai

unread,
Apr 12, 2012, 7:44:14 AM4/12/12
to phusion-...@googlegroups.com
Yes, this is working exactly as it should. Some Passenger processes are running as root so that they can create processes that run as app1. If your intention is to run *everything* as app1 then you must turn user switching off.

--
Phusion | Ruby & Rails deployment, scaling and tuning solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)
Reply all
Reply to author
Forward
0 new messages