Phusion Passenger users guideメモ2

Phusion Passenger users guideメモ - うんたらかんたらRuby - Rubyistの続き


5.2. PassengerLogLevel

0: Show only errors and warnings.(デフォルト)
1: Show the most important debugging information. This might be useful for system administrators who are trying to figure out the cause of a problem.
2: Show more debugging information. This is typically only useful for developers.
3: Show even more debugging information.


5.6. PassengerUserSwitching

Whether to enable user switching support.
This option may only occur once, in the global server configuration. The default value is on.

5.7. PassengerDefaultUser

Passenger enables user switching support by default. This configuration option allows one to specify which user Rails/Rack applications must run as, if user switching fails or is disabled.
This option may only occur once, in the global server configuration. The default value is nobody.

8.1. User switching (security)

A Rails application is started as the owner of the file config/environment.rb.
This behavior is the default, and you don’t need to configure anything. But there are things that you should keep in mind:

・The owner of environment.rb must have read access to the Rails application’s folder, and read/write access to the Rails application’s logs folder.

6.3.6. The Rails application reports that it’s unable to start because of a permission error

Please check whether your Rails application’s folder has the correct permissions. By default, Rails applications are started as the owner of the file config/environment.rb, except if the file is owned by root. If the file is owned by root, then the Rails application will be started as nobody (or as the user specify by RailsDefaultUser, if that’s specified).


PassengerUserSwitching がdefaultでONになっているので
PassengerUserSwitching をOFFにした上でRailsDefaultUserを定義する。


default(environment.rbのowner rochefort)

$ ps aux | grep Rails
rochefort  41944   0.0  1.0   646644  41560   ??  S     4:31PM   0:01.32 Rails: /webapp/rails/redmine 

default(environment.rbのowner hoge)

$ ps aux | grep Rails
hoge   51242   0.0  0.6   645120  26112   ??  S     5:07PM   0:00.17 Rails: /webapp/rails/redmine

PassengerUserSwitching OFF

$ ps aux | grep Rails
nobody   49242   0.0  0.6   645120  26344   ??  S     5:00PM   0:00.16 Rails: /webapp/rails/redmine 


PassengerUserSwitching OFF かつ RailsDefaultUser hoge

$ ps aux | grep Rails
hoge   50130   0.0  0.6   645120  26140   ??  S     5:03PM   0:00.16 Rails: /webapp/rails/redmine 

ちゃんと見てなかったけど、Passenger ApplicationSpawnerも同一ユーザで実行している模様。


8.9. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments

おおお、static URI じゃなく relative URI って書いてるやん。。。
passengerのcss - うんたらかんたらRuby - Rubyist



5.12.1. PassengerMaxPoolSize
5.12.3. PassengerPoolIdleTime
5.12.4. PassengerMaxRequests


8.3. Capistrano recipe