passenger 4.0.5 → 4.0.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (162) hide show
  1. data.tar.gz.asc +7 -7
  2. data/.travis.yml +1 -2
  3. data/CONTRIBUTING.md +20 -5
  4. data/CONTRIBUTORS +67 -0
  5. data/LICENSE +1 -1
  6. data/NEWS +48 -0
  7. data/Rakefile +2 -2
  8. data/bin/passenger-config +18 -0
  9. data/bin/passenger-install-apache2-module +2 -0
  10. data/bin/passenger-install-nginx-module +11 -12
  11. data/bin/passenger-memory-stats +2 -0
  12. data/bin/passenger-status +152 -69
  13. data/build/agents.rb +1 -5
  14. data/build/basics.rb +26 -13
  15. data/build/cplusplus_support.rb +9 -0
  16. data/build/debian.rb +129 -0
  17. data/build/documentation.rb +6 -2
  18. data/build/integration_tests.rb +13 -2
  19. data/build/misc.rb +16 -0
  20. data/build/packaging.rb +67 -51
  21. data/build/preprocessor.rb +314 -0
  22. data/build/test_basics.rb +1 -0
  23. data/{debian → debian.template}/README.Debian +0 -0
  24. data/{debian → debian.template}/changelog +131 -0
  25. data/debian.template/compat +1 -0
  26. data/debian.template/control +71 -0
  27. data/debian.template/copyright +385 -0
  28. data/debian.template/libapache2-mod-passenger.install +3 -0
  29. data/{debian → debian.template}/libapache2-mod-passenger.postinst +0 -0
  30. data/{debian → debian.template}/libapache2-mod-passenger.prerm +0 -0
  31. data/debian.template/locations.ini +12 -0
  32. data/debian.template/passenger.conf +4 -0
  33. data/{debian → debian.template}/passenger.load +0 -0
  34. data/debian.template/patches/series +0 -0
  35. data/debian.template/repack.sh +42 -0
  36. data/debian.template/ruby-passenger-dev.install +3 -0
  37. data/debian.template/ruby-passenger-doc.install +2 -0
  38. data/debian.template/ruby-passenger.docs +4 -0
  39. data/debian.template/ruby-passenger.install +11 -0
  40. data/debian.template/ruby-passenger.manpages +4 -0
  41. data/debian.template/rules.template +35 -0
  42. data/debian.template/source/format +1 -0
  43. data/debian.template/watch +3 -0
  44. data/dev/run_travis.sh +46 -46
  45. data/doc/Architectural overview.html +2 -2
  46. data/doc/Packaging.html +27 -18
  47. data/doc/Packaging.txt.md +27 -18
  48. data/doc/Security of user switching support.html +2 -2
  49. data/doc/Users guide Apache.html +881 -95
  50. data/doc/Users guide Apache.idmap.txt +48 -6
  51. data/doc/Users guide Apache.txt +13 -1
  52. data/doc/Users guide Nginx.html +1063 -190
  53. data/doc/Users guide Nginx.idmap.txt +89 -45
  54. data/doc/Users guide Nginx.txt +45 -0
  55. data/doc/Users guide Standalone.html +7 -7
  56. data/doc/users_guide_snippets/alternative_for_flying_passenger.txt +1 -0
  57. data/doc/users_guide_snippets/environment_variables.txt +221 -0
  58. data/doc/users_guide_snippets/installation.txt +66 -17
  59. data/doc/users_guide_snippets/support_information.txt +3 -3
  60. data/doc/users_guide_snippets/tips.txt +352 -40
  61. data/ext/common/Account.h +4 -3
  62. data/ext/common/AccountsDatabase.h +6 -6
  63. data/ext/common/AgentsStarter.h +1 -13
  64. data/ext/common/ApplicationPool2/DirectSpawner.h +4 -4
  65. data/ext/common/ApplicationPool2/DummySpawner.h +1 -1
  66. data/ext/common/ApplicationPool2/Group.h +9 -4
  67. data/ext/common/ApplicationPool2/Implementation.cpp +6 -1
  68. data/ext/common/ApplicationPool2/Options.h +65 -37
  69. data/ext/common/ApplicationPool2/Pool.h +91 -41
  70. data/ext/common/ApplicationPool2/Process.h +6 -6
  71. data/ext/common/ApplicationPool2/SmartSpawner.h +14 -14
  72. data/ext/common/ApplicationPool2/Socket.h +1 -1
  73. data/ext/common/ApplicationPool2/Spawner.h +24 -16
  74. data/ext/common/ApplicationPool2/SpawnerFactory.h +9 -1
  75. data/ext/common/ApplicationPool2/SuperGroup.h +1 -1
  76. data/ext/common/Constants.h +1 -1
  77. data/ext/common/Logging.cpp +12 -7
  78. data/ext/common/MessageServer.h +7 -12
  79. data/ext/common/MultiLibeio.cpp +5 -5
  80. data/ext/common/ResourceLocator.h +2 -6
  81. data/ext/common/ServerInstanceDir.h +37 -10
  82. data/ext/common/UnionStation.h +10 -10
  83. data/ext/common/Utils.cpp +30 -4
  84. data/ext/common/Utils.h +7 -0
  85. data/ext/common/Utils/BlockingQueue.h +2 -2
  86. data/ext/common/Utils/Lock.h +2 -2
  87. data/ext/common/Utils/MessagePassing.h +2 -2
  88. data/ext/common/Utils/Timer.h +4 -4
  89. data/ext/common/agents/HelperAgent/AgentOptions.h +2 -0
  90. data/ext/common/agents/HelperAgent/Main.cpp +57 -16
  91. data/ext/common/agents/HelperAgent/RequestHandler.h +4 -1
  92. data/ext/common/agents/LoggingAgent/AdminController.h +91 -0
  93. data/ext/common/agents/LoggingAgent/LoggingServer.h +46 -29
  94. data/ext/common/agents/LoggingAgent/Main.cpp +43 -16
  95. data/ext/common/agents/LoggingAgent/RemoteSender.h +7 -7
  96. data/ext/common/agents/Watchdog/AgentWatcher.cpp +11 -11
  97. data/ext/common/agents/Watchdog/LoggingAgentWatcher.cpp +3 -1
  98. data/ext/common/agents/Watchdog/Main.cpp +62 -0
  99. data/ext/libeio/config.guess +206 -167
  100. data/ext/libeio/config.sub +142 -68
  101. data/ext/libev/config.guess +304 -290
  102. data/ext/libev/config.sub +198 -77
  103. data/ext/nginx/config +4 -0
  104. data/ext/nginx/ngx_http_passenger_module.c +1 -0
  105. data/ext/oxt/implementation.cpp +4 -4
  106. data/lib/phusion_passenger.rb +14 -5
  107. data/lib/phusion_passenger/abstract_installer.rb +41 -0
  108. data/lib/phusion_passenger/admin_tools/server_instance.rb +48 -39
  109. data/lib/phusion_passenger/message_client.rb +31 -7
  110. data/lib/phusion_passenger/native_support.rb +35 -12
  111. data/lib/phusion_passenger/packaging.rb +16 -2
  112. data/lib/phusion_passenger/platform_info/binary_compatibility.rb +6 -31
  113. data/lib/phusion_passenger/platform_info/operating_system.rb +1 -1
  114. data/lib/phusion_passenger/preloader_shared_helpers.rb +3 -1
  115. data/lib/phusion_passenger/request_handler.rb +1 -1
  116. data/lib/phusion_passenger/standalone/command.rb +6 -6
  117. data/lib/phusion_passenger/standalone/main.rb +23 -8
  118. data/lib/phusion_passenger/standalone/package_runtime_command.rb +9 -5
  119. data/lib/phusion_passenger/standalone/runtime_installer.rb +9 -10
  120. data/lib/phusion_passenger/standalone/start_command.rb +20 -4
  121. data/resources/templates/installer_common/freebsd9_broken_cxx_runtime.txt.erb +19 -0
  122. data/resources/templates/installer_common/low_amount_of_memory_warning.txt.erb +22 -0
  123. data/resources/templates/standalone/config.erb +3 -2
  124. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +4 -4
  125. data/test/cxx/ApplicationPool2/PoolTest.cpp +1 -1
  126. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +7 -7
  127. data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +9 -9
  128. data/test/cxx/EventedBufferedInputTest.cpp +17 -17
  129. data/test/cxx/RequestHandlerTest.cpp +5 -5
  130. data/test/cxx/ServerInstanceDirTest.cpp +3 -1
  131. data/test/cxx/TestSupport.h +4 -4
  132. data/test/cxx/UnionStationTest.cpp +3 -1
  133. data/test/cxx/UtilsTest.cpp +2 -0
  134. data/test/integration_tests/apache2_tests.rb +2 -2
  135. data/test/integration_tests/native_packaging_spec.rb +170 -0
  136. data/test/ruby/spec_helper.rb +0 -1
  137. data/test/stub/apache2/httpd.conf.erb +1 -1
  138. data/test/stub/nginx/nginx.conf.erb +1 -0
  139. data/test/support/apache2_controller.rb +1 -1
  140. data/test/support/placebo-preloader.rb +1 -1
  141. data/test/support/test_helper.rb +5 -2
  142. metadata +32 -26
  143. metadata.gz.asc +7 -7
  144. data/debian/compat +0 -1
  145. data/debian/control +0 -49
  146. data/debian/copyright +0 -20
  147. data/debian/libapache2-mod-passenger.install +0 -1
  148. data/debian/passenger-common.install +0 -4
  149. data/debian/passenger.conf +0 -4
  150. data/debian/prerm +0 -2
  151. data/debian/rules +0 -37
  152. data/debian/watch +0 -3
  153. data/dev/googlecode_upload.py +0 -265
  154. data/ext/common/agents/HelperAgent/BacktracesServer.h +0 -60
  155. data/resources/templates/nginx/not_available_when_natively_packaged.txt.erb +0 -8
  156. data/test/stub/rails3.1/app/assets/javascripts/application.js +0 -9
  157. data/test/stub/rails3.2/app/assets/javascripts/application.js +0 -15
  158. data/test/stub/rails_apps/2.3/mycook/public/javascripts/application.js +0 -2
  159. data/test/stub/rails_apps/2.3/mycook/public/javascripts/controls.js +0 -963
  160. data/test/stub/rails_apps/2.3/mycook/public/javascripts/dragdrop.js +0 -973
  161. data/test/stub/rails_apps/2.3/mycook/public/javascripts/effects.js +0 -1128
  162. data/test/stub/rails_apps/2.3/mycook/public/javascripts/prototype.js +0 -4320
