passenger 3.0.9 → 3.0.10

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 (67) hide show
  1. data/NEWS +32 -0
  2. data/Rakefile +1 -1
  3. data/build/common_library.rb +6 -1
  4. data/build/config.rb +3 -1
  5. data/doc/Users guide Apache.html +120 -39
  6. data/doc/Users guide Apache.txt +64 -0
  7. data/doc/Users guide Nginx.html +50 -2
  8. data/doc/Users guide Nginx.txt +29 -0
  9. data/ext/apache2/Bucket.cpp +7 -5
  10. data/ext/apache2/Bucket.h +2 -1
  11. data/ext/apache2/Configuration.cpp +8 -0
  12. data/ext/apache2/Configuration.hpp +9 -5
  13. data/ext/apache2/HelperAgent.cpp +4 -5
  14. data/ext/apache2/Hooks.cpp +1 -6
  15. data/ext/boost/thread/exceptions.hpp +7 -1
  16. data/ext/boost/thread/locks.hpp +11 -11
  17. data/ext/common/AgentBase.cpp +21 -1
  18. data/ext/common/AgentsStarter.hpp +22 -21
  19. data/ext/common/ApplicationPool/Client.h +0 -8
  20. data/ext/common/ApplicationPool/Server.h +22 -21
  21. data/ext/common/Constants.h +1 -1
  22. data/ext/common/EventedMessageServer.h +6 -2
  23. data/ext/common/IniFile.h +4 -4
  24. data/ext/common/Logging.h +1 -1
  25. data/ext/common/LoggingAgent/LoggingServer.h +2 -2
  26. data/ext/common/LoggingAgent/Main.cpp +2 -2
  27. data/ext/common/MessageChannel.h +20 -62
  28. data/ext/common/MessageReadersWriters.h +4 -4
  29. data/ext/common/MessageServer.h +18 -18
  30. data/ext/common/Process.h +4 -5
  31. data/ext/common/Session.h +6 -40
  32. data/ext/common/SpawnManager.h +20 -25
  33. data/ext/common/Utils.cpp +1 -1
  34. data/ext/common/Utils/Dechunker.h +1 -1
  35. data/ext/common/Utils/MessageIO.h +109 -14
  36. data/ext/common/Utils/StreamBoyerMooreHorspool.h +20 -14
  37. data/ext/common/Utils/VariantMap.h +9 -27
  38. data/ext/common/Watchdog.cpp +53 -42
  39. data/ext/libev/config.h +122 -0
  40. data/ext/nginx/Configuration.c +62 -0
  41. data/ext/nginx/Configuration.h +5 -0
  42. data/ext/nginx/ContentHandler.c +46 -19
  43. data/ext/nginx/HelperAgent.cpp +6 -5
  44. data/ext/nginx/config +12 -12
  45. data/ext/oxt/system_calls.cpp +10 -1
  46. data/ext/ruby/extconf.rb +0 -1
  47. data/ext/ruby/passenger_native_support.c +2 -2
  48. data/helper-scripts/prespawn +1 -1
  49. data/lib/phusion_passenger.rb +4 -4
  50. data/lib/phusion_passenger/classic_rails/application_spawner.rb +2 -2
  51. data/lib/phusion_passenger/dependencies.rb +6 -1
  52. data/lib/phusion_passenger/platform_info.rb +9 -0
  53. data/lib/phusion_passenger/platform_info/compiler.rb +5 -0
  54. data/lib/phusion_passenger/platform_info/operating_system.rb +1 -1
  55. data/lib/phusion_passenger/platform_info/ruby.rb +5 -5
  56. data/lib/phusion_passenger/rack/application_spawner.rb +6 -3
  57. data/lib/phusion_passenger/utils.rb +2 -2
  58. data/lib/phusion_passenger/wsgi/application_spawner.rb +1 -1
  59. data/resources/mime.types +2 -0
  60. data/test/cxx/LoggingTest.cpp +10 -12
  61. data/test/cxx/MessageIOTest.cpp +53 -3
  62. data/test/cxx/MessageReadersWritersTest.cpp +5 -2
  63. data/test/cxx/MessageServerTest.cpp +3 -1
  64. data/test/integration_tests/nginx_tests.rb +14 -1
  65. data/test/stub/rack/config.ru +2 -0
  66. data/test/tut/tut.h +9 -3
  67. metadata +5 -4
