passenger 4.0.1 → 4.0.2

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.

@@ -1,9 +1,9 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
- <meta name="generator" content="AsciiDoc 8.6.7">
6
- <title>Phusion Passenger users guide, Nginx version</title>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <meta name="generator" content="AsciiDoc 8.6.7">
6
+ <title>Phusion Passenger users guide, Nginx version</title>
7
7
  <style type="text/css">
8
8
  /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
9
9
 
@@ -603,7 +603,7 @@ div.exampleblock > div.content, div.sidebarblock > div.content, div.listingblock
603
603
  div.verseblock { border-left-width: 0; margin-left: 3em; }
604
604
  div.quoteblock { border-left-width: 3px; margin-left: 0; margin-right: 0;}
605
605
  div.admonitionblock td.content { border-left: 3px solid #E8E8E8; }
606
- </style>
606
+ </style>
607
607
  <script type="text/javascript">
608
608
  /*<![CDATA[*/
609
609
  var asciidoc = { // Namespace.
@@ -797,7 +797,8 @@ install: function(toclevels) {
797
797
  }
798
798
  asciidoc.install();
799
799
  /*]]>*/
800
- </script><style type="text/css">
800
+ </script>
801
+ <style type="text/css">
801
802
  body {
802
803
  margin: 1em auto 1em auto;
803
804
  padding: 0 1em 0 1em;
@@ -1054,11 +1055,12 @@ pre {
1054
1055
  }
1055
1056
 
1056
1057
  </style>
1057
- </head>
1058
+ </head>
1058
1059
  <body class="article">
1059
1060
  <div id="topbar" style="display: none">
1060
1061
  <div class="title">
1061
- <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt=""><a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger users guide, Nginx version</a>
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 users guide, Nginx version</a>
1062
1064
  </div>
1063
1065
  <a href="javascript:void(0)" id="current_section"></a>
1064
1066
  </div>
@@ -1068,12 +1070,13 @@ pre {
1068
1070
  <div class="sectionbody">
1069
1071
  <div class="paragraph"><p><span class="image">
1070
1072
  <a class="image" href="http://www.phusion.nl/">
1071
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
1073
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
1074
+ </a>
1072
1075
  </span></p></div>
1073
1076
  <div class="paragraph"><p>Phusion Passenger is an application server which can directly integrate into Nginx. It is designed to be easy to use, fast, stable and reliable and is used by <a href="http://trends.builtwith.com/Web-Server/Phusion-Passenger">hundreds of thousands of websites</a> all over the world.</p></div>
1074
1077
  <div class="paragraph"><p>Phusion Passenger is a so-called polyglot application server because it supports applications written in multiple programming languages. At this time, Ruby and Python are supported.</p></div>
1075
1078
  <div class="paragraph"><p>This users guide will teach you:</p></div>
1076
- <div class="ulist"><ul>
1079
+ <div class="ulist"><ul>
1077
1080
  <li>
1078
1081
  <p>
1079
1082
  How to install Nginx with Phusion Passenger support.
@@ -1258,7 +1261,7 @@ if it doesn’t work on your POSIX-compliant operating system.</p></div>
1258
1261
  </div>
1259
1262
  <div class="sect2">
1260
1263
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_where_to_get_support"></span><h3 data-comment-topic="where-to-get-support-2s9na5" data-anchor="_where_to_get_support">1.2. Where to get support</h3>
1261
- <div class="ulist"><ul>
1264
+ <div class="ulist"><ul>
1262
1265
  <li>
1263
1266
  <p>
1264
1267
  <a href="http://code.google.com/p/phusion-passenger/issues/list">Issue tracker</a> - report
@@ -1297,7 +1300,7 @@ Report security vulnerabilities to <a href="mailto:support@phusion.nl">support@p
1297
1300
  <div class="sect2">
1298
1301
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_synopsis"></span><h3 data-comment-topic="synopsis-1uu3sqp" data-anchor="_synopsis">2.1. Synopsis</h3>
1299
1302
  <div class="paragraph"><p>The Phusion Passenger installation process consists of two steps:</p></div>
1300
- <div class="olist arabic"><ol class="arabic">
1303
+ <div class="olist arabic"><ol class="arabic">
1301
1304
  <li>
1302
1305
  <p>
1303
1306
  The <strong>obtainment step</strong>, where you download the Phusion Passenger files puts them somewhere on your system. This can be done through downloading the source tarball, installing the Ruby gem or installing a native OS package via APT or YUM.
@@ -1325,7 +1328,7 @@ The <strong>integration step</strong>, where you configure Phusion Passenger so
1325
1328
  </div>
1326
1329
  </div>
1327
1330
  <div class="paragraph"><p>Do you see a filename that references <em>/home</em> or <em>/Users</em>? If so then your Ruby interpreter is installed in your home directory and you can proceed to step 2. Otherwise, you need to switch to a root prompt by running one of the following commands:</p></div>
1328
- <div class="ulist"><ul>
1331
+ <div class="ulist"><ul>
1329
1332
  <li>
1330
1333
  <p>
1331
1334
  Are you using RVM? Run <span class="monospaced">rvmsudo -s</span>
@@ -1384,7 +1387,7 @@ Is <em>sudo</em> not installed on your system? Run <span class="monospaced">su -
1384
1387
  </div>
1385
1388
  <span class="anchor_helper" id="add_rubygems_bin_dir_to_path"></span><h4 class="float" data-anchor="add_rubygems_bin_dir_to_path">Step 3: add the RubyGems bin directory to your $PATH</h4>
1386
1389
  <div class="paragraph"><p>If you all of the following are applicable to you:</p></div>
1387
- <div class="ulist"><ul>
1390
+ <div class="ulist"><ul>
1388
1391
  <li>
1389
1392
  <p>
1390
1393
  You are on Debian or Ubuntu,
@@ -1432,7 +1435,7 @@ chmod o+x /home/phusion</pre>
1432
1435
  <div class="paragraph"><p>If you’ve already installed Nginx before, but without Phusion Passenger support, then you <strong>should</strong> uninstall it first. You don’t have to, because you can also install another Nginx with Phusion Passenger support, in parallel to the existing Nginx. We merely recommend uninstalling the existing in order to avoid user confusion, but the choice is yours.</p></div>
1433
1436
  <div class="paragraph"><p>If you had previously installed Nginx with Phusion Passenger support, and you are upgrading, then you don’t have to uninstall your existing Nginx first. Instead we’ll overwrite it this step.</p></div>
1434
1437
  <div class="paragraph"><p>Here’s how you can uninstall the original Nginx:</p></div>
1435
- <div class="ulist"><ul>
1438
+ <div class="ulist"><ul>
1436
1439
  <li>
1437
1440
  <p>
1438
1441
  If you installed the existing Nginx through APT, run: <span class="monospaced">sudo apt-get remove nginx nginx-full nginx-light nginx-naxsi nginx-common</span>
@@ -1466,7 +1469,7 @@ At this point you may be interested in <a href="#nginx_init_script">creating an
1466
1469
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="tarball_generic_install"></span><h3 data-comment-topic="generic-installation-upgrade-and-downgrade-method-via-tarball-2gkx43" data-anchor="tarball_generic_install">2.3. Generic installation, upgrade and downgrade method: via tarball</h3>
1467
1470
  <span class="anchor_helper" id="_step_1_download_and_extract_the_tarball"></span><h4 class="float" data-anchor="_step_1_download_and_extract_the_tarball">Step 1: download and extract the tarball</h4>
1468
1471
  <div class="paragraph"><p>Download the open source Phusion Passenger tarball from <a href="https://www.phusionpassenger.com/download#open_source">the Phusion Passenger website</a>. Specific older versions are not found on the Phusion Passenger website, but are found in the following places:</p></div>
1469
- <div class="ulist"><ul>
1472
+ <div class="ulist"><ul>
1470
1473
  <li>
1471
1474
  <p>
1472
1475
  All versions starting from 4.0.0 can be found on <a href="https://code.google.com/p/phusion-passenger/downloads/list">Google Code</a>.
@@ -1741,7 +1744,7 @@ sudo apt-get update</pre>
1741
1744
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_upgrading_from_open_source_to_enterprise"></span><h3 data-comment-topic="upgrading-from-open-source-to-enterprise-1a58c2b" data-anchor="_upgrading_from_open_source_to_enterprise">2.6. Upgrading from open source to Enterprise</h3>
1742
1745
  <div class="paragraph"><p>Phusion Passenger comes in two variants: an open source version, as well as an <a href="https://www.phusionpassenger.com/enterprise">Enterprise version</a> which introduces a myriad of useful features that can improve stability and performance and efficiency.</p></div>
1743
1746
  <div class="paragraph"><p>Customers who have bought Phusion Passenger Enterprise can upgrade their open source installation to Enterprise as follows:</p></div>
1744
- <div class="olist arabic"><ol class="arabic">
1747
+ <div class="olist arabic"><ol class="arabic">
1745
1748
  <li>
1746
1749
  <p>
1747
1750
  <a href="#uninstalling">Uninstall the open source Phusion Passenger</a>.
@@ -1877,7 +1880,7 @@ export CXX='ccache clang++ -fcolor-diagnostics -Qunused-arguments -fcatch-undefi
1877
1880
  <div class="sect3">
1878
1881
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_adding_additional_compiler_or_linker_flags"></span><h4 data-comment-topic="adding-additional-compiler-or-linker-flags-1jehjon" data-anchor="_adding_additional_compiler_or_linker_flags">2.9.2. Adding additional compiler or linker flags</h4>
1879
1882
  <div class="paragraph"><p>On some systems, C/C++ libraries and headers that Phusion Passenger requires may be located in a non-standard directory. You can force the Phusion Passenger build system to look in those locations by injecting compiler and linker flags using the following environment variables:</p></div>
1880
- <div class="dlist"><dl>
1883
+ <div class="dlist"><dl>
1881
1884
  <dt class="hdlist1">
1882
1885
  <span class="monospaced">EXTRA_PRE_CFLAGS</span>
1883
1886
  </dt>
@@ -1932,7 +1935,7 @@ export CXX='ccache clang++ -fcolor-diagnostics -Qunused-arguments -fcatch-undefi
1932
1935
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_forcing_location_of_certain_command_line_tools"></span><h4 data-comment-topic="forcing-location-of-certain-command-line-tools-1j93cki" data-anchor="_forcing_location_of_certain_command_line_tools">2.9.3. Forcing location of certain command line tools</h4>
1933
1936
  <div class="paragraph"><p>The Phusion Passenger build system attempts to autodetect many things by locating relevant helper tools. For example, to find out which compiler flags it should use for compiling Apache modules, it locates the <span class="monospaced">apxs2</span> command and queries it. To find out which compiler flags it should use for libcurl, it queries the <span class="monospaced">curl-config</span> command. These commands may not be in <span class="monospaced">$PATH</span>, or even when they are you may want to use a different one.</p></div>
1934
1937
  <div class="paragraph"><p>You can often force the build to find certain command line tools at certain locations by using the following environment variables:</p></div>
1935
- <div class="dlist"><dl>
1938
+ <div class="dlist"><dl>
1936
1939
  <dt class="hdlist1">
1937
1940
  <span class="monospaced">HTTPD</span>
1938
1941
  </dt>
@@ -2012,7 +2015,7 @@ line into your Nginx configuration file:</p></div>
2012
2015
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="nginx_init_script"></span><h3 data-comment-topic="creating-an-nginx-init-script-1kd8zg5" data-anchor="nginx_init_script">2.11. Creating an Nginx init script</h3>
2013
2016
  <div class="paragraph"><p>If you installed Nginx with one of the generic installation methods then you won’t have an init script to start, stop and restart Nginx with. A bare Nginx installation works with signals: you start it by invoking it from the command line, you stop it by sending SIGTERM to it and you gracefully restart it by sending SIGHUP to it.</p></div>
2014
2017
  <div class="paragraph"><p>If you prefer to use an init script then please refer to the following resources:</p></div>
2015
- <div class="ulist"><ul>
2018
+ <div class="ulist"><ul>
2016
2019
  <li>
2017
2020
  <p>
2018
2021
  <a href="http://wiki.nginx.org/Nginx-init-ubuntu">Init script for Ubuntu 8.04-9.10</a>
@@ -2092,7 +2095,7 @@ http {
2092
2095
  <div class="paragraph"><p>To uninstall Phusion Passenger, please first remove all Phusion Passenger
2093
2096
  configuration directives from your web server configuration file(s). After you’ve
2094
2097
  done this, you need to remove the Phusion Passenger files.</p></div>
2095
- <div class="ulist"><ul>
2098
+ <div class="ulist"><ul>
2096
2099
  <li>
2097
2100
  <p>
2098
2101
  If you installed Phusion Passenger via a Ruby gem, then run <span class="monospaced">gem uninstall passenger</span> (or, if you’re an <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> user, <span class="monospaced">gem uninstall passenger-enterprise-server</span>).
@@ -2143,14 +2146,14 @@ virtual host’s root (i.e. the application will be accessible from the root URL
2143
2146
  <em>http://www.mycook.com/</em>), or in a sub URI (i.e. the application will be
2144
2147
  accessible from a sub URL, such as <em>http://www.mycook.com/railsapplication</em>).</p></div>
2145
2148
  <div class="admonitionblock">
2146
- <table><tr>
2149
+ <table><tr>
2147
2150
  <td class="icon">
2148
- <img src="./images/icons/note.png" alt="Note">
2151
+ <img src="./images/icons/note.png" alt="Note">
2149
2152
  </td>
2150
2153
  <td class="content">The default <span class="monospaced">RAILS_ENV</span> environment in which deployed Rails applications
2151
2154
  are run, is “production”. You can change this by changing the
2152
2155
  <a href="#RailsEnv">rails_env</a> configuration option.</td>
2153
- </tr></table>
2156
+ </tr></table>
2154
2157
  </div>
2155
2158
  <div class="sect2">
2156
2159
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deploying_to_a_virtual_host_8217_s_root"></span><h3 data-comment-topic="deploying-to-a-virtual-host-s-root-1mh24z5" data-anchor="_deploying_to_a_virtual_host_8217_s_root">3.1. Deploying to a virtual host’s root</h3>
@@ -2224,9 +2227,9 @@ option to the <em>server</em> block:</p></div>
2224
2227
  </div>
2225
2228
  <div class="paragraph"><p>Then restart Nginx. The application has now been deployed.</p></div>
2226
2229
  <div class="admonitionblock">
2227
- <table><tr>
2230
+ <table><tr>
2228
2231
  <td class="icon">
2229
- <img src="./images/icons/tip.png" alt="Tip">
2232
+ <img src="./images/icons/tip.png" alt="Tip">
2230
2233
  </td>
2231
2234
  <td class="content">
2232
2235
  <div class="paragraph"><p>You can deploy multiple Rails applications under a virtual host, by specifying
@@ -2242,7 +2245,7 @@ option to the <em>server</em> block:</p></div>
2242
2245
  </div>
2243
2246
  </div>
2244
2247
  </td>
2245
- </tr></table>
2248
+ </tr></table>
2246
2249
  </div>
2247
2250
  </div>
2248
2251
  <div class="sect2">
@@ -2250,7 +2253,7 @@ option to the <em>server</em> block:</p></div>
2250
2253
  <div class="paragraph"><p>Deploying a new version of a Ruby on Rails application is as simple as
2251
2254
  re-uploading the application files, and restarting the application.</p></div>
2252
2255
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2253
- <div class="olist arabic"><ol class="arabic">
2256
+ <div class="olist arabic"><ol class="arabic">
2254
2257
  <li>
2255
2258
  <p>
2256
2259
  By restarting Nginx.
@@ -2297,7 +2300,7 @@ a shell console, just like one would normally run migrations.</p></div>
2297
2300
  <div class="paragraph"><p>Phusion Passenger assumes that Rack application directories have a certain layout.
2298
2301
  Suppose that you have a Rack application in <em>/webapps/rackapp</em>. Then that
2299
2302
  folder must contain at least three entries:</p></div>
2300
- <div class="ulist"><ul>
2303
+ <div class="ulist"><ul>
2301
2304
  <li>
2302
2305
  <p>
2303
2306
  <em>config.ru</em>, a Rackup file for starting the Rack application. This file must contain
@@ -2333,14 +2336,14 @@ to the virtual host’s root (i.e. the application will be accessible from the r
2333
2336
  <em>http://www.rackapp.com/</em>), or in a sub URI (i.e. the application will be
2334
2337
  accessible from a sub URL, such as <em>http://www.rackapp.com/rackapp</em>).</p></div>
2335
2338
  <div class="admonitionblock">
2336
- <table><tr>
2339
+ <table><tr>
2337
2340
  <td class="icon">
2338
- <img src="./images/icons/note.png" alt="Note">
2341
+ <img src="./images/icons/note.png" alt="Note">
2339
2342
  </td>
2340
2343
  <td class="content">The default <span class="monospaced">RACK_ENV</span> environment in which deployed Rack applications
2341
2344
  are run, is “production”. You can change this by changing the
2342
2345
  <a href="#RackEnv">rack_env</a> configuration option.</td>
2343
- </tr></table>
2346
+ </tr></table>
2344
2347
  </div>
2345
2348
  <div class="sect2">
2346
2349
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_tutorial_example_writing_and_deploying_a_hello_world_rack_application"></span><h3 data-comment-topic="tutorial-example-writing-and-deploying-a-hello-world-rack-application-1wstx99" data-anchor="_tutorial_example_writing_and_deploying_a_hello_world_rack_application">4.1. Tutorial/example: writing and deploying a Hello World Rack application</h3>
@@ -2455,9 +2458,9 @@ option to the <em>server</em> block:</p></div>
2455
2458
  </div>
2456
2459
  <div class="paragraph"><p>Then restart Nginx. The application has now been deployed.</p></div>
2457
2460
  <div class="admonitionblock">
2458
- <table><tr>
2461
+ <table><tr>
2459
2462
  <td class="icon">
2460
- <img src="./images/icons/tip.png" alt="Tip">
2463
+ <img src="./images/icons/tip.png" alt="Tip">
2461
2464
  </td>
2462
2465
  <td class="content">
2463
2466
  <div class="paragraph"><p>You can deploy multiple Rack applications under a virtual host, by specifying
@@ -2473,7 +2476,7 @@ option to the <em>server</em> block:</p></div>
2473
2476
  </div>
2474
2477
  </div>
2475
2478
  </td>
2476
- </tr></table>
2479
+ </tr></table>
2477
2480
  </div>
2478
2481
  </div>
2479
2482
  <div class="sect2">
@@ -2481,7 +2484,7 @@ option to the <em>server</em> block:</p></div>
2481
2484
  <div class="paragraph"><p>Deploying a new version of a Rack application is as simple as
2482
2485
  re-uploading the application files, and restarting the application.</p></div>
2483
2486
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2484
- <div class="olist arabic"><ol class="arabic">
2487
+ <div class="olist arabic"><ol class="arabic">
2485
2488
  <li>
2486
2489
  <p>
2487
2490
  By restarting Nginx.
@@ -2604,7 +2607,7 @@ run Sinatra::Application</pre>
2604
2607
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_deploying_a_wsgi_python_application"></span><h2 data-comment-topic="deploying-a-wsgi-python-application-1or2efo" data-anchor="_deploying_a_wsgi_python_application">5. Deploying a WSGI (Python) application</h2>
2605
2608
  <div class="sectionbody">
2606
2609
  <div class="paragraph"><p>Phusion Passenger supports all WSGI-compliant Python web applications. Suppose that you have a WSGI application in <em>/webapps/wsgiapp</em>. Then that folder must contain at least three entries:</p></div>
2607
- <div class="ulist"><ul>
2610
+ <div class="ulist"><ul>
2608
2611
  <li>
2609
2612
  <p>
2610
2613
  <em>passenger_wsgi.py</em>, which Phusion Passenger will use as the main entry point for your application. This file must export a WSGI object called <span class="monospaced">application</span>.
@@ -2701,7 +2704,7 @@ root must point to your WSGI application’s <em>public</em> folder. You must al
2701
2704
  <div class="paragraph"><p>Deploying a new version of a WSGI application is as simple as
2702
2705
  re-uploading the application files, and restarting the application.</p></div>
2703
2706
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2704
- <div class="olist arabic"><ol class="arabic">
2707
+ <div class="olist arabic"><ol class="arabic">
2705
2708
  <li>
2706
2709
  <p>
2707
2710
  By restarting Nginx.
@@ -2747,7 +2750,7 @@ this option as well. Please read
2747
2750
  <div class="paragraph"><p>The <span class="monospaced">passenger_ruby</span> option allows one to specify the Ruby interpreter to use. Similarly, the <span class="monospaced">passenger_python</span> option is for specifying the Python interpreter.</p></div>
2748
2751
  <div class="paragraph"><p>In versions prior to 4.0.0, only a single Ruby version was supported for the entire Nginx instance, so <span class="monospaced">passenger_ruby</span> may only occur in the global server configuration. Also, the <span class="monospaced">passenger_python</span> option was not supported.</p></div>
2749
2752
  <div class="paragraph"><p>Since version 4.0.0, the <span class="monospaced">passenger_python</span> option was added. Also, Phusion Passenger supports multiple Ruby or Python interpreters in the same Nginx instance. And so, since version 4.0.0, this option may occur in the following places:</p></div>
2750
- <div class="ulist"><ul>
2753
+ <div class="ulist"><ul>
2751
2754
  <li>
2752
2755
  <p>
2753
2756
  In the <em>http</em> configuration block.
@@ -2888,7 +2891,7 @@ is the parent directory of the <em>public</em> directory. This option allows one
2888
2891
  specify the application’s root independently from the Nginx <em>root</em>, which
2889
2892
  is useful if the <em>public</em> directory lives in a non-standard place.</p></div>
2890
2893
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2891
- <div class="ulist"><ul>
2894
+ <div class="ulist"><ul>
2892
2895
  <li>
2893
2896
  <p>
2894
2897
  In the <em>http</em> configuration block.
@@ -2928,9 +2931,9 @@ In an <em>if</em> configuration scope.
2928
2931
  <div class="sect2">
2929
2932
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerSpawnMethod"></span><h3 data-comment-topic="passenger-spawn-method-string--1sc6njl" data-anchor="PassengerSpawnMethod">6.5. passenger_spawn_method &lt;string&gt;</h3>
2930
2933
  <div class="admonitionblock">
2931
- <table><tr>
2934
+ <table><tr>
2932
2935
  <td class="icon">
2933
- <img src="./images/icons/tip.png" alt="Tip">
2936
+ <img src="./images/icons/tip.png" alt="Tip">
2934
2937
  </td>
2935
2938
  <td class="content">
2936
2939
  <div class="title">"What spawn method should I use?"</div>
@@ -2945,12 +2948,12 @@ understand it, as it’s mostly a technical detail. You can basically follow thi
2945
2948
  <div class="paragraph"><p>However, we do recommend you to try to understand it. The <em>smart</em> spawn
2946
2949
  method brings many benefits.</p></div>
2947
2950
  </td>
2948
- </tr></table>
2951
+ </tr></table>
2949
2952
  </div>
2950
2953
  <div class="paragraph"><p>Internally, Phusion Passenger spawns multiple Ruby application processes in order to handle
2951
2954
  requests. But there are multiple ways with which processes can be spawned, each having
2952
2955
  its own set of pros and cons. Supported spawn methods are:</p></div>
2953
- <div class="dlist"><dl>
2956
+ <div class="dlist"><dl>
2954
2957
  <dt class="hdlist1">
2955
2958
  <em>smart</em>
2956
2959
  </dt>
@@ -2994,7 +2997,7 @@ to <em>smart</em>. The old <em>smart</em> spawning has been removed in favor of
2994
2997
  </div>
2995
2998
  </div>
2996
2999
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2997
- <div class="ulist"><ul>
3000
+ <div class="ulist"><ul>
2998
3001
  <li>
2999
3002
  <p>
3000
3003
  In the <em>http</em> configuration block.
@@ -3028,7 +3031,7 @@ of a new application process could take a while, and any requests that
3028
3031
  come in during this time will be blocked until this first application
3029
3032
  process has spawned.</p></div>
3030
3033
  <div class="paragraph"><p>But when rolling restarts are enabled, Phusion Passenger Enterprise will:</p></div>
3031
- <div class="olist arabic"><ol class="arabic">
3034
+ <div class="olist arabic"><ol class="arabic">
3032
3035
  <li>
3033
3036
  <p>
3034
3037
  Spawn a new process in the background.
@@ -3047,7 +3050,7 @@ Step 1 and 2 are repeated until all processes have been replaced.
3047
3050
  </ol></div>
3048
3051
  <div class="paragraph"><p>This way, visitors will not experience any delays when you are restarting your application. This allows you to, for example, upgrade your application often without degrading user experience.</p></div>
3049
3052
  <div class="paragraph"><p>Rolling restarts have a few caveat however that you should be aware of:</p></div>
3050
- <div class="ulist"><ul>
3053
+ <div class="ulist"><ul>
3051
3054
  <li>
3052
3055
  <p>
3053
3056
  Upgrading an application sometimes involves upgrading the database schema.
@@ -3067,7 +3070,7 @@ Because there’s no telling which process will serve a request, users may
3067
3070
  </li>
3068
3071
  </ul></div>
3069
3072
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3070
- <div class="ulist"><ul>
3073
+ <div class="ulist"><ul>
3071
3074
  <li>
3072
3075
  <p>
3073
3076
  In the <em>http</em> configuration block.
@@ -3097,7 +3100,7 @@ In an <em>if</em> configuration scope.
3097
3100
  <div class="paragraph"><p>Enables or disables resistance against deployment errors.</p></div>
3098
3101
  <div class="paragraph"><p>Suppose you’ve upgraded your application and you’ve issues a command to restart it (by touching restart.txt), but the application code contains an error that prevents Phusion Passenger from successfully spawning a process (e.g. a syntax error). Phusion Passenger would normally display an error message in response to this.</p></div>
3099
3102
  <div class="paragraph"><p>By enabling deployment error resistance, Phusion Passenger Enterprise would instead do this:</p></div>
3100
- <div class="ulist"><ul>
3103
+ <div class="ulist"><ul>
3101
3104
  <li>
3102
3105
  <p>
3103
3106
  It passes the request to one of the existing application processes (that belong to the previous version of the application). The visitor will not see a Phusion Passenger process spawning error message.
@@ -3117,7 +3120,7 @@ It sets an internal flag so that no processes for this application will be spawn
3117
3120
  <div class="paragraph"><p>This way, visitors will suffer minimally from deployment errors. Phusion Passenger will attempt to restart the application again next time restart.txt is touched.</p></div>
3118
3121
  <div class="paragraph"><p>Enabling deployment error resistance only works if <a href="#PassengerRollingRestarts">rolling restart</a> is also enabled.</p></div>
3119
3122
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3120
- <div class="ulist"><ul>
3123
+ <div class="ulist"><ul>
3121
3124
  <li>
3122
3125
  <p>
3123
3126
  In the <em>http</em> configuration block.
@@ -3192,7 +3195,7 @@ for an example.</p></div>
3192
3195
  <div class="paragraph"><p>It is allowed to specify this option multiple times. Do this to deploy multiple
3193
3196
  applications in different sub-URIs under the same virtual host.</p></div>
3194
3197
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3195
- <div class="ulist"><ul>
3198
+ <div class="ulist"><ul>
3196
3199
  <li>
3197
3200
  <p>
3198
3201
  In the <em>http</em> configuration block.
@@ -3230,7 +3233,7 @@ read the application process’s response while discarding all the read data. Th
3230
3233
  EPIPE errors but it’ll also mean the backend process will be unavailable for new requests
3231
3234
  until it is done sending its response.</p></div>
3232
3235
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3233
- <div class="ulist"><ul>
3236
+ <div class="ulist"><ul>
3234
3237
  <li>
3235
3238
  <p>
3236
3239
  In the <em>http</em> configuration block.
@@ -3282,7 +3285,7 @@ passenger_set_cgi_param HTTP_X_FORWARDED_FOR 127.0.0.2;</pre>
3282
3285
  </div>
3283
3286
  </div>
3284
3287
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3285
- <div class="ulist"><ul>
3288
+ <div class="ulist"><ul>
3286
3289
  <li>
3287
3290
  <p>
3288
3291
  In the <em>http</em> configuration block.
@@ -3320,7 +3323,7 @@ anyway, similar to how <em>proxy_pass_header</em> works.</p></div>
3320
3323
  </div>
3321
3324
  </div>
3322
3325
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3323
- <div class="ulist"><ul>
3326
+ <div class="ulist"><ul>
3324
3327
  <li>
3325
3328
  <p>
3326
3329
  In the <em>http</em> configuration block.
@@ -3348,7 +3351,7 @@ In an <em>if</em> configuration scope.
3348
3351
  <div class="paragraph"><p>When turned on, application-generated responses are buffered by Nginx. Buffering will
3349
3352
  happen in memory and also on disk if the response is larger than a certain threshold.</p></div>
3350
3353
  <div class="paragraph"><p>Before we proceed with explaining this configuration option, we want to state the following to avoid confusion. If you use Phusion Passenger for Nginx, there are in fact two response buffering systems active:</p></div>
3351
- <div class="olist arabic"><ol class="arabic">
3354
+ <div class="olist arabic"><ol class="arabic">
3352
3355
  <li>
3353
3356
  <p>
3354
3357
  The Nginx response buffering system. <span class="monospaced">passenger_buffer_response</span> turns this on or off.
@@ -3408,7 +3411,7 @@ after which it receives the entire response at once.
3408
3411
  When <span class="monospaced">passenger_buffer_response</span> is turned off, it works as expected: the client
3409
3412
  receives an "entry X" message every second for 10 seconds.</p></div>
3410
3413
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3411
- <div class="ulist"><ul>
3414
+ <div class="ulist"><ul>
3412
3415
  <li>
3413
3416
  <p>
3414
3417
  In the <em>http</em> configuration block.
@@ -3460,7 +3463,7 @@ by default run the web application as the owner of the file <em>config/environme
3460
3463
  that behavior and explicitly set a user to run the web application as, regardless
3461
3464
  of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</p></div>
3462
3465
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3463
- <div class="ulist"><ul>
3466
+ <div class="ulist"><ul>
3464
3467
  <li>
3465
3468
  <p>
3466
3469
  In the <em>http</em> configuration block.
@@ -3494,7 +3497,7 @@ as, regardless of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</
3494
3497
  <div class="paragraph"><p><em>&lt;group name&gt;</em> may also be set to the special value <em>!STARTUP_FILE!</em>, in which case
3495
3498
  the web application’s group will be set to <em>environment.rb</em>/<em>config.ru</em>'s group.</p></div>
3496
3499
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3497
- <div class="ulist"><ul>
3500
+ <div class="ulist"><ul>
3498
3501
  <li>
3499
3502
  <p>
3500
3503
  In the <em>http</em> configuration block.
@@ -3552,7 +3555,7 @@ X-Powered-By: Phusion Passenger</pre>
3552
3555
  </div>
3553
3556
  </div>
3554
3557
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3555
- <div class="ulist"><ul>
3558
+ <div class="ulist"><ul>
3556
3559
  <li>
3557
3560
  <p>
3558
3561
  In the <em>http</em> configuration block.
@@ -3586,7 +3589,7 @@ but the page might reveal potentially sensitive information, depending on the
3586
3589
  application. Experienced system administrators who are using Phusion Passenger
3587
3590
  on serious production servers should consider turning this feature off.</p></div>
3588
3591
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3589
- <div class="ulist"><ul>
3592
+ <div class="ulist"><ul>
3590
3593
  <li>
3591
3594
  <p>
3592
3595
  In the <em>http</em> configuration block.
@@ -3631,7 +3634,7 @@ non-zero value if you want to avoid potentially long startup times after a websi
3631
3634
  has been <a href="#idle_process">idle</a> for an extended period.</p></div>
3632
3635
  <div class="paragraph"><p>Please note that this option does <strong>not</strong> pre-start application processes during Nginx
3633
3636
  startup. It just makes sure that when the application is first accessed:</p></div>
3634
- <div class="olist arabic"><ol class="arabic">
3637
+ <div class="olist arabic"><ol class="arabic">
3635
3638
  <li>
3636
3639
  <p>
3637
3640
  at least the given number of processes will be spawned.
@@ -3674,7 +3677,7 @@ simultanously. Phusion Passenger will start 12 more application processes. After
3674
3677
  timeout of 10 seconds have passed, Phusion Passenger will clean up 12 application
3675
3678
  processes, keeping 3 processes around.</p></div>
3676
3679
  <div class="paragraph"><p>The passenger_min_instances option may occur in the following places:</p></div>
3677
- <div class="ulist"><ul>
3680
+ <div class="ulist"><ul>
3678
3681
  <li>
3679
3682
  <p>
3680
3683
  In the <em>http</em> configuration block.
@@ -3709,7 +3712,7 @@ means that there is no limit placed on the number of processes a single applicat
3709
3712
  may spawn, i.e. only the global limit of <a href="#PassengerMaxPoolSize">passenger_max_pool_size</a>
3710
3713
  will be enforced.</p></div>
3711
3714
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3712
- <div class="ulist"><ul>
3715
+ <div class="ulist"><ul>
3713
3716
  <li>
3714
3717
  <p>
3715
3718
  In the <em>http</em> configuration block.
@@ -3733,9 +3736,9 @@ In an <em>if</em> configuration scope.
3733
3736
  </ul></div>
3734
3737
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
3735
3738
  <div class="admonitionblock">
3736
- <table><tr>
3739
+ <table><tr>
3737
3740
  <td class="icon">
3738
- <img src="./images/icons/tip.png" alt="Tip">
3741
+ <img src="./images/icons/tip.png" alt="Tip">
3739
3742
  </td>
3740
3743
  <td class="content">
3741
3744
  <div class="title">Practical usage example</div>
@@ -3746,7 +3749,7 @@ to 10. The e-commerce website is more important to you. You can then set
3746
3749
  than 3 processes, even if it suddenly gets a lot of traffic. Your e-commerce website
3747
3750
  on the other hand will be free to spawn up to 10 processes if it gets a lot of traffic.</p></div>
3748
3751
  </td>
3749
- </tr></table>
3752
+ </tr></table>
3750
3753
  </div>
3751
3754
  </div>
3752
3755
  <div class="sect3">
@@ -3798,7 +3801,7 @@ you’re using the <em>smart</em> or <em>smart-lv2</em> <a href="#RailsSpawnMeth
3798
3801
  system has enough memory, is it recommended that you set this option to a high
3799
3802
  value or to <em>0</em>.</p></div>
3800
3803
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3801
- <div class="ulist"><ul>
3804
+ <div class="ulist"><ul>
3802
3805
  <li>
3803
3806
  <p>
3804
3807
  In the <em>http</em> configuration block.
@@ -3826,7 +3829,7 @@ In an <em>if</em> configuration scope.
3826
3829
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerConcurrencyModel"></span><h4 data-comment-topic="passenger-concurrency-model-process-thread--brcvkk" data-anchor="PassengerConcurrencyModel">6.12.7. passenger_concurrency_model &lt;process|thread&gt;</h4>
3827
3830
  <div class="paragraph"><p><strong>This feature is only available in <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a>. It was introduced in version 4.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
3828
3831
  <div class="paragraph"><p>Specifies the I/O concurrency model that should be used for application processes. Phusion Passenger supports two concurrency models:</p></div>
3829
- <div class="ulist"><ul>
3832
+ <div class="ulist"><ul>
3830
3833
  <li>
3831
3834
  <p>
3832
3835
  <em>process</em> - single-threaded, multi-processed I/O concurrency. Each application process only has a single thread and can only handle 1 request at a time. This is the concurrency model that Ruby applications traditionally used. It has excellent compatiblity (can work with applications that are not designed to be thread-safe) but is unsuitable workloads in which the application has to wait for a lot of external I/O (e.g. HTTP API calls), and uses more memory because each process has a large memory overhead.
@@ -3839,7 +3842,7 @@ In an <em>if</em> configuration scope.
3839
3842
  </li>
3840
3843
  </ul></div>
3841
3844
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3842
- <div class="ulist"><ul>
3845
+ <div class="ulist"><ul>
3843
3846
  <li>
3844
3847
  <p>
3845
3848
  In the <em>http</em> configuration block.
@@ -3868,7 +3871,7 @@ In an <em>if</em> configuration scope.
3868
3871
  <div class="paragraph"><p><strong>This feature is only available in <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a>. It was introduced in version 4.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
3869
3872
  <div class="paragraph"><p>Specifies the number of threads that Phusion Passenger should spawn per application process. This option only has effect if <a href="#PassengerConcurrencyModel">passenger_concurrency_model</a> is <em>thread</em>.</p></div>
3870
3873
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3871
- <div class="ulist"><ul>
3874
+ <div class="ulist"><ul>
3872
3875
  <li>
3873
3876
  <p>
3874
3877
  In the <em>http</em> configuration block.
@@ -3903,7 +3906,7 @@ reached.</p></div>
3903
3906
  it down after a certain number of requests, all of its memory is guaranteed
3904
3907
  to be freed by the operating system.</p></div>
3905
3908
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3906
- <div class="ulist"><ul>
3909
+ <div class="ulist"><ul>
3907
3910
  <li>
3908
3911
  <p>
3909
3912
  In the <em>http</em> configuration block.
@@ -3927,9 +3930,9 @@ In an <em>if</em> configuration scope.
3927
3930
  </ul></div>
3928
3931
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
3929
3932
  <div class="admonitionblock">
3930
- <table><tr>
3933
+ <table><tr>
3931
3934
  <td class="icon">
3932
- <img src="./images/icons/caution.png" alt="Caution">
3935
+ <img src="./images/icons/caution.png" alt="Caution">
3933
3936
  </td>
3934
3937
  <td class="content">
3935
3938
  <div class="paragraph"><p>The <a href="#PassengerMaxRequests">passenger_max_requests</a> directive should be considered
@@ -3937,7 +3940,7 @@ as a workaround for misbehaving applications. It is advised that you fix the
3937
3940
  problem in your application rather than relying on these directives as a
3938
3941
  measure to avoid memory leaks.</p></div>
3939
3942
  </td>
3940
- </tr></table>
3943
+ </tr></table>
3941
3944
  </div>
3942
3945
  </div>
3943
3946
  <div class="sect3">
@@ -3950,7 +3953,7 @@ restarted upon the next request. A value of 0 means that there is no time limit.
3950
3953
  <div class="paragraph"><p>This option is useful for preventing your application from freezing for an
3951
3954
  indefinite period of time.</p></div>
3952
3955
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3953
- <div class="ulist"><ul>
3956
+ <div class="ulist"><ul>
3954
3957
  <li>
3955
3958
  <p>
3956
3959
  In the <em>http</em> configuration block.
@@ -3998,9 +4001,9 @@ to 10 seconds. You can then configure Phusion Passenger as follows:</p>
3998
4001
  or if a request to any other URI takes more than 2 seconds,
3999
4002
  then the corresponding application process will be forced to shutdown.</p></div>
4000
4003
  <div class="admonitionblock">
4001
- <table><tr>
4004
+ <table><tr>
4002
4005
  <td class="icon">
4003
- <img src="./images/icons/caution.png" alt="Caution">
4006
+ <img src="./images/icons/caution.png" alt="Caution">
4004
4007
  </td>
4005
4008
  <td class="content">
4006
4009
  <div class="paragraph"><p>The <a href="#PassengerMaxRequestTime">passenger_max_request_time</a> directive should be
@@ -4008,7 +4011,7 @@ considered as a workaround for misbehaving applications. It is advised that you
4008
4011
  fix the problem in your application rather than relying on these directives as a
4009
4012
  measure to avoid freezing applications.</p></div>
4010
4013
  </td>
4011
- </tr></table>
4014
+ </tr></table>
4012
4015
  </div>
4013
4016
  </div>
4014
4017
  <div class="sect3">
@@ -4022,7 +4025,7 @@ will not be checked.</p></div>
4022
4025
  <div class="paragraph"><p>This option is useful if your application is leaking memory. By shutting
4023
4026
  it down, all of its memory is guaranteed to be freed by the operating system.</p></div>
4024
4027
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4025
- <div class="ulist"><ul>
4028
+ <div class="ulist"><ul>
4026
4029
  <li>
4027
4030
  <p>
4028
4031
  In the <em>http</em> configuration block.
@@ -4046,9 +4049,9 @@ In an <em>if</em> configuration scope.
4046
4049
  </ul></div>
4047
4050
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
4048
4051
  <div class="admonitionblock">
4049
- <table><tr>
4052
+ <table><tr>
4050
4053
  <td class="icon">
4051
- <img src="./images/icons/note.png" alt="Note">
4054
+ <img src="./images/icons/note.png" alt="Note">
4052
4055
  </td>
4053
4056
  <td class="content">
4054
4057
  <div class="title">A word about permissions</div>
@@ -4059,12 +4062,12 @@ not obtainable through <span class="monospaced">ps</span>. You should ensure tha
4059
4062
  correctly and that the <span class="monospaced">/proc</span> filesystem is accessible by the
4060
4063
  <span class="monospaced">PassengerHelperAgent</span> process.</p></div>
4061
4064
  </td>
4062
- </tr></table>
4065
+ </tr></table>
4063
4066
  </div>
4064
4067
  <div class="admonitionblock">
4065
- <table><tr>
4068
+ <table><tr>
4066
4069
  <td class="icon">
4067
- <img src="./images/icons/caution.png" alt="Caution">
4070
+ <img src="./images/icons/caution.png" alt="Caution">
4068
4071
  </td>
4069
4072
  <td class="content">
4070
4073
  <div class="paragraph"><p>The <a href="#PassengerMaxRequests">passenger_max_requests</a> and
@@ -4073,7 +4076,7 @@ as workarounds for misbehaving applications. It is advised that you fix the
4073
4076
  problem in your application rather than relying on these directives as a
4074
4077
  measure to avoid memory leaks.</p></div>
4075
4078
  </td>
4076
- </tr></table>
4079
+ </tr></table>
4077
4080
  </div>
4078
4081
  </div>
4079
4082
  <div class="sect3">
@@ -4084,14 +4087,14 @@ web application might experience a small delay as Phusion Passenger is starting
4084
4087
  the web application on demand. If that is undesirable, then this directive can be
4085
4088
  used to pre-started application processes during Nginx startup.</p></div>
4086
4089
  <div class="paragraph"><p>A few things to be careful of:</p></div>
4087
- <div class="ulist"><ul>
4090
+ <div class="ulist"><ul>
4088
4091
  <li>
4089
4092
  <p>
4090
4093
  This directive accepts the <strong>URL</strong> of the web application you want to pre-start,
4091
4094
  not a on/off value! This might seem a bit weird, but read on for rationale. As
4092
4095
  for the specifics of the URL:
4093
4096
  </p>
4094
- <div class="ulist"><ul>
4097
+ <div class="ulist"><ul>
4095
4098
  <li>
4096
4099
  <p>
4097
4100
  The domain part of the URL must be equal to the value of the <em>server_name</em>
@@ -4299,7 +4302,7 @@ the request ending up at a different web server in the cluster.</p></div>
4299
4302
  write to the Nginx error log file. A higher log level value means that more
4300
4303
  information will be logged.</p></div>
4301
4304
  <div class="paragraph"><p>Possible values are:</p></div>
4302
- <div class="ulist"><ul>
4305
+ <div class="ulist"><ul>
4303
4306
  <li>
4304
4307
  <p>
4305
4308
  <em>0</em>: Show only errors and warnings.
@@ -4348,7 +4351,7 @@ gem 'debugger', :platforms =&gt; :ruby_19</pre>
4348
4351
  </div>
4349
4352
  <div class="paragraph"><p>Once debugging is turned on, you can use the command <span class="monospaced">passenger-irb --debug &lt;PID&gt;</span> to attach an rdebug console to the application process with the given PID. Attaching will succeed once the application process executes a <span class="monospaced">debugger</span> command.</p></div>
4350
4353
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4351
- <div class="ulist"><ul>
4354
+ <div class="ulist"><ul>
4352
4355
  <li>
4353
4356
  <p>
4354
4357
  In the <em>http</em> configuration block.
@@ -4379,7 +4382,7 @@ In an <em>if</em> configuration scope.
4379
4382
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="RailsEnv"></span><h4 data-comment-topic="rails-env-string--jlh7v9" data-anchor="RailsEnv">6.14.1. rails_env &lt;string&gt;</h4>
4380
4383
  <div class="paragraph"><p>This option allows one to specify the default <span class="monospaced">RAILS_ENV</span> value.</p></div>
4381
4384
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4382
- <div class="ulist"><ul>
4385
+ <div class="ulist"><ul>
4383
4386
  <li>
4384
4387
  <p>
4385
4388
  In the <em>http</em> configuration block.
@@ -4410,7 +4413,7 @@ In an <em>if</em> configuration scope.
4410
4413
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="RackEnv"></span><h4 data-comment-topic="rack-env-string--tqmrt0" data-anchor="RackEnv">6.15.1. rack_env &lt;string&gt;</h4>
4411
4414
  <div class="paragraph"><p>This option allows one to specify the default <span class="monospaced">RACK_ENV</span> value.</p></div>
4412
4415
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4413
- <div class="ulist"><ul>
4416
+ <div class="ulist"><ul>
4414
4417
  <li>
4415
4418
  <p>
4416
4419
  In the <em>http</em> configuration block.
@@ -4500,14 +4503,14 @@ we see that all the Apache and Nginx worker processes only take less than 1 MB m
4500
4503
  This is a lot less than the 50-80 MB-ish memory usage as shown in the <em>VMSize</em> column
4501
4504
  (which is what a lot of people think is the real memory usage, but is actually not).</p></div>
4502
4505
  <div class="admonitionblock">
4503
- <table><tr>
4506
+ <table><tr>
4504
4507
  <td class="icon">
4505
- <img src="./images/icons/note.png" alt="Note">
4508
+ <img src="./images/icons/note.png" alt="Note">
4506
4509
  </td>
4507
4510
  <td class="content">Private dirty RSS reporting only works on Linux. Unfortunately other operating systems
4508
4511
  don’t provide facilities for determining processes' private dirty RSS. On non-Linux systems,
4509
4512
  the Resident Set Size is reported instead.</td>
4510
- </tr></table>
4513
+ </tr></table>
4511
4514
  </div>
4512
4515
  </div>
4513
4516
  <div class="sect2">
@@ -4529,7 +4532,7 @@ inactive = 1
4529
4532
  </div>
4530
4533
  </div>
4531
4534
  <div class="paragraph"><p>The <em>general information</em> section shows the following information:</p></div>
4532
- <div class="dlist"><dl>
4535
+ <div class="dlist"><dl>
4533
4536
  <dt class="hdlist1">
4534
4537
  max
4535
4538
  </dt>
@@ -4573,7 +4576,7 @@ time). The value of <em>inactive</em> equals <span class="monospaced">count - ac
4573
4576
  </dl></div>
4574
4577
  <div class="paragraph"><p>The <em>domains</em> section shows, for each application directory, information about running
4575
4578
  application instances:</p></div>
4576
- <div class="dlist"><dl>
4579
+ <div class="dlist"><dl>
4577
4580
  <dt class="hdlist1">
4578
4581
  Sessions
4579
4582
  </dt>
@@ -4640,13 +4643,13 @@ This is the case with Ruby on Rails. So if you kill a Ruby on Rails application
4640
4643
  running it in a <em>production</em> environment). If you don’t see a backtrace there, check
4641
4644
  the web server error log.</p></div>
4642
4645
  <div class="admonitionblock">
4643
- <table><tr>
4646
+ <table><tr>
4644
4647
  <td class="icon">
4645
- <img src="./images/icons/note.png" alt="Note">
4648
+ <img src="./images/icons/note.png" alt="Note">
4646
4649
  </td>
4647
4650
  <td class="content">It is safe to kill application instances, even in live environments. Phusion Passenger
4648
4651
  will restart killed application instances, as if nothing bad happened.</td>
4649
- </tr></table>
4652
+ </tr></table>
4650
4653
  </div>
4651
4654
  </div>
4652
4655
  <div class="sect2">
@@ -4655,7 +4658,7 @@ will restart killed application instances, as if nothing bad happened.</td>
4655
4658
  the request to the most suitable application process, but sometimes it is desirable to
4656
4659
  be able to directly access the individual application processes. Use cases include, but
4657
4660
  are not limited to:</p></div>
4658
- <div class="ulist"><ul>
4661
+ <div class="ulist"><ul>
4659
4662
  <li>
4660
4663
  <p>
4661
4664
  One wants to debug a memory leak or memory bloat problem that only seems to appear on
@@ -4738,7 +4741,7 @@ So if <em>/home/webapps/foo/config/environment.rb</em> is owned by <em>joe</em>,
4738
4741
  Passenger will launch the corresponding application as <em>joe</em> as well.</p></div>
4739
4742
  <div class="paragraph"><p>This behavior is the default, and you don’t need to configure anything. But
4740
4743
  there are things that you should keep in mind:</p></div>
4741
- <div class="ulist"><ul>
4744
+ <div class="ulist"><ul>
4742
4745
  <li>
4743
4746
  <p>
4744
4747
  The owner of <em>environment.rb</em>/<em>config.ru</em> must have read access to the application’s
@@ -4811,7 +4814,7 @@ end</pre>
4811
4814
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="bundler_support"></span><h3 data-comment-topic="bundler-support-19v1h43" data-anchor="bundler_support">8.4. Bundler support</h3>
4812
4815
  <div class="paragraph"><p>Phusion Passenger has automatic support for <a href="http://gembundler.com/git.html">Bundler</a>.
4813
4816
  It works as follows:</p></div>
4814
- <div class="ulist"><ul>
4817
+ <div class="ulist"><ul>
4815
4818
  <li>
4816
4819
  <p>
4817
4820
  If you have a <em>.bundle/environment.rb</em> in your application root, then Phusion
@@ -4864,9 +4867,9 @@ application’s root folder. Unlike <em>restart.txt</em>, Phusion Passenger does
4864
4867
  check for this file’s timestamp: Phusion Passenger will always restart the
4865
4868
  application, as long as <em>always_restart.txt</em> exists.</p></div>
4866
4869
  <div class="admonitionblock">
4867
- <table><tr>
4870
+ <table><tr>
4868
4871
  <td class="icon">
4869
- <img src="./images/icons/note.png" alt="Note">
4872
+ <img src="./images/icons/note.png" alt="Note">
4870
4873
  </td>
4871
4874
  <td class="content">If you’re just developing a Rails application then you probably don’t need
4872
4875
  this feature. If you set
@@ -4876,7 +4879,7 @@ then Rails will automatically reload your application code after each request.
4876
4879
  <em>always_restart.txt</em> is mostly useful when you’re using a web framework that
4877
4880
  doesn’t support code reloading by itself, of when you’re working on a web framework
4878
4881
  yourself.</td>
4879
- </tr></table>
4882
+ </tr></table>
4880
4883
  </div>
4881
4884
  </div>
4882
4885
  <div class="sect2">
@@ -4924,7 +4927,7 @@ please refer to
4924
4927
  <div class="paragraph"><p>The Out-of-Band Work feature allows you to run arbitrary long-running tasks outside normal request cycles. This works by letting current requests to the process finish, then telling the process to perform the out-of-band work, then resuming passing requests to the process after said work is finished.</p></div>
4925
4928
  <div class="paragraph"><p>A specific (and perhaps primary) use case of of Out-of-Band Work is <strong>Out-of-Band Garbage Collection</strong>. The garbage collector is run outside normal request cycles so that garbage collection runs inside normal request cycles can finish a lot faster. This can potentially save tens to hundreds of milliseconds of latency in requests.</p></div>
4926
4929
  <div class="paragraph"><p>Because Out-of-Band Work is implemented at the Phusion Passenger inter-process request routing level, and not by, say, spawning a thread inside the application process, Out-of-Band Work has the following useful properties:</p></div>
4927
- <div class="ulist"><ul>
4930
+ <div class="ulist"><ul>
4928
4931
  <li>
4929
4932
  <p>
4930
4933
  It works well even with tasks that can pause all threads. The MRI Ruby garbage collector is a stop-the-world mark-and-sweep garbage collector.
@@ -4937,7 +4940,7 @@ Phusion Passenger can spawn more processes as necessary, in order to prevent sit
4937
4940
  </li>
4938
4941
  </ul></div>
4939
4942
  <div class="paragraph"><p>Applications can use Out-of-Band Work as follows:</p></div>
4940
- <div class="olist arabic"><ol class="arabic">
4943
+ <div class="olist arabic"><ol class="arabic">
4941
4944
  <li>
4942
4945
  <p>
4943
4946
  Request out-of-band work by outputting the <span class="monospaced">X-Passenger-Request-OOB-Work</span> header during a request. It does not matter what the value is. At this time, it is not possible to request out-of-band work from outside requests.
@@ -4984,7 +4987,7 @@ use PhusionPassenger<span style="color: #990000">::</span>Rack<span style="color
4984
4987
  </div>
4985
4988
  </div>
4986
4989
  <div class="paragraph"><p>References:</p></div>
4987
- <div class="ulist"><ul>
4990
+ <div class="ulist"><ul>
4988
4991
  <li>
4989
4992
  <p>
4990
4993
  <a href="http://blog.phusion.nl/2013/01/22/phusion-passenger-4-technology-preview-out-of-band-work/">The Phusion Blog article which first introduced this feature.</a>
@@ -5009,7 +5012,7 @@ This check occurs after checking whether the original mapped filename exists (as
5009
5012
  of static asset serving). All this is done without the need for special mod_rewrite
5010
5013
  rules.</p></div>
5011
5014
  <div class="paragraph"><p>For example, suppose that the browser requests <em>/foo/bar</em>.</p></div>
5012
- <div class="olist arabic"><ol class="arabic">
5015
+ <div class="olist arabic"><ol class="arabic">
5013
5016
  <li>
5014
5017
  <p>
5015
5018
  Phusion Passenger will first check whether this URI maps to a static file, i.e.
@@ -5050,7 +5053,7 @@ whether the following file exists:</p></div>
5050
5053
  </div>
5051
5054
  <div class="paragraph"><p>If you’re not a programmer and don’t understand the above pseudo-code snippet, it means
5052
5055
  that Phusion Passenger will:</p></div>
5053
- <div class="olist arabic"><ol class="arabic">
5056
+ <div class="olist arabic"><ol class="arabic">
5054
5057
  <li>
5055
5058
  <p>
5056
5059
  Extract the parent directory filename from the value of the “root” directive.
@@ -5085,12 +5088,14 @@ Phusion Passenger will look for <em>config.ru</em> instead of <em>config/environ
5085
5088
  Attribution-Share Alike 3.0 Unported License</a>.</p></div>
5086
5089
  <div class="paragraph"><p><span class="image">
5087
5090
  <a class="image" href="http://creativecommons.org/licenses/by-sa/3.0/">
5088
- <img src="images/by_sa.png" alt="images/by_sa.png"></a>
5091
+ <img src="images/by_sa.png" alt="images/by_sa.png">
5092
+ </a>
5089
5093
  </span></p></div>
5090
5094
  <div class="paragraph"><p>Phusion Passenger is brought to you by <a href="http://www.phusion.nl/">Phusion</a>.</p></div>
5091
5095
  <div class="paragraph"><p><span class="image">
5092
5096
  <a class="image" href="http://www.phusion.nl/">
5093
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
5097
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
5098
+ </a>
5094
5099
  </span></p></div>
5095
5100
  <div class="paragraph"><p>Phusion Passenger is a trademark of Hongli Lai &amp; Ninh Bui.</p></div>
5096
5101
  </div>
@@ -5200,18 +5205,20 @@ programmers jargon, Phusion Passenger calls fork(), but not exec().</p></div>
5200
5205
  <div class="sect2">
5201
5206
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_the_smart_spawning_method"></span><h3 data-comment-topic="the-smart-spawning-method-7nhgtj" data-anchor="_the_smart_spawning_method">12.2. The smart spawning method</h3>
5202
5207
  <div class="admonitionblock">
5203
- <table><tr>
5208
+ <table><tr>
5204
5209
  <td class="icon">
5205
- <img src="./images/icons/note.png" alt="Note">
5210
+ <img src="./images/icons/note.png" alt="Note">
5206
5211
  </td>
5207
5212
  <td class="content">Smart spawning is supported for all Ruby applications but not for WSGI applications.</td>
5208
- </tr></table>
5213
+ </tr></table>
5209
5214
  </div>
5210
5215
  <div class="paragraph"><p>While direct spawning works well, it’s not as efficient as it could be
5211
5216
  because each worker process has its own private copy of the Rails application
5212
5217
  as well as the Rails framework. This wastes memory as well as startup time.</p></div>
5213
5218
  <div class="paragraph"><p><span class="image">
5214
- <img src="images/direct_spawning.png" alt="Worker processes and direct spawning"></span><br><em>Figure: Worker processes and direct spawning. Each worker process has its
5219
+ <img src="images/direct_spawning.png" alt="Worker processes and direct spawning">
5220
+ </span><br>
5221
+ <em>Figure: Worker processes and direct spawning. Each worker process has its
5215
5222
  own private copy of the application code and Rails framework code.</em></p></div>
5216
5223
  <div class="paragraph"><p>It is possible to make the different worker processes share the memory occupied
5217
5224
  by application and Rails framework code, by utilizing so-called
@@ -5235,13 +5242,15 @@ processes will share as much common
5235
5242
  memory as possible. That is, they will all share the same application and Rails
5236
5243
  framework code.</p></div>
5237
5244
  <div class="paragraph"><p><span class="image">
5238
- <img src="images/smart.png" alt="images/smart.png"></span><br><em>Figure: Worker processes and the smart spawn method. All worker processes,
5245
+ <img src="images/smart.png" alt="images/smart.png">
5246
+ </span><br>
5247
+ <em>Figure: Worker processes and the smart spawn method. All worker processes,
5239
5248
  as well as the ApplicationSpawner, share the same application code and Rails
5240
5249
  framework code.</em></p></div>
5241
5250
  <div class="paragraph"><p>The <em>smart</em> method allows different worker processes that belong to the same
5242
5251
  application to share memory.</p></div>
5243
5252
  <div class="paragraph"><p>Notes:</p></div>
5244
- <div class="ulist"><ul>
5253
+ <div class="ulist"><ul>
5245
5254
  <li>
5246
5255
  <p>
5247
5256
  Vendored Rails frameworks cannot be shared by different applications, even if
@@ -6151,5 +6160,5 @@ Mizuho.topicListReceived = $.proxy(function(result) {
6151
6160
  $(document).ready(Mizuho.initializeCommenting);
6152
6161
 
6153
6162
  </script>
6154
- </body>
6163
+ </body>
6155
6164
  </html>