@@ -56,7 +56,7 @@
56
56
 
57
57
  2.9.2. Adding additional compiler or linker flags => adding-additional-compiler-or-linker-flags-1jehjon
58
58
 
59
- 2.9.3. Forcing location of certain command line tools => forcing-location-of-certain-command-line-tools-1j93cki
59
+ 2.9.3. Forcing location of command line tools and dependencies => forcing-location-of-certain-command-line-tools-1j93cki
60
60
 
61
61
  2.10. Installing as a normal Nginx module without using the installer => installing-as-a-normal-nginx-module-without-using-the-installer-1kkpes5
62
62
 
@@ -130,89 +130,91 @@
130
130
 
131
131
  6.8. passenger_temp_dir <directory> => passenger-temp-dir-directory--1t3opri
132
132
 
133
- 6.9. Important deployment options => important-deployment-options-av567
133
+ 6.9. passenger_fly_with <socket filename> => passenger-fly-with-socket-filename--1amd1xn
134
134
 
135
- 6.9.1. passenger_enabled <on|off> => passenger-enabled-on-off--1rpb2t7
135
+ 6.10. Important deployment options => important-deployment-options-av567
136
136
 
137
- 6.9.2. passenger_base_uri <uri> => passenger-base-uri-uri--1xtuo50
137
+ 6.10.1. passenger_enabled <on|off> => passenger-enabled-on-off--1rpb2t7
138
138
 