data/NEWS CHANGED
@@ -1,3 +1,35 @@
1
+ Release 3.0.10
2
+ --------------
3
+
4
+ * [Nginx] Dropped support for Nginx versions older than 1.0.0
5
+ * [Nginx] Fixed support for Nginx 1.1.4+
6
+ * [Nginx, Standalone] Upgraded default Nginx version to 1.0.10
7
+ The previously default version was 1.0.5.
8
+ * [Nginx] New option passenger_max_requests
9
+ This is equivalent to the PassengerMaxRequests option in the Apache
10
+ version: Phusion Passenger will automatically shutdown a worker process
11
+ once it has processed the specified number of requests.
12
+ Contributed by Paul Kmiec.
13
+ * [Apache] New option PassengerBufferResponse
14
+ The Apache version did not buffer responses. This could block the Ruby
15
+ worker process in case of slow clients. We now enable response buffering
16
+ by default. It can be turned off through this option. Feature contributed
17
+ by Ryo Onodera.
18
+ * Fixed remaining Ruby 1.9.3 compatibility problems
19
+ We already supported Ruby 1.9.3 since 3.0.8, but due to bugs in Ruby
20
+ 1.9.3's build system Phusion Passenger would fail to detect Ruby 1.9.3
21
+ features on some systems. Fixes issue #714.
22
+ * Fixed a bug in PassengerPreStart
23
+ A regression was introduced in 3.0.8, causing the prespawn script to
24
+ connect to the host name instead of to 127.0.0.1. Fix contributed by
25
+ Andy Allan.
26
+ * Fixed compatibility with GCC 4.6
27
+ Affected systems include Ubuntu 11.10.
28
+ * Fixed various compilation problems.
29
+ * Fixed some Ruby 1.9 encoding problems.
30
+ * Fixed some Ruby 1.9.3 deprecation warnings.
31
+
32
+
1
33
  Release 3.0.9
2
34
  -------------
3
35
 
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # kate: syntax ruby
2
2
 
3
3
  # Phusion Passenger - http://www.modrails.com/
4
- # Copyright (C) 2008, 2009 Phusion
4
+ # Copyright (C) 2008, 2009, 2010, 2011 Phusion
5
5
  #
6
6
  # This program is free software; you can redistribute it and/or modify
7
7
  # it under the terms of the GNU General Public License as published by