139
- 6.10. Connection handling options => connection-handling-options-8jgq90
139
+ 6.10.2. passenger_base_uri <uri> => passenger-base-uri-uri--1xtuo50
140
140
 
141
- 6.10.1. passenger_ignore_client_abort <on|off> => passenger-ignore-client-abort
141
+ 6.11. Connection handling options => connection-handling-options-8jgq90
142
142
 
143
- 6.10.2. passenger_set_cgi_param <CGI environment name> <value> => passenger-set-cgi-param-cgi-environment-name-value--rx9gc0
143
+ 6.11.1. passenger_ignore_client_abort <on|off> => passenger-ignore-client-abort
144
144
 
145
- 6.10.3. passenger_pass_header <header name> => passenger-pass-header-header-name--1cg31je
145
+ 6.11.2. passenger_set_cgi_param <CGI environment name> <value> => passenger-set-cgi-param-cgi-environment-name-value--rx9gc0
146
146
 
147
- 6.10.4. passenger_buffer_response <on|off> => passenger-buffer-response
147
+ 6.11.3. passenger_pass_header <header name> => passenger-pass-header-header-name--1cg31je
148
148
 
149
- 6.10.5. passenger_buffer_size => passenger-buffer-size-1jfkq87
149
+ 6.11.4. passenger_buffer_response <on|off> => passenger-buffer-response
150
150
 
151
- 6.10.6. passenger_buffers => passenger-busy-buffers
151
+ 6.11.5. passenger_buffer_size => passenger-buffer-size-1jfkq87
152
152
 
153
- 6.10.7. passenger_busy_buffer_size => passenger-busy-buffer-size-124sj61
153
+ 6.11.6. passenger_buffers => passenger-busy-buffers
154
154
 
155
- 6.11. Security options => security-options-1bv93g4
155
+ 6.11.7. passenger_busy_buffer_size => passenger-busy-buffer-size-124sj61
156
156
 
157
- 6.11.1. passenger_user_switching <on|off> => passenger-user-switching-on-off--1p37u3l
157
+ 6.12. Security options => security-options-1bv93g4
158
158
 
159
- 6.11.2. passenger_user <username> => passenger-user-username--b06ur7
159
+ 6.12.1. passenger_user_switching <on|off> => passenger-user-switching-on-off--1p37u3l
160
160
 
161
- 6.11.3. passenger_group <group name> => passenger-user-group-name--1fco4j7
161
+ 6.12.2. passenger_user <username> => passenger-user-username--b06ur7
162
162
 
163
- 6.11.4. passenger_default_user <username> => passenger-default-user-username--1h6cdmf
163
+ 6.12.3. passenger_group <group name> => passenger-user-group-name--1fco4j7
164
164
 
165
- 6.11.5. Passenger_default_group <group name> => passenger-default-group-group-name--1qxn2qa
165
+ 6.12.4. passenger_default_user <username> => passenger-default-user-username--1h6cdmf
166
166
 
167
- 6.11.6. passenger_show_version_in_header <on|off> => passenger-show-version-in-header-on-off--2h49av
167
+ 6.12.5. Passenger_default_group <group name> => passenger-default-group-group-name--1qxn2qa
168
168
 
169
- 6.11.7. passenger_friendly_error_pages <on|off> => passenger-friendly-error-pages-on-off--1ti1a0e
169
+ 6.12.6. passenger_show_version_in_header <on|off> => passenger-show-version-in-header-on-off--2h49av
170
170
 
171
- 6.12. Resource control and optimization options => resource-control-and-optimization-options-xd7evs
171
+ 6.12.7. passenger_friendly_error_pages <on|off> => passenger-friendly-error-pages-on-off--1ti1a0e
172
172
 
173
- 6.12.1. passenger_max_pool_size <integer> => passenger-max-pool-size-integer--3jzefs
173
+ 6.13. Resource control and optimization options => resource-control-and-optimization-options-xd7evs
174
174
 
175
- 6.12.2. passenger_min_instances <integer> => passenger-min-instances-integer--uclykt
175
+ 6.13.1. passenger_max_pool_size <integer> => passenger-max-pool-size-integer--3jzefs
176
176
 
177
- 6.12.3. passenger_max_instances <integer> => passenger-max-instances
177
+ 6.13.2. passenger_min_instances <integer> => passenger-min-instances-integer--uclykt
178
178
 
179
- 6.12.4. passenger_max_instances_per_app <integer> => passenger-max-instances-per-app-integer--1xhbbne
179
+ 6.13.3. passenger_max_instances <integer> => passenger-max-instances
180
180
 
181
- 6.12.5. passenger_pool_idle_time <integer> => passenger-pool-idle-time-integer--xcw65o
181
+ 6.13.4. passenger_max_instances_per_app <integer> => passenger-max-instances-per-app-integer--1xhbbne
182
182
 
183
- 6.12.6. passenger_max_preloader_idle_time <integer> => rails-app-spawner-idle-time-integer--1xjqe4b
183
+ 6.13.5. passenger_pool_idle_time <integer> => passenger-pool-idle-time-integer--xcw65o
184
184
 
185
- 6.12.7. passenger_concurrency_model <process|thread> => passenger-concurrency-model-process-thread--brcvkk
185
+ 6.13.6. passenger_max_preloader_idle_time <integer> => rails-app-spawner-idle-time-integer--1xjqe4b
186
186
 
187
- 6.12.8. passenger_thread_count <number> => passenger-thread-count-number--1kd6ffy
187
+ 6.13.7. passenger_concurrency_model <process|thread> => passenger-concurrency-model-process-thread--brcvkk
188
188
 
189
- 6.12.9. passenger_max_requests <integer> => passenger-max-requests-integer--sgzint
189
+ 6.13.8. passenger_thread_count <number> => passenger-thread-count-number--1kd6ffy
190
190
 
191
- 6.12.10. passenger_max_request_time <seconds> => passenger-max-request-time-seconds--1htog2g
191
+ 6.13.9. passenger_max_requests <integer> => passenger-max-requests-integer--sgzint
192
192
 
193
- 6.12.11. passenger_memory_limit <integer> => passenger-memory-limit-integer--1ry7dwx
193
+ 6.13.10. passenger_max_request_time <seconds> => passenger-max-request-time-seconds--1htog2g
194
194
 
195
- 6.12.12. passenger_pre_start <url> => passenger-pre-start-url--npldeb
195
+ 6.13.11. passenger_memory_limit <integer> => passenger-memory-limit-integer--1ry7dwx
196
196
 
197
- 6.13. Logging and debugging options => logging-and-debugging-options-14e91ni
197
+ 6.13.12. passenger_pre_start <url> => passenger-pre-start-url--npldeb
198
198
 
199
- 6.13.1. passenger_log_level <integer> => passenger-log-level-integer--17snhon
199
+ 6.14. Logging and debugging options => logging-and-debugging-options-14e91ni
200
200
 
201
- 6.13.2. passenger_debug_log_file <filename> => passenger-debug-log-file-filename--21ubaj
201
+ 6.14.1. passenger_log_level <integer> => passenger-log-level-integer--17snhon
202
202
 
203
- 6.13.3. passenger_debugger <on|off> => passenger-debugger-on-off--1wkuq85
203
+ 6.14.2. passenger_debug_log_file <filename> => passenger-debug-log-file-filename--21ubaj
204
204
 
205
- 6.14. Ruby on Rails-specific options => ruby-on-rails-specific-options-12vfokt
205
+ 6.14.3. passenger_debugger <on|off> => passenger-debugger-on-off--1wkuq85
206
206
 
207
- 6.14.1. rails_env <string> => rails-env-string--jlh7v9
207
+ 6.15. Ruby on Rails-specific options => ruby-on-rails-specific-options-12vfokt
208
208
 
209
- 6.15. Rack and Rails >= 3 specific options => rack-specific-options-13yvdxs
209
+ 6.15.1. rails_env <string> => rails-env-string--jlh7v9
210
210
 
211
- 6.15.1. rack_env <string> => rack-env-string--tqmrt0
211
+ 6.16. Rack and Rails >= 3 specific options => rack-specific-options-13yvdxs
212
212
 
213
- 6.16. Deprecated options => deprecated-options-1dtzo0g
213
+ 6.16.1. rack_env <string> => rack-env-string--tqmrt0
214
214
 
215
- 6.16.1. rails_spawn_method => rails-spawn-method-17vdnpt
215
+ 6.17. Deprecated options => deprecated-options-1dtzo0g
216
+
217
+ 6.17.1. rails_spawn_method => rails-spawn-method-17vdnpt
216
218
 
217
219
  7. Analysis and system maintenance => analysis-and-system-maintenance-1nnlnj8
218
220
 
@@ -228,14 +230,24 @@
228
230
 
229
231
  8. Tips => tips-n4c22d
230
232
 
231
- 8.1. User switching (security) => user-switching-security--zmsy9o
233
+ 8.1. User Switching (security feature) => user-switching-security--zmsy9o
234
+
235
+ 8.1.1. Requirements => requirements-15ozqdj
236
+
237
+ 8.1.2. Effects => effects-nd2m44
232
238
 
233
- 8.2. Reducing memory consumption of Ruby on Rails applications by 33% => reducing-memory-consumption-of-ruby-on-rails-applications-by-33--1o3z66q
239
+ 8.1.3. Caveats & troubleshooting => caveats-troubleshooting-mbw582
240
+
241
+ 8.1.4. Finding out what user an application is running as => finding-out-what-user-an-application-is-running-as-1ni7zk6
242
+
243
+ 8.2. Copy-on-write memory support (reducing memory consumption of Ruby applications) => reducing-memory-consumption-of-ruby-on-rails-applications-by-33--1o3z66q
234
244
 
235
245
  8.3. Capistrano recipe => capistrano-recipe-pfn4qu
236
246
 
237
247
  8.4. Bundler support => bundler-support-19v1h43
238
248
 
249
+ 8.4.1. Does Phusion Passenger itself need to be added to the Gemfile? => does-phusion-passenger-itself-need-to-be-added-to-the-gemfile--xn1a11
250
+
239
251
  8.5. Installing multiple Ruby on Rails versions => installing-multiple-ruby-on-rails-versions-1bp1fff
240
252
 
241
253
  8.6. Making the application restart after each request => making-the-application-restart-after-each-request-vimy48
@@ -244,6 +256,18 @@
244
256
 
245
257
  8.8. Out-of-Band Garbage Work and Out-of-Band Garbage Collection => out-of-band-garbage-work-and-out-of-band-garbage-collection-v89lu2
246
258
 
259
+ 8.9. Flying Passenger => flying-passenger-137qg5e
260
+
261
+ 8.9.1. Requirements => requirements-194ysj6
262
+
263
+ 8.9.2. Basic usage => basic-usage-1qtgvwx
264
+
265
+ 8.9.3. Configuring Flying Passenger => configuring-flying-passenger-n558np
266
+
267
+ 8.9.4. Managing the Flying Passenger daemon => managing-the-flying-passenger-daemon-vjmzdh
268
+
269
+ 8.9.5. Caveats and limitations => caveats-and-limitations-15wakf
270
+
247
271
  9. Under the hood => under-the-hood-8uney
248
272
 
249
273
  9.1. Page caching support => page-caching-support-nafhf6
@@ -280,3 +304,23 @@
280
304
 
281
305
  12.5. Smart spawning gotcha #3: code load order => smart-spawning-gotcha-3-code-load-order-12ydsn8