@@ -96,6 +96,7 @@ def define_common_library_task(namespace, output_dir, extra_compiler_flags = nil
96
96
  # Define compilation targets for the object files in libpassenger_common.
97
97
  flags = "-Iext -Iext/common #{LIBEV_CFLAGS} #{extra_compiler_flags} "
98
98
  flags << "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
99
+ flags.strip!
99
100
 
100
101
  if boolean_option('RELEASE')
101
102
  sources = []
@@ -138,7 +139,11 @@ def define_common_library_task(namespace, output_dir, extra_compiler_flags = nil
138
139
  sh "mkdir -p #{output_dir}" if !File.directory?(output_dir)
139
140
  sh "mkdir -p #{output_dir}/Utils" if !File.directory?("#{output_dir}/Utils")
140
141
  sh "mkdir -p #{output_dir}/LoggingAgent" if !File.directory?("#{output_dir}/LoggingAgent")
141
- compile_cxx("ext/common/#{source_file}", "#{flags} -o #{object_file}")
142
+ if source_file =~ /\.c$/
143
+ compile_c("ext/common/#{source_file}", "#{flags} -o #{object_file}")
144
+ else
145
+ compile_cxx("ext/common/#{source_file}", "#{flags} -o #{object_file}")
146
+ end
142
147
  end
143
148
  end
144
149
  end
data/build/config.rb CHANGED
@@ -33,7 +33,9 @@ end
33
33
 
34
34
  # Extra compiler flags that should always be passed to the C/C++ compiler.
35
35
  # Should be included last in the command string, even after PlatformInfo.portability_cflags.
36
- EXTRA_CXXFLAGS = "-Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long #{OPTIMIZATION_FLAGS}".strip
36
+ EXTRA_CXXFLAGS = "-Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long"
37
+ EXTRA_CXXFLAGS << " -Wno-missing-field-initializers" if PlatformInfo.compiler_supports_wno_missing_field_initializers_flag?
38
+ EXTRA_CXXFLAGS << " #{OPTIMIZATION_FLAGS}" if !OPTIMIZATION_FLAGS.empty?
37
39
 
38
40
  # Extra linker flags that should always be passed to the linker.
39
41
  # Should be included last in the command string, even after PlatformInfo.portability_ldflags.
@@ -2181,15 +2181,96 @@ allow the attacker to cause a Denial-of-Service.</p></div>
2181
2181
  directory that&#8217;s readable by Apache, but only writable by administrators.</p></div>
2182
2182
  </div>
2183
2183
  <div class="sect2">
2184
- <h3 id="_security_options">5.10. Security options</h3>
2184
+ <h3 id="PassengerBufferResponse">5.10. PassengerBufferResponse &lt;on|off&gt;</h3>
2185
+ <div class="paragraph"><p>When turned on, application-generated responses are buffered in memory. By buffering
2186
+ responses, protection is provided against slow HTTP clients that can not read your
2187
+ response immediately.</p></div>
2188
+ <div class="paragraph"><p>For example, consider an HTTP client that&#8217;s on a dial-up modem link, and your
2189
+ application instance generates a 2 MB response. If response buffering is turned
2190
+ off then your application instance will be blocked until the entire 2 MB has been
2191
+ sent out to the HTTP client. This disallows your application instance to do any useful
2192
+ work in the mean time. By enabling response buffering, Phusion Passenger will read
2193
+ the application response as quickly as possible and will take care of slow clients.</p></div>
2194
+ <div class="paragraph"><p>However, keep in mind that enabling this option will make streaming responses
2195
+ impossible. Consider for example this piece of Rails code:</p></div>
2196
+ <div class="listingblock">
2197
+ <div class="content monospaced">
2198
+ <pre>render :text =&gt; lambda { |response, output|
2199
+ 10.times do |i|
2200
+ output.write("entry #{i}\n")
2201
+ output.flush
2202
+ sleep 1
2203
+ end
2204
+ }</pre>
2205
+ </div></div>
2206
+ <div class="paragraph"><p>&#8230;or this piece of Rack code:</p></div>
2207
+ <div class="listingblock">
2208
+ <div class="content monospaced">
2209
+ <pre>class Response
2210
+ def each
2211
+ 10.times do |i|
2212
+ yield("entry #{i}\n")
2213
+ sleep 1
2214
+ end
2215
+ end
2216
+ end
2217
+
2218
+ app = lambda do |env|
2219
+ [200, { "Content-Type" =&gt; "text/plain" }, Response.new]
2220
+ end</pre>
2221
+ </div></div>
2222
+ <div class="paragraph"><p>When response buffering is turned on, Phusion Passenger will wait until
2223
+ the application is done sending the entire response before forwarding it
2224
+ to the client. The client will not receive anything for 10 seconds,
2225
+ after which it receives the entire response at once.
2226
+ When response buffering is turned off, it works as expected: the client
2227
+ receives an "entry X" message every second for 10 seconds.</p></div>
2228
+ <div class="paragraph"><p>This option may occur in the following places:</p></div>
2229
+ <div class="ulist"><ul>
2230
+ <li>
2231
+ <p>
2232
+ In the global server configuration.
2233
+ </p>
2234
+ </li>
2235
+ <li>
2236
+ <p>
2237
+ In a virtual host configuration block.
2238
+ </p>
2239
+ </li>
2240
+ <li>
2241
+ <p>
2242
+ In a <span class="monospaced">&lt;Directory&gt;</span> or <span class="monospaced">&lt;Location&gt;</span> block.
2243
+ </p>
2244
+ </li>
2245
+ <li>
2246
+ <p>
2247
+ In <em>.htaccess</em>.
2248
+ </p>
2249
+ </li>
2250
+ </ul></div>
2251
+ <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>on</em>.</p></div>
2252
+ <div class="admonitionblock">
2253
+ <table><tr>
2254
+ <td class="icon">
2255
+ <img src="./images/icons/note.png" alt="Note">
2256
+ </td>
2257
+ <td class="content">
2258
+ <div class="paragraph"><p>The <a href="#PassengerBufferResponse">PassengerBufferResponse</a> directive should be turned off
2259
+ if responses can be huge. Because entire responses are buffered in memory when turned on.</p></div>
2260
+ </td>
2261
+ </tr></table>
2262
+ </div>
2263
+ </div>
2264
+ <div class="sect2">
2265
+ <h3 id="_security_options">5.11. Security options</h3>
2185
2266
  <div class="sect3">
2186
- <h4 id="PassengerUserSwitching">5.10.1. PassengerUserSwitching &lt;on|off&gt;</h4>
2267
+ <h4 id="PassengerUserSwitching">5.11.1. PassengerUserSwitching &lt;on|off&gt;</h4>
2187
2268
  <div class="paragraph"><p>Whether to enable <a href="#user_switching">user switching support</a>.</p></div>
2188
2269
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
2189
2270
  The default value is <em>on</em>.</p></div>
2190
2271
  </div>
2191
2272
  <div class="sect3">
2192
- <h4 id="_passengeruser_lt_username_gt">5.10.2. PassengerUser &lt;username&gt;</h4>
2273
+ <h4 id="_passengeruser_lt_username_gt">5.11.2. PassengerUser &lt;username&gt;</h4>
2193
2274
  <div class="paragraph"><p>If <a href="#user_switching">user switching support</a> is enabled, then Phusion Passenger will
2194
2275
  by default run the web application as the owner of the file <em>config/environment.rb</em>
2195
2276
  (for Rails apps) or <em>config.ru</em> (for Rack apps). This option allows you to override
@@ -2216,7 +2297,7 @@ In a <span class="monospaced">&lt;Directory&gt;</span> or <span class="monospace
2216
2297
  <div class="paragraph"><p>In each place, it may be specified at most once.</p></div>
2217
2298
  </div>
2218
2299
  <div class="sect3">
2219
- <h4 id="_passengergroup_lt_group_name_gt">5.10.3. PassengerGroup &lt;group name&gt;</h4>
2300
+ <h4 id="_passengergroup_lt_group_name_gt">5.11.3. PassengerGroup &lt;group name&gt;</h4>
2220
2301
  <div class="paragraph"><p>If <a href="#user_switching">user switching support</a> is enabled, then Phusion Passenger will
2221
2302
  by default run the web application as the primary group of the owner of the file
2222
2303
  <em>config/environment.rb</em> (for Rails apps) or <em>config.ru</em> (for Rack apps). This option
@@ -2245,7 +2326,7 @@ In a <span class="monospaced">&lt;Directory&gt;</span> or <span class="monospace
2245
2326
  <div class="paragraph"><p>In each place, it may be specified at most once.</p></div>
2246
2327
  </div>
2247
2328
  <div class="sect3">
2248
- <h4 id="PassengerDefaultUser">5.10.4. PassengerDefaultUser &lt;username&gt;</h4>
2329
+ <h4 id="PassengerDefaultUser">5.11.4. PassengerDefaultUser &lt;username&gt;</h4>
2249
2330
  <div class="paragraph"><p>Phusion Passenger enables <a href="#user_switching">user switching support</a> by default.
2250
2331
  This configuration option allows one to specify the user that applications must
2251
2332
  run as, if user switching fails or is disabled.</p></div>
@@ -2253,7 +2334,7 @@ run as, if user switching fails or is disabled.</p></div>
2253
2334
  The default value is <em>nobody</em>.</p></div>
2254
2335
  </div>
2255
2336
  <div class="sect3">
2256
- <h4 id="PassengerDefaultGroup">5.10.5. PassengerDefaultGroup &lt;group name&gt;</h4>
2337
+ <h4 id="PassengerDefaultGroup">5.11.5. PassengerDefaultGroup &lt;group name&gt;</h4>
2257
2338
  <div class="paragraph"><p>Phusion Passenger enables <a href="#user_switching">user switching support</a> by default.
2258
2339
  This configuration option allows one to specify the group that applications must
2259
2340
  run as, if user switching fails or is disabled.</p></div>
@@ -2262,7 +2343,7 @@ The default value is the primary group of the user specifified by
2262
2343
  <a href="#PassengerDefaultUser">PassengerDefaultUser</a>.</p></div>
2263
2344
  </div>
2264
2345
  <div class="sect3">
2265
- <h4 id="_passengerfriendlyerrorpages_lt_on_off_gt">5.10.6. PassengerFriendlyErrorPages &lt;on|off&gt;</h4>
2346
+ <h4 id="_passengerfriendlyerrorpages_lt_on_off_gt">5.11.6. PassengerFriendlyErrorPages &lt;on|off&gt;</h4>
2266
2347
  <div class="paragraph"><p>Phusion Passenger can display friendly error pages whenever an application fails
2267
2348
  to start. This friendly error page presents the startup error message, some
2268
2349
  suggestions for solving the problem, and a backtrace. This feature is very useful
@@ -2297,9 +2378,9 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
2297
2378
  </div>
2298
2379
  </div>
2299
2380
  <div class="sect2">
2300
- <h3 id="_resource_control_and_optimization_options">5.11. Resource control and optimization options</h3>
2381
+ <h3 id="_resource_control_and_optimization_options">5.12. Resource control and optimization options</h3>
2301
2382
  <div class="sect3">
2302
- <h4 id="_passengermaxpoolsize_lt_integer_gt">5.11.1. PassengerMaxPoolSize &lt;integer&gt;</h4>
2383
+ <h4 id="_passengermaxpoolsize_lt_integer_gt">5.12.1. PassengerMaxPoolSize &lt;integer&gt;</h4>
2303
2384
  <div class="paragraph"><p>The maximum number of Ruby on Rails or Rack application instances that may
2304
2385
  be simultaneously active. A larger number results in higher memory usage,
2305
2386
  but improved ability to handle concurrent HTTP clients.</p></div>
@@ -2326,7 +2407,7 @@ by about 33%. And it&#8217;s not hard to install.</td>
2326
2407
  </div>
2327
2408
  </div>
2328
2409
  <div class="sect3">
2329
- <h4 id="PassengerMinInstances">5.11.2. PassengerMinInstances &lt;integer&gt;</h4>
2410
+ <h4 id="PassengerMinInstances">5.12.2. PassengerMinInstances &lt;integer&gt;</h4>
2330
2411
  <div class="paragraph"><p>This specifies the minimum number of application instances that must be kept around
2331
2412
  whenever Phusion Passenger cleans up idle instances. You should set this option to a
2332
2413
  non-zero value if you want to avoid potentially long startup times after a website
@@ -2396,7 +2477,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> i
2396
2477
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>1</em>.</p></div>
2397
2478
  </div>
2398
2479
  <div class="sect3">
2399
- <h4 id="_passengermaxinstancesperapp_lt_integer_gt">5.11.3. PassengerMaxInstancesPerApp &lt;integer&gt;</h4>
2480
+ <h4 id="_passengermaxinstancesperapp_lt_integer_gt">5.12.3. PassengerMaxInstancesPerApp &lt;integer&gt;</h4>
2400
2481
  <div class="paragraph"><p>The maximum number of application instances that may be simultaneously active
2401
2482
  for a single application. This helps to make sure that a single application
2402
2483
  will not occupy all available slots in the application pool.</p></div>
@@ -2408,7 +2489,7 @@ will be enforced.</p></div>
2408
2489
  The default value is <em>0</em>.</p></div>
2409
2490
  </div>
2410
2491
  <div class="sect3">
2411
- <h4 id="PassengerPoolIdleTime">5.11.4. PassengerPoolIdleTime &lt;integer&gt;</h4>
2492
+ <h4 id="PassengerPoolIdleTime">5.12.4. PassengerPoolIdleTime &lt;integer&gt;</h4>
2412
2493
  <div class="paragraph"><p>The maximum number of seconds that an application instance may be idle. That is,
2413
2494
  if an application instance hasn&#8217;t received any traffic after the given number of
2414
2495
  seconds, then it will be shutdown in order to conserve memory.</p></div>
@@ -2430,7 +2511,7 @@ applications, each which must be available at all times.</p></div>
2430
2511
  The default value is <em>300</em>.</p></div>
2431
2512
  </div>
2432
2513
  <div class="sect3">
2433
- <h4 id="PassengerMaxRequests">5.11.5. PassengerMaxRequests &lt;integer&gt;</h4>
2514
+ <h4 id="PassengerMaxRequests">5.12.5. PassengerMaxRequests &lt;integer&gt;</h4>
2434
2515
  <div class="paragraph"><p>The maximum number of requests an application instance will process. After
2435
2516
  serving that many requests, the application instance will be shut down and
2436
2517
  Phusion Passenger will restart it. A value of 0 means that there is no maximum:
@@ -2478,7 +2559,7 @@ measure to avoid memory leaks.</p></div>
2478
2559
  </div>
2479
2560
  </div>
2480
2561
  <div class="sect3">
2481
- <h4 id="_passengerstatthrottlerate_lt_integer_gt">5.11.6. PassengerStatThrottleRate &lt;integer&gt;</h4>
2562
+ <h4 id="_passengerstatthrottlerate_lt_integer_gt">5.12.6. PassengerStatThrottleRate &lt;integer&gt;</h4>
2482
2563
  <div class="paragraph"><p>By default, Phusion Passenger performs several filesystem checks (or, in
2483
2564
  programmers jargon, <em>stat() calls</em>) each time a request is processed:</p></div>
2484
2565
  <div class="ulist"><ul>
@@ -2530,7 +2611,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> i
2530
2611
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
2531
2612
  </div>
2532
2613
  <div class="sect3">
2533
- <h4 id="PassengerPreStart">5.11.7. PassengerPreStart &lt;url&gt;</h4>
2614
+ <h4 id="PassengerPreStart">5.12.7. PassengerPreStart &lt;url&gt;</h4>
2534
2615
  <div class="paragraph"><p>By default, Phusion Passenger does not start any application instances until said
2535
2616
  web application is first accessed. The result is that the first visitor of said
2536
2617
  web application might experience a small delay as Phusion Passenger is starting
@@ -2758,7 +2839,7 @@ the request ending up at a different web server in the cluster.</p></div>
2758
2839
  </div>
2759
2840
  </div>
2760
2841
  <div class="sect3">
2761
- <h4 id="PassengerHighPerformance">5.11.8. PassengerHighPerformance &lt;on|off&gt;</h4>
2842
+ <h4 id="PassengerHighPerformance">5.12.8. PassengerHighPerformance &lt;on|off&gt;</h4>
2762
2843
  <div class="paragraph"><p>By default, Phusion Passenger is compatible with mod_rewrite and most other
2763
2844
  Apache modules. However, a lot of effort is required in order to be compatible.
2764
2845
  If you turn <em>PassengerHighPerformance</em> to <em>on</em>, then Phusion Passenger will be
@@ -2837,9 +2918,9 @@ then you can enable high performance mode for a certain URL only. For example:</
2837
2918
  </div>
2838
2919
  </div>
2839
2920
  <div class="sect2">
2840
- <h3 id="_compatibility_options">5.12. Compatibility options</h3>
2921
+ <h3 id="_compatibility_options">5.13. Compatibility options</h3>
2841
2922
  <div class="sect3">
2842
- <h4 id="PassengerResolveSymlinksInDocumentRoot">5.12.1. PassengerResolveSymlinksInDocumentRoot &lt;on|off&gt;</h4>
2923
+ <h4 id="PassengerResolveSymlinksInDocumentRoot">5.13.1. PassengerResolveSymlinksInDocumentRoot &lt;on|off&gt;</h4>
2843
2924
  <div class="paragraph"><p>Configures whether Phusion Passenger should resolve symlinks in the document root.
2844
2925
  Please refer to <a href="#application_detection">How Phusion Passenger detects whether a virtual host is a web application</a> for more information.</p></div>
2845
2926
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
@@ -2868,7 +2949,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
2868
2949
  <div class="paragraph"><p>In each place, it may be specified at most once. It is off by default.</p></div>
2869
2950
  </div>
2870
2951
  <div class="sect3">
2871
- <h4 id="_passengerallowencodedslashes_lt_on_off_gt">5.12.2. PassengerAllowEncodedSlashes &lt;on|off&gt;</h4>
2952
+ <h4 id="_passengerallowencodedslashes_lt_on_off_gt">5.13.2. PassengerAllowEncodedSlashes &lt;on|off&gt;</h4>
2872
2953
  <div class="paragraph"><p>By default, Apache doesn&#8217;t support URLs with encoded slashes (%2f), e.g. URLs like
2873
2954
  this: <span class="monospaced">/users/fujikura%2fyuu</span>. If you access such an URL then Apache will return a
2874
2955
  404 Not Found error. This can be solved by turning on PassengerAllowEncodedSlashes
@@ -2936,9 +3017,9 @@ displaying maintenance.html will work fine even for URLs starting with "/users".
2936
3017
  </div>
2937
3018
  </div>
2938
3019
  <div class="sect2">
2939
- <h3 id="_logging_and_debugging_options">5.13. Logging and debugging options</h3>
3020
+ <h3 id="_logging_and_debugging_options">5.14. Logging and debugging options</h3>
2940
3021
  <div class="sect3">
2941
- <h4 id="_passengerloglevel_lt_integer_gt">5.13.1. PassengerLogLevel &lt;integer&gt;</h4>
3022
+ <h4 id="_passengerloglevel_lt_integer_gt">5.14.1. PassengerLogLevel &lt;integer&gt;</h4>
2942
3023
  <div class="paragraph"><p>This option allows one to specify how much information Phusion Passenger should
2943
3024
  write to the Apache error log file. A higher log level value means that more
2944
3025
  information will be logged.</p></div>
@@ -2971,7 +3052,7 @@ information will be logged.</p></div>
2971
3052
  The default is <em>0</em>.</p></div>
2972
3053
  </div>
2973
3054
  <div class="sect3">
2974
- <h4 id="_passengerdebuglogfile_lt_filename_gt">5.13.2. PassengerDebugLogFile &lt;filename&gt;</h4>
3055
+ <h4 id="_passengerdebuglogfile_lt_filename_gt">5.14.2. PassengerDebugLogFile &lt;filename&gt;</h4>
2975
3056
  <div class="paragraph"><p>By default Phusion Passenger debugging and error messages are written to the global
2976
3057
  web server error log. This option allows one to specify the file that debugging and
2977
3058
  error messages should be written to instead.</p></div>
@@ -2979,9 +3060,9 @@ error messages should be written to instead.</p></div>
2979
3060
  </div>
2980
3061
  </div>
2981
3062
  <div class="sect2">
2982
- <h3 id="_ruby_on_rails_specific_options">5.14. Ruby on Rails-specific options</h3>
3063
+ <h3 id="_ruby_on_rails_specific_options">5.15. Ruby on Rails-specific options</h3>
2983
3064
  <div class="sect3">
2984
- <h4 id="_railsautodetect_lt_on_off_gt">5.14.1. RailsAutoDetect &lt;on|off&gt;</h4>
3065
+ <h4 id="_railsautodetect_lt_on_off_gt">5.15.1. RailsAutoDetect &lt;on|off&gt;</h4>
2985
3066
  <div class="paragraph"><p>Whether Phusion Passenger should automatically detect whether a virtual host&#8217;s
2986
3067
  document root is a Ruby on Rails application. The default is <em>on</em>.</p></div>
2987
3068
  <div class="paragraph"><p>This option may occur in the global server configuration or in a virtual host
@@ -3011,7 +3092,7 @@ application by using the <a href="#RailsBaseURI">RailsBaseURI</a> configuration
3011
3092
  </div></div>
3012
3093
  </div>
3013
3094
  <div class="sect3">
3014
- <h4 id="RailsBaseURI">5.14.2. RailsBaseURI &lt;uri&gt;</h4>
3095
+ <h4 id="RailsBaseURI">5.15.2. RailsBaseURI &lt;uri&gt;</h4>
3015
3096
  <div class="paragraph"><p>Used to specify that the given URI is a Rails application. See
3016
3097
  <a href="#deploying_rails_to_sub_uri">Deploying Rails to a sub URI</a> for an example.</p></div>
3017
3098
  <div class="paragraph"><p>It is allowed to specify this option multiple times. Do this to deploy multiple
@@ -3041,7 +3122,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3041
3122
  </ul></div>
3042
3123
  </div>
3043
3124
  <div class="sect3">
3044
- <h4 id="rails_env">5.14.3. RailsEnv &lt;string&gt;</h4>
3125
+ <h4 id="rails_env">5.15.3. RailsEnv &lt;string&gt;</h4>
3045
3126
  <div class="paragraph"><p>This option allows one to specify the default <span class="monospaced">RAILS_ENV</span> value.</p></div>
3046
3127
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3047
3128
  <div class="ulist"><ul>
@@ -3069,7 +3150,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3069
3150
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>production</em>.</p></div>
3070
3151
  </div>
3071
3152
  <div class="sect3">
3072
- <h4 id="_railsframeworkspawneridletime_lt_integer_gt">5.14.4. RailsFrameworkSpawnerIdleTime &lt;integer&gt;</h4>
3153
+ <h4 id="_railsframeworkspawneridletime_lt_integer_gt">5.15.4. RailsFrameworkSpawnerIdleTime &lt;integer&gt;</h4>
3073
3154
  <div class="paragraph"><p>The FrameworkSpawner server (explained in <a href="#spawning_methods_explained">Spawning methods explained</a>) has an idle timeout, just like the backend processes spawned by
3074
3155
  Phusion Passenger do. That is, it will automatically shutdown if it hasn&#8217;t done
3075
3156
  anything for a given period.</p></div>
@@ -3098,7 +3179,7 @@ In a virtual host configuration block.
3098
3179
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>1800</em> (30 minutes).</p></div>
3099
3180
  </div>
3100
3181
  <div class="sect3">
3101
- <h4 id="_railsappspawneridletime_lt_integer_gt">5.14.5. RailsAppSpawnerIdleTime &lt;integer&gt;</h4>
3182
+ <h4 id="_railsappspawneridletime_lt_integer_gt">5.15.5. RailsAppSpawnerIdleTime &lt;integer&gt;</h4>
3102
3183
  <div class="paragraph"><p>The ApplicationSpawner server (explained in <a href="#spawning_methods_explained">Spawning methods explained</a>) has an idle timeout, just like the backend processes spawned by
3103
3184
  Phusion Passenger do. That is, it will automatically shutdown if it hasn&#8217;t done
3104
3185
  anything for a given period.</p></div>
@@ -3128,9 +3209,9 @@ In a virtual host configuration block.
3128
3209
  </div>
3129
3210
  </div>
3130
3211
  <div class="sect2">
3131
- <h3 id="_rack_specific_options">5.15. Rack-specific options</h3>
3212
+ <h3 id="_rack_specific_options">5.16. Rack-specific options</h3>
3132
3213
  <div class="sect3">
3133
- <h4 id="_rackautodetect_lt_on_off_gt">5.15.1. RackAutoDetect &lt;on|off&gt;</h4>
3214
+ <h4 id="_rackautodetect_lt_on_off_gt">5.16.1. RackAutoDetect &lt;on|off&gt;</h4>
3134
3215
  <div class="paragraph"><p>Whether Phusion Passenger should automatically detect whether a virtual host&#8217;s
3135
3216
  document root is a Rack application. The default is <em>on</em>.</p></div>
3136
3217
  <div class="paragraph"><p>This option may occur in the global server configuration or in a virtual host
@@ -3160,7 +3241,7 @@ application by using the <a href="#RackBaseURI">RackBaseURI</a> configuration op
3160
3241
  </div></div>
3161
3242
  </div>
3162
3243
  <div class="sect3">
3163
- <h4 id="RackBaseURI">5.15.2. RackBaseURI &lt;uri&gt;</h4>
3244
+ <h4 id="RackBaseURI">5.16.2. RackBaseURI &lt;uri&gt;</h4>
3164
3245
  <div class="paragraph"><p>Used to specify that the given URI is a Rack application. See
3165
3246
  <a href="#deploying_rack_to_sub_uri">Deploying Rack to a sub URI</a> for an example.</p></div>
3166
3247
  <div class="paragraph"><p>It is allowed to specify this option multiple times. Do this to deploy multiple
@@ -3190,7 +3271,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3190
3271
  </ul></div>
3191
3272
  </div>
3192
3273
  <div class="sect3">
3193
- <h4 id="rack_env">5.15.3. RackEnv &lt;string&gt;</h4>
3274
+ <h4 id="rack_env">5.16.3. RackEnv &lt;string&gt;</h4>
3194
3275
  <div class="paragraph"><p>The given value will be accessible in Rack applications in the <span class="monospaced">RACK_ENV</span>
3195
3276
  environment variable. This allows one to define the environment in which
3196
3277
  Rack applications are run, very similar to <span class="monospaced">RAILS_ENV</span>.</p></div>
@@ -3221,27 +3302,27 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3221
3302
  </div>
3222
3303
  </div>
3223
3304
  <div class="sect2">
3224
- <h3 id="_deprecated_options">5.16. Deprecated options</h3>
3305
+ <h3 id="_deprecated_options">5.17. Deprecated options</h3>
3225
3306
  <div class="paragraph"><p>The following options have been deprecated, but are still supported for backwards
3226
3307
  compatibility reasons.</p></div>
3227
3308
  <div class="sect3">
3228
- <h4 id="_railsruby">5.16.1. RailsRuby</h4>
3309
+ <h4 id="_railsruby">5.17.1. RailsRuby</h4>
3229
3310
  <div class="paragraph"><p>Deprecated in favor of <a href="#PassengerRuby">PassengerRuby</a>.</p></div>
3230
3311
  </div>
3231
3312
  <div class="sect3">
3232
- <h4 id="_railsuserswitching">5.16.2. RailsUserSwitching</h4>
3313
+ <h4 id="_railsuserswitching">5.17.2. RailsUserSwitching</h4>
3233
3314
  <div class="paragraph"><p>Deprecated in favor of <a href="#PassengerUserSwitching">PassengerUserSwitching</a>.</p></div>
3234
3315
  </div>
3235
3316
  <div class="sect3">
3236
- <h4 id="_railsdefaultuser">5.16.3. RailsDefaultUser</h4>
3317
+ <h4 id="_railsdefaultuser">5.17.3. RailsDefaultUser</h4>
3237
3318
  <div class="paragraph"><p>Deprecated in favor of <a href="#PassengerDefaultUser">PassengerDefaultUser</a>.</p></div>
3238
3319
  </div>
3239
3320
  <div class="sect3">
3240
- <h4 id="_railsallowmodrewrite">5.16.4. RailsAllowModRewrite</h4>
3321
+ <h4 id="_railsallowmodrewrite">5.17.4. RailsAllowModRewrite</h4>
3241
3322
  <div class="paragraph"><p>This option doesn&#8217;t do anything anymore in recent versions of Phusion Passenger.</p></div>
3242
3323
  </div>
3243
3324
  <div class="sect3">
3244
- <h4 id="_railsspawnmethod">5.16.5. RailsSpawnMethod</h4>
3325
+ <h4 id="_railsspawnmethod">5.17.5. RailsSpawnMethod</h4>
3245
3326
  <div class="paragraph"><p>Deprecated in favor of <a href="#PassengerSpawnMethod">PassengerSpawnMethod</a>.</p></div>
3246
3327
  </div>
3247
3328
  </div>
@@ -4781,7 +4862,7 @@ has no effect.</p></div>
4781
4862
  <div id="footnotes"><hr></div>
4782
4863
  <div id="footer">
4783
4864
  <div id="footer-text">
4784
- Last updated 2011-08-11 22:39:09 CEST
4865
+ Last updated 2011-11-24 19:06:50 CET
4785
4866
  </div>
4786
4867
  </div>
4787
4868
  </body>
@@ -923,6 +923,70 @@ allow the attacker to cause a Denial-of-Service.
923
923
  You can prevent this from happening by pointing PassengerRestartDir to a
924
924
  directory that's readable by Apache, but only writable by administrators.
925
925
 
926
+ [[PassengerBufferResponse]]
927
+ === PassengerBufferResponse <on|off> ===
928
+ When turned on, application-generated responses are buffered in memory. By buffering
929
+ responses, protection is provided against slow HTTP clients that can not read your
930
+ response immediately.
931
+
932
+ For example, consider an HTTP client that's on a dial-up modem link, and your
933
+ application instance generates a 2 MB response. If response buffering is turned
934
+ off then your application instance will be blocked until the entire 2 MB has been
935
+ sent out to the HTTP client. This disallows your application instance to do any useful
936
+ work in the mean time. By enabling response buffering, Phusion Passenger will read
937
+ the application response as quickly as possible and will take care of slow clients.
938
+
939
+ However, keep in mind that enabling this option will make streaming responses
940
+ impossible. Consider for example this piece of Rails code:
941
+
942
+ --------------------------------
943
+ render :text => lambda { |response, output|
944
+ 10.times do |i|
945
+ output.write("entry #{i}\n")
946
+ output.flush
947
+ sleep 1
948
+ end
949
+ }
950
+ --------------------------------
951
+
952
+ ...or this piece of Rack code:
953
+
954
+ --------------------------------
955
+ class Response
956
+ def each
957
+ 10.times do |i|
958
+ yield("entry #{i}\n")
959
+ sleep 1
960
+ end
961
+ end
962
+ end
963
+
964
+ app = lambda do |env|
965
+ [200, { "Content-Type" => "text/plain" }, Response.new]
966
+ end
967
+ --------------------------------
968
+
969
+ When response buffering is turned on, Phusion Passenger will wait until
970
+ the application is done sending the entire response before forwarding it
971
+ to the client. The client will not receive anything for 10 seconds,
972
+ after which it receives the entire response at once.
973
+ When response buffering is turned off, it works as expected: the client
974
+ receives an "entry X" message every second for 10 seconds.
975
+
976
+ This option may occur in the following places:
977
+
978
+ * In the global server configuration.
979
+ * In a virtual host configuration block.
980
+ * In a `<Directory>` or `<Location>` block.
981
+ * In '.htaccess'.
982
+
983
+ In each place, it may be specified at most once. The default value is 'on'.
984
+
985
+ [NOTE]
986
+ =====================================================
987
+ The <<PassengerBufferResponse,PassengerBufferResponse>> directive should be turned off
988
+ if responses can be huge. Because entire responses are buffered in memory when turned on.
989
+ =====================================================
926
990
 
927
991
  === Security options ===
928
992