282
306
 
307
+ 13. Appendix D: About environment variables => appendix-d-about-environment-variables-1t2cuff
308
+
309
+ 13.1. Working with environment variables => working-with-environment-variables-1kmvq8w
310
+
311
+ 13.2. The PATH environment variable => the-path-environment-variable-vlp05e
312
+
313
+ 13.3. Making environment variables permanent => making-environment-variables-permanent-1wjyhzt
314
+
315
+ 13.3.1. bash => bash-19xsxec
316
+
317
+ 13.3.2. Apache => apache-9hqtyj
318
+
319
+ 13.3.3. Nginx => nginx-157dpwy
320
+
321
+ 13.3.4. cron => cron-1nuc9cz
322
+
323
+ 13.3.5. Phusion Passenger-served apps => phusion-passenger-served-apps-uiewl5
324
+
325
+ 13.4. Environment variables and sudo => environment-variables-and-sudo-10lphxn
326
+
@@ -460,6 +460,8 @@ this option as well. Please read
460
460
 
461
461
  This required option may only occur once, in the 'http' configuration block.
462
462
 
463
+ NOTE: This option has no effect when you are using <<flying_passenger,Flying Passenger>>.
464
+
463
465
  [[PassengerRuby]]
464
466
  === passenger_ruby <filename> ===
465
467
  The `passenger_ruby` option allows one to specify the Ruby interpreter to use. Similarly, the `passenger_python` option is for specifying the Python interpreter.
@@ -687,6 +689,17 @@ sudo -E passenger-status
687
689
  # The -E option tells 'sudo' to preserve environment variables.
688
690
  ----------------------------------------------------------
689
691
 
692
+ :option: `--temp-dir`
693
+ include::users_guide_snippets/alternative_for_flying_passenger.txt[]
694
+
695
+ === passenger_fly_with <socket filename>
696
+ :version: 4.1.0
697
+ include::users_guide_snippets/enterprise_only.txt[]
698
+
699
+ Enables <<flying_passenger,Flying Passenger>> mode, and configures Nginx to connect to the Flying Passenger daemon that's listening on the given socket filename.
700
+
701
+ This option may only occur once, in the 'http' configuration block. When not set, Flying Passenger is not enabled.
702
+
690
703
  === Important deployment options ===
691
704
  ==== passenger_enabled <on|off> ====
692
705
  This option may be specified in the 'http' configuration block, a
@@ -878,6 +891,9 @@ Whether to enable <<user_switching,user switching support>>.
878
891
  This option may only occur once, in the 'http' configuration block.
879
892
  The default value is 'on'.
880
893
 
894
+ NOTE: This option has no effect when you are using <<flying_passenger,Flying Passenger>>. You can disable user switching for Flying Passenger by starting the Flying Passenger daemon as a non-root user.
895
+
896
+ [[PassengerUser]]
881
897
  ==== passenger_user <username> ====
882
898
  If <<user_switching,user switching support>> is enabled, then Phusion Passenger will
883
899
  by default run the web application as the owner of the file 'config/environment.rb'
@@ -894,6 +910,7 @@ This option may occur in the following places:
894
910
 
895
911
  In each place, it may be specified at most once.
896
912
 
913
+ [[PassengerGroup]]
897
914
  ==== passenger_group <group name> ====
898
915
  If <<user_switching,user switching support>> is enabled, then Phusion Passenger will
899
916
  by default run the web application as the primary group of the owner of the file
@@ -922,6 +939,8 @@ run as, if user switching fails or is disabled.
922
939
  This option may only occur once, in the 'http' configuration block.
923
940
  The default value is 'nobody'.
924
941
 
942
+ NOTE: This option has no effect when you are using <<flying_passenger,Flying Passenger>>. There is currently no way to set this option when using Flying Passenger, but if you want to disable user switching for Flying Passenger then you can do so by starting the Flying Passenger daemon as a non-root user.
943
+
925
944
  [[PassengerDefaultGroup]]
926
945
  ==== Passenger_default_group <group name> ====
927
946
  Phusion Passenger enables <<user_switching,user switching support>> by default.
@@ -932,6 +951,8 @@ This option may only occur once, in the 'http' configuration block.
932
951
  The default value is the primary group of the user specifified by
933
952
  <<PassengerDefaultUser,passenger_default_user>>.
934
953
 
954
+ NOTE: This option has no effect when you are using <<flying_passenger,Flying Passenger>>. There is currently no way to set this option when using Flying Passenger, but if you want to disable user switching for Flying Passenger then you can do so by starting the Flying Passenger daemon as a non-root user.
955
+
935
956
  ==== passenger_show_version_in_header <on|off> ====
936
957
  When turned on, Phusion Passenger will output its version number in the `Server` and `X-Powered-By` header in all Phusion Passenger-served requests:
937
958
 
@@ -956,6 +977,7 @@ This option may occur in the following places:
956
977
 
957
978
  In each place, it may be specified at most once. The default value is 'on'.
958
979
 
980
+ [[PassengerFriendlyErrorPages]]
959
981
  ==== passenger_friendly_error_pages <on|off> ====
960
982
  Phusion Passenger can display friendly error pages whenever an application fails
961
983
  to start. This friendly error page presents the startup error message, some
@@ -988,6 +1010,9 @@ If you find that your server is running out of memory then you should lower this
988
1010
  This option may only occur once, in the 'http' configuration block.
989
1011
  The default value is '6'.
990
1012
 
1013
+ :option: `--max-pool-size`
1014
+ include::users_guide_snippets/alternative_for_flying_passenger.txt[]
1015
+
991
1016
  [[PassengerMinInstances]]
992
1017
  ==== passenger_min_instances <integer> ====
993
1018
  This specifies the minimum number of application processes that should exist for a
@@ -1115,6 +1140,9 @@ applications, each which must be available at all times.
1115
1140
  This option may only occur once, in the 'http' configuration block.
1116
1141
  The default value is '300'.
1117
1142
 
1143
+ :option: `--pool-idle-time`
1144
+ include::users_guide_snippets/alternative_for_flying_passenger.txt[]
1145
+
1118
1146
  ==== passenger_max_preloader_idle_time <integer> ====
1119
1147
  The ApplicationSpawner server (explained in <<spawning_methods_explained,Spawning
1120
1148
  methods explained>>) has an idle timeout, just like the backend processes spawned by
@@ -1141,6 +1169,9 @@ This option may occur in the following places:
1141
1169
 
1142
1170
  In each place, it may be specified at most once. The default value is '300' (5 minutes).
1143
1171
 
1172
+ :option: `--max-preloader-idle-time`
1173
+ include::users_guide_snippets/alternative_for_flying_passenger.txt[]
1174
+
1144
1175
  [[PassengerConcurrencyModel]]
1145
1176
  ==== passenger_concurrency_model <process|thread> ====
1146
1177
  :version: 4.0.0
@@ -1258,6 +1289,12 @@ fix the problem in your application rather than relying on these directives as a
1258
1289
  measure to avoid freezing applications.
1259
1290
  =====================================================
1260
1291
 
1292
+ [NOTE]
1293
+ =====================================================
1294
+ This option is currently only available for Ruby apps. It is not yet available
1295
+ for Python and Node.js.
1296
+ =====================================================
1297
+
1261
1298
  [[PassengerMemoryLimit]]
1262
1299
  ==== passenger_memory_limit <integer> ====
1263
1300
  :version: 3.0.0
@@ -1328,6 +1365,8 @@ A few things to be careful of:
1328
1365
  This option may only occur in the 'http' configuration block. It may be specified
1329
1366
  any number of times.
1330
1367
 
1368
+ NOTE: This option is currently not available when using <<flying_passenger,Flying Passenger>>.
1369
+
1331
1370
  ===== Example 1: basic usage =====
1332
1371
 
1333
1372
  Suppose that you have the following web applications.
@@ -1494,6 +1533,7 @@ Yes. And it does not perform any certificate validation.
1494
1533
 
1495
1534
  === Logging and debugging options ===
1496
1535
 
1536
+ [[PassengerLogLevel]]
1497
1537
  ==== passenger_log_level <integer> ====
1498
1538
  This option allows one to specify how much information Phusion Passenger should
1499
1539
  write to the Nginx error log file. A higher log level value means that more
@@ -1518,6 +1558,9 @@ error messages should be written to instead.
1518
1558
 
1519
1559
  This option may only occur once, in the 'http' configuration block.
1520
1560
 
1561
+ :option: `--log-file`
1562
+ include::users_guide_snippets/alternative_for_flying_passenger.txt[]
1563
+
1521
1564
  ==== passenger_debugger <on|off> ====
1522
1565
  :version: 3.0.0
1523
1566
  include::users_guide_snippets/enterprise_only.txt[]
@@ -1640,3 +1683,5 @@ include::users_guide_snippets/appendix_a_about.txt[]
1640
1683
  include::users_guide_snippets/appendix_b_terminology.txt[]
1641
1684
 
1642
1685
  include::users_guide_snippets/appendix_c_spawning_methods.txt[]
1686
+
1687
+ include::users_guide_snippets/environment_variables.txt[]
@@ -1059,8 +1059,8 @@ pre {
1059
1059
  <body class="article">
1060
1060
  <div id="topbar" style="display: none">
1061
1061
  <div class="title">
1062
- <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt="">
1063
- <a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger Standalone users guide</a>
1062
+ <!-- Don't put a space between the img and a. That will break the hover layout. -->
1063
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt=""><a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger Standalone users guide</a>
1064
1064
  </div>
1065
1065
  <a href="javascript:void(0)" id="current_section"></a>
1066
1066
  </div>
@@ -1138,14 +1138,14 @@ if it doesn’t work on your POSIX-compliant operating system.</p></div>
1138
1138
  <div class="ulist"><ul>
1139
1139
  <li>
1140
1140
  <p>
1141
- <a href="http://code.google.com/p/phusion-passenger/issues/list">Issue tracker</a> - report
1142
- bugs here.
1141
+ <a href="http://groups.google.com/group/phusion-passenger">Discussion forum</a> - post a
1142
+ message here if you’re experiencing problems. Support on this forum is provided by the community on a best-effort basis, so a (timely) response is not guaranteed.
1143
1143
  </p>
1144
1144
  </li>
1145
1145
  <li>
1146
1146
  <p>
1147
- <a href="http://groups.google.com/group/phusion-passenger">Discussion forum</a> - post a
1148
- message here if you’re experiencing problems. Support on this forum is provided by the community on a best-effort basis, so a (timely) response is not guaranteed.
1147
+ <a href="http://code.google.com/p/phusion-passenger/issues/list">Issue tracker</a> - report
1148
+ bugs here.
1149
1149
  </p>
1150
1150
  </li>
1151
1151
  <li>
@@ -1160,7 +1160,7 @@ Email <a href="mailto:support@phusion.nl">support@phusion.nl</a> if you are a <a
1160
1160
  </li>
1161
1161
  <li>
1162
1162
  <p>
1163
- Report security vulnerabilities to <a href="mailto:support@phusion.nl">support@phusion.nl</a>. We will do our best to respond to you as quickly as we can, so please do not disclose the vulnerability until then.
1163
+ Report security vulnerabilities to <a href="mailto:security@phusion.nl">security@phusion.nl</a>. We will do our best to respond to you as quickly as we can, so please do not disclose the vulnerability until then.
1164
1164
  </p>
1165
1165
  </li>
1166
1166
  </ul></div>
@@ -0,0 +1 @@
1
+ NOTE: This option has no effect when you are using <<flying_passenger,Flying Passenger>>. Instead, you should configure this by passing the {option} command line option to the Flying Passenger daemon.
@@ -0,0 +1,221 @@
1
+ [[about_environment_variables]]
2
+ == Appendix D: About environment variables
3
+
4
+ The Phusion Passenger compilation process can be customized with environment variables.
5
+
6
+ Environment variables are named values that affect how the system works. For example they tell the system where to look for commands (the `PATH` variable) or where to look for libraries (`LD_LIBRARY_PATH`). Their names are often in all-uppercase. Sometimes people refer to an environment variable with a dollar sign `$` in front, but that's the same thing: when people say "the $PATH environment variable" they mean "the PATH environment variable". This is because the dollar sign `$` is a shell syntax for refering to an environment variable, as you will learn later.
7
+
8
+ Environment variables are set on a **per-process** basis, but they are **inherited** by child processes. This means that if you set environment variables in process A, another already running process B will not see these new environment variables. But if A spawns a child process C, then C will have all environment variables that A had. If you once again change the environment variables in A, then C will not see the changes.
9
+
10
+ The per-process nature of environment variables some implications. When you set environment variables in your `bashrc` or other bash startup files...
11
+
12
+ * ...only newly spawned bash shells see them.
13
+ * ...the web server usually does not see them, because the web server tends to be started from init scripts, not from bash.
14
+ * ...cron jobs do not see them, because cron jobs' environment variables are entirely dictated by their crontabs.
15
+
16
+ NOTE: Because this chapter is meant for beginners, it assumes that the reader uses the bash shell. This chapter does not describe instructions for zsh, csh or other shells. We assume that users of other shells are familiar with the Bourne shell syntax, and know how to apply the instructions in this chapter in their shells' native syntaxes.
17
+
18
+ === Working with environment variables
19
+
20
+ You can see all environment variables in your shell by running the following command:
21
+
22
+ [source,sh]
23
+ ---------------------------------
24
+ env
25
+ ---------------------------------
26
+
27
+ You can set an evironment variable with the syntax `export <NAME>=<VALUE>`. For example, to set the `APXS2` variable to the value `/usr/sbin/apxs2`:
28
+
29
+ [source,sh]
30
+ ---------------------------------
31
+ export APXS2=/usr/sbin/apxs2
32
+ ---------------------------------
33
+
34
+ Any process that you run from your shell from that point on will have said environment variable:
35
+
36
+ [source,sh]
37
+ ---------------------------------
38
+ export APXS2=/usr/sbin/apxs2
39
+ ruby -e 'p ENV["APXS2"]'
40
+ # => "/usr/sbin/apxs2"
41
+ ---------------------------------
42
+
43
+ .The "export" keyword is important
44
+ [NOTE]
45
+ ===================================================
46
+ You **must** set the `export` keyword. If you omit the `export` keyword then the environment variable will not be visible to other processes:
47
+
48
+ [source,sh]
49
+ ---------------------------------
50
+ APXS2=/usr/sbin/apxs2
51
+ ruby -e 'p ENV["APXS2"]'
52
+ # => nil
53
+ ---------------------------------
54
+ ===================================================
55
+
56
+ You can reference an environment variable in your shell by typing the `$` sign followed by the environment variable's name. For example, to see the value of the `PATH` variable:
57
+
58
+ [source,sh]
59
+ ---------------------------------
60
+ echo $PATH
61
+ ---------------------------------
62
+
63
+ You can also use this trick to extend the value of an environment variable:
64
+
65
+ [source,sh]
66
+ ---------------------------------
67
+ export PATH=/usr/bin
68
+
69
+ # Prepends '/opt/local/bin', so that it becomes /opt/local/bin:/usr/bin
70
+ export PATH=/opt/local/bin:$PATH
71
+ # Appends '/usr/local/bin', so that it becomes /opt/local/bin:/usr/bin:/usr/local/bin
72
+ export PATH=$PATH:/usr/local/bin
73
+ ---------------------------------
74
+
75
+ === The PATH environment variable
76
+
77
+ The `PATH` environment variable dictates where the system looks for command. It is a colon-separated list of directories. If you get a "command not found" error while you know that the command is installed, then setting `PATH` will help. For example suppose that the command `frobnicator` is in `/opt/local/bin`:
78
+
79
+ [source,sh]
80
+ ----------------------
81
+ user@localhost bash$ frobnicator
82
+ bash: frobnicator: command not found
83
+ ----------------------
84
+
85
+ We verify that `/opt/local/bin` is not in `PATH`:
86
+
87
+ [source,sh]
88
+ ----------------------
89
+ user@localhost bash$ echo $PATH
90
+ /bin:/usr/bin:/usr/local/bin
91
+ ----------------------
92
+
93
+ We can run `frobnicator` through it's full path...
94
+
95
+ [source,sh]
96
+ ----------------------
97
+ user@localhost bash$ /opt/local/bin/frobnicator
98
+ # => success!
99
+ ----------------------
100
+
101
+ ...or we can add `/opt/local/bin` to `PATH`.
102
+
103
+ [source,sh]
104
+ ----------------------
105
+ user@localhost bash$ export PATH=$PATH:/opt/local/bin
106
+ user@localhost bash$ frobnicator
107
+ # => success!
108
+ ----------------------
109
+
110
+ === Making environment variables permanent
111
+
112
+ When you exit your shell, the evironment variable changes are lost. There is no standard method to set environment variables system-wide, so you have to set them in different configuration files for different services.
113
+
114
+ ==== bash
115
+
116
+ To make environment variables permanent for future bash sessions **for the current user**, add them to your `~/.bashrc`:
117
+
118
+ [source,sh]
119
+ ---------------------------------
120
+ echo 'export FOO=bar' >> ~/.bashrc
121
+ echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bashrc
122
+ ---------------------------------
123
+
124
+ To make them permanent for future bash sessions **for all users**, add them to `/etc/bashrc`.
125
+
126
+ NOTE: Depending on the system, the bashrc file may have a different filename. On Debian and Ubuntu, it's `/etc/bash.bashrc`.
127
+
128
+ ==== Apache
129
+
130
+ NOTE: This subsection describes how to set environment variables on Apache itself, not on apps served through Phusion Passenger for Apache. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <<env_vars_passenger_apps,Setting environment variables on Phusion Passenger-served apps>>.
131
+
132
+ On Debian and Ubuntu, with an Apache installed through apt, Apache environment variables are defined in the file `/etc/apache2/envvars`. This is a shell script so environment variables must be specified with the shell syntax.
133
+
134
+ On Red Hat, Fedora, CentOS and ScientificLinux, with an Apache installed through YUM, Apache environment variables are defined in `/etc/sysconfig/httpd`.
135
+
136
+ On OS X they are defined in `/System/Library/LaunchDaemons/org.apache.httpd.plist`, as explained link:/System/Library/LaunchDaemons/org.apache.httpd.plist[here on Stack Overflow].
137
+
138
+ On other systems, or if you did not install Apache through the system's package manager, the configuration file for environment variables is specific to the vendor that supplied Apache. There may not even be such a configuration file. You should contact the vendor for support.
139
+
140
+ ==== Nginx
141
+
142
+ NOTE: This subsection describes how to set environment variables on Nginx itself, not on apps served through Phusion Passenger for Nginx. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <<env_vars_passenger_apps,Setting environment variables on Phusion Passenger-served apps>>.
143
+
144
+ If you installed Nginx through <<install_on_debian_ubuntu,the Brightbox packages>>, then you can define environment variables in `/etc/default/nginx`. This is a shell script so you must use the `export FOO=bar` syntax.
145
+
146
+ Otherwise, environment variables are best set through the script which starts Nginx. For example, if you installed Nginx from source and you used
147
+ ifdef::apache[]
148
+ the Nginx init script described in the link:http://www.modrails.com/documentation/Users%20guide%20Nginx.html[Phusion Passenger Users Guide, Nginx version],
149
+ endif::apache[]
150
+ ifdef::nginx[]
151
+ <<nginx_init_script,the Nginx init script described earlier in this manual,
152
+ endif::nginx[]
153
+ then you should edit that script to define the environment variables. Those init scripts are regular shell scripts, so use the `export FOO=bar` syntax. Just make sure your set your environment variables before the script starts Nginx.
154
+
155
+ NOTE: Setting environment variables on Nginx has no effect on the <<flying_passenger,Flying Passenger daemon>> because the daemon is started seperately. You should set the environment variables in the shell right before starting the daemon.
156
+
157
+ ==== cron
158
+
159
+ To make environment variables permanent for cron jobs, add those variables to the relevant crontab. But note that inside crontabs you cannot refer to existing environment variables with the `$` syntax because crontabs are not shell scripts. You have to specify the entire value.
160
+
161
+ .What to put in "crontab -e"
162
+ -------------------------
163
+ # Environment variable definitions
164
+ FOO=bar
165
+ APXS2=/usr/sbin/apxs2
166
+
167
+ # **WRONG!** You cannot refer to existing variables with the `$` syntax!
168
+ PATH=/usr/bin:$PATH
169
+ # **WRONG!** You cannot use the 'export' keyword!
170
+ export PATH=/usr/bin:/usr/local/bin
171
+ # Correct:
172
+ PATH=/usr/bin:/usr/local/bin
173
+
174
+ # Jobs:
175
+ # m h dom mon dow command
176
+ * * * * * frobnicator
177
+ -------------------------
178
+
179
+ [[env_vars_passenger_apps]]
180
+ ==== Phusion Passenger-served apps
181
+
182
+ You can pass environment variables to Phusion Passenger-served apps through various methods:
183
+
184
+ * When running Apache, use the `PassEnv` and `SetEnv` directives of link:http://httpd.apache.org/docs/2.4/mod/mod_env.html[mod_env]. This is supported starting from Phusion Passenger 4.0.
185
+ * When running Nginx, use the `env` directive. Unlike Apache, Nginx's `env` directive can only be set globally and cannot be customized on a per-virtual host basis.
186
+ * Through your `bashrc`. Starting from version 4.0, Phusion Passenger 4.0 spawns applications through bash and inherit all bash environment variables. Phusion Passenger Standalone tends to be started from the shell and thus inherits all environment variables set by the shell.
187
+ * Through Apache and Nginx, as described earlier in this chapter. Any environment variables that you set on Apache and Nginx itself are inherited by Phusion Passenger, and thus by Phusion Passenger-served apps as well.
188
+ * Through the application itself. Most programming languages provide APIs for setting environment variables. For example in Ruby you can write:
189
+ +
190
+ [source,ruby]
191
+ -------------------
192
+ ENV['FOO'] = 'bar'
193
+ -------------------
194
+ +
195
+ In Python you can write:
196
+ +
197
+ [source,python]
198
+ -------------------
199
+ import os
200
+ os.environ['FOO'] = 'bar'
201
+ -------------------
202
+
203
+ [[env_vars_and_sudo]]
204
+ === Environment variables and sudo
205
+
206
+ The `sudo` command resets all environment variables before running the specified command, for security reasons. So if you set environment variables before running `sudo passenger-install-xxx-module`, `sudo passenger-status` or any other commands, then the environment variables are not correctly passed to the command. You can solve this by running sudo with `-E` (preserve environment variables):
207
+
208
+ [source,sh]
209
+ -------------------------
210
+ user@localhost bash$ export APXS2=/usr/sbin/apxs2
211
+ user@localhost bash$ sudo -E passenger-install-apache2-module
212
+ -------------------------
213
+
214
+ Alternatively, you can obtain a root prompt with sudo first, and *then* set the environment variables, before running any further commands:
215
+
216
+ -------------------------
217
+ user@localhost bash$ sudo -s
218
+ Password: ...
219
+ root@localhost bash# export APXS2=/usr/sbin/apxs2
220
+ root@localhost bash# passenger-install-apache2-module
221
+ -------------------------