passenger 4.0.10 → 4.0.13

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 (224) hide show
  1. data.tar.gz.asc +7 -7
  2. data/.gitignore +66 -0
  3. data/.travis.yml +2 -5
  4. data/CONTRIBUTORS +2 -1
  5. data/NEWS +24 -0
  6. data/README.md +5 -10
  7. data/bin/passenger +1 -0
  8. data/bin/passenger-config +29 -3
  9. data/bin/passenger-install-nginx-module +1 -1
  10. data/build/basics.rb +8 -2
  11. data/build/debian.rb +22 -0
  12. data/build/integration_tests.rb +16 -2
  13. data/build/misc.rb +3 -0
  14. data/build/packaging.rb +77 -29
  15. data/build/preprocessor.rb +13 -10
  16. data/build/test_basics.rb +6 -0
  17. data/debian.template/locations.ini.template +13 -0
  18. data/debian.template/ruby-passenger-dev.install.template +3 -0
  19. data/debian.template/ruby-passenger-doc.install.template +2 -0
  20. data/debian.template/ruby-passenger.install.template +12 -0
  21. data/debian.template/rules.template +1 -0
  22. data/dev/run_travis.sh +46 -14
  23. data/doc/Architectural overview.html +25 -34
  24. data/doc/Packaging.html +31 -23
  25. data/doc/Packaging.txt.md +32 -23
  26. data/doc/Security of user switching support.html +16 -18
  27. data/doc/Users guide Apache.html +231 -239
  28. data/doc/Users guide Nginx.html +219 -227
  29. data/doc/Users guide Standalone.html +12 -15
  30. data/doc/users_guide_snippets/installation.txt +3 -2
  31. data/ext/common/ApplicationPool2/Implementation.cpp +6 -16
  32. data/ext/common/Constants.h +1 -1
  33. data/ext/common/ResourceLocator.h +6 -6
  34. data/ext/common/UnionStation.h +11 -15
  35. data/ext/common/Utils/ProcessMetricsCollector.h +7 -4
  36. data/ext/common/agents/HelperAgent/AgentOptions.h +6 -0
  37. data/ext/common/agents/HelperAgent/Main.cpp +5 -0
  38. data/ext/common/agents/HelperAgent/RequestHandler.h +9 -1
  39. data/ext/common/agents/LoggingAgent/Main.cpp +4 -0
  40. data/ext/common/agents/Watchdog/Main.cpp +7 -0
  41. data/ext/nginx/config +1 -1
  42. data/ext/oxt/Readme.txt +15 -0
  43. data/helper-scripts/download_binaries/extconf.rb +83 -0
  44. data/lib/phusion_passenger.rb +78 -80
  45. data/lib/phusion_passenger/abstract_installer.rb +22 -8
  46. data/lib/phusion_passenger/console_text_template.rb +1 -1
  47. data/lib/phusion_passenger/loader_shared_helpers.rb +2 -1
  48. data/lib/phusion_passenger/native_support.rb +22 -9
  49. data/lib/phusion_passenger/packaging.rb +7 -2
  50. data/lib/phusion_passenger/platform_info.rb +28 -1
  51. data/lib/phusion_passenger/platform_info/apache.rb +246 -26
  52. data/lib/phusion_passenger/platform_info/apache_detector.rb +232 -0
  53. data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +4 -0
  54. data/lib/phusion_passenger/platform_info/linux.rb +7 -0
  55. data/lib/phusion_passenger/public_api.rb +11 -2
  56. data/lib/phusion_passenger/standalone/command.rb +11 -14
  57. data/lib/phusion_passenger/standalone/runtime_installer.rb +313 -275
  58. data/lib/phusion_passenger/standalone/runtime_locator.rb +163 -0
  59. data/lib/phusion_passenger/standalone/start_command.rb +38 -46
  60. data/lib/phusion_passenger/utils/json.rb +329 -0
  61. data/lib/phusion_passenger/utils/tmpio.rb +1 -0
  62. data/passenger.gemspec +4 -0
  63. data/resources/mime.types +1 -0
  64. data/resources/oss-binaries.phusionpassenger.com.crt +84 -0
  65. data/resources/release.txt +0 -0
  66. data/resources/templates/standalone/download_tool_missing.txt.erb +18 -0
  67. data/rpm/README.rdoc +117 -0
  68. data/rpm/config/apache-passenger.conf.in +19 -0
  69. data/rpm/config/nginx-passenger.conf.in +10 -0
  70. data/rpm/config/rubygem-passenger.te +10 -0
  71. data/rpm/doc/README.nginx-alternatives +5 -0
  72. data/rpm/doc/example_yum_repository_htaccess +5 -0
  73. data/rpm/doc/footer.shtml +12 -0
  74. data/rpm/doc/header.shtml +156 -0
  75. data/rpm/nginx-alternatives.spec +97 -0
  76. data/rpm/passenger-release.spec +91 -0
  77. data/rpm/passenger.spec +667 -0
  78. data/rpm/patches/passenger-force-native.patch +63 -0
  79. data/rpm/release/RPM-GPG-KEY-stealthymonkeys +33 -0
  80. data/rpm/release/build-release.sh +35 -0
  81. data/rpm/release/build.rb +301 -0
  82. data/rpm/release/create-mirrors.sh +16 -0
  83. data/rpm/release/mirrors +1 -0
  84. data/rpm/release/mock-repo/comps.xml +21 -0
  85. data/rpm/release/mock-repo/rubygem-daemon_controller-0.2.5-1.noarch.rpm +0 -0
  86. data/rpm/release/mock-repo/rubygem-file-tail-1.0.5-1.noarch.rpm +0 -0
  87. data/rpm/release/mock-repo/rubygem-spruz-0.2.2-1.noarch.rpm +0 -0
  88. data/rpm/release/mocksetup-first.sh +102 -0
  89. data/rpm/release/mocksetup.sh +67 -0
  90. data/test/integration_tests/apache2_tests.rb +1 -1
  91. data/test/integration_tests/downloaded_binaries_tests.rb +76 -0
  92. data/test/integration_tests/native_packaging_spec.rb +38 -6
  93. data/test/integration_tests/source_packaging_test.rb +198 -0
  94. data/test/integration_tests/standalone_tests.rb +275 -0
  95. data/test/ruby/admin_tools_spec.rb +1 -1
  96. data/test/ruby/rails4.0/loader_spec.rb +28 -0
  97. data/test/ruby/rails4.0/preloader_spec.rb +34 -0
  98. data/test/ruby/spec_helper.rb +5 -1
  99. data/test/ruby/standalone/runtime_installer_spec.rb +399 -0
  100. data/test/ruby/standalone/runtime_locator_spec.rb +214 -0
  101. data/test/stub/apache2/httpd.conf.erb +18 -1
  102. data/test/stub/rack/tmp/.gitignore +0 -0
  103. data/test/stub/rails2.3/log/.gitignore +1 -0
  104. data/test/stub/rails2.3/public/.gitignore +1 -0
  105. data/test/stub/rails2.3/tmp/cache/.gitignore +1 -0
  106. data/test/stub/rails2.3/tmp/pids/.gitignore +1 -0
  107. data/test/stub/rails2.3/tmp/sessions/.gitignore +1 -0
  108. data/test/stub/rails2.3/tmp/sockets/.gitignore +1 -0
  109. data/test/stub/rails3.0/.gitignore +4 -0
  110. data/test/stub/rails3.0/Gemfile +1 -1
  111. data/test/stub/rails3.0/Gemfile.lock +1 -1
  112. data/test/stub/rails3.0/lib/tasks/.gitkeep +0 -0
  113. data/test/stub/rails3.0/log/.gitignore +0 -0
  114. data/test/stub/rails3.0/public/stylesheets/.gitkeep +0 -0
  115. data/test/stub/rails3.0/vendor/plugins/.gitkeep +0 -0
  116. data/test/stub/rails3.1/.gitignore +15 -0
  117. data/test/stub/rails3.1/Gemfile +1 -1
  118. data/test/stub/rails3.1/Gemfile.lock +1 -1
  119. data/test/stub/rails3.1/app/mailers/.gitkeep +0 -0
  120. data/test/stub/rails3.1/app/models/.gitkeep +0 -0
  121. data/test/stub/rails3.1/lib/assets/.gitkeep +0 -0
  122. data/test/stub/rails3.1/lib/tasks/.gitkeep +0 -0
  123. data/test/stub/rails3.1/log/.gitkeep +0 -0
  124. data/test/stub/rails3.1/test/fixtures/.gitkeep +0 -0
  125. data/test/stub/rails3.1/test/functional/.gitkeep +0 -0
  126. data/test/stub/rails3.1/test/integration/.gitkeep +0 -0
  127. data/test/stub/rails3.1/test/unit/.gitkeep +0 -0
  128. data/test/stub/rails3.1/vendor/assets/stylesheets/.gitkeep +0 -0
  129. data/test/stub/rails3.1/vendor/plugins/.gitkeep +0 -0
  130. data/test/stub/rails3.2/.gitignore +15 -0
  131. data/test/stub/rails3.2/app/mailers/.gitkeep +0 -0
  132. data/test/stub/rails3.2/app/models/.gitkeep +0 -0
  133. data/test/stub/rails3.2/lib/assets/.gitkeep +0 -0
  134. data/test/stub/rails3.2/lib/tasks/.gitkeep +0 -0
  135. data/test/stub/rails3.2/log/.gitkeep +0 -0
  136. data/test/stub/rails3.2/test/fixtures/.gitkeep +0 -0
  137. data/test/stub/rails3.2/test/functional/.gitkeep +0 -0
  138. data/test/stub/rails3.2/test/integration/.gitkeep +0 -0
  139. data/test/stub/rails3.2/test/unit/.gitkeep +0 -0
  140. data/test/stub/rails3.2/vendor/assets/stylesheets/.gitkeep +0 -0
  141. data/test/stub/rails3.2/vendor/plugins/.gitkeep +0 -0
  142. data/test/stub/rails4.0/.gitignore +16 -0
  143. data/test/stub/rails4.0/Gemfile +45 -0
  144. data/test/stub/rails4.0/Gemfile.lock +126 -0
  145. data/test/stub/rails4.0/README.rdoc +28 -0
  146. data/test/stub/rails4.0/Rakefile +6 -0
  147. data/test/stub/rails4.0/app/assets/images/.keep +0 -0
  148. data/test/stub/rails4.0/app/assets/javascripts/application.js +16 -0
  149. data/test/stub/rails4.0/app/assets/stylesheets/application.css +13 -0
  150. data/test/stub/rails4.0/app/controllers/application_controller.rb +5 -0
  151. data/test/stub/rails4.0/app/controllers/concerns/.keep +0 -0
  152. data/test/stub/rails4.0/app/helpers/application_helper.rb +2 -0
  153. data/test/stub/rails4.0/app/mailers/.keep +0 -0
  154. data/test/stub/rails4.0/app/models/.keep +0 -0
  155. data/test/stub/rails4.0/app/models/concerns/.keep +0 -0
  156. data/test/stub/rails4.0/app/views/layouts/application.html.erb +14 -0
  157. data/test/stub/rails4.0/bin/bundle +3 -0
  158. data/test/stub/rails4.0/bin/rails +4 -0
  159. data/test/stub/rails4.0/bin/rake +4 -0
  160. data/test/stub/rails4.0/config.ru +4 -0
  161. data/test/stub/rails4.0/config/application.rb +23 -0
  162. data/test/stub/rails4.0/config/boot.rb +4 -0
  163. data/test/stub/rails4.0/config/database.yml +25 -0
  164. data/test/stub/rails4.0/config/environment.rb +5 -0
  165. data/test/stub/rails4.0/config/environments/development.rb +29 -0
  166. data/test/stub/rails4.0/config/environments/production.rb +80 -0
  167. data/test/stub/rails4.0/config/environments/test.rb +36 -0
  168. data/test/stub/rails4.0/config/initializers/backtrace_silencers.rb +7 -0
  169. data/test/stub/rails4.0/config/initializers/filter_parameter_logging.rb +4 -0
  170. data/test/stub/rails4.0/config/initializers/inflections.rb +16 -0
  171. data/test/stub/rails4.0/config/initializers/mime_types.rb +5 -0
  172. data/test/stub/rails4.0/config/initializers/passenger.rb +1 -0
  173. data/test/stub/rails4.0/config/initializers/secret_token.rb +12 -0
  174. data/test/stub/rails4.0/config/initializers/session_store.rb +3 -0
  175. data/test/stub/rails4.0/config/initializers/wrap_parameters.rb +14 -0
  176. data/test/stub/rails4.0/config/locales/en.yml +23 -0
  177. data/test/stub/rails4.0/config/routes.rb +57 -0
  178. data/test/stub/rails4.0/db/seeds.rb +7 -0
  179. data/test/stub/rails4.0/lib/assets/.keep +0 -0
  180. data/test/stub/rails4.0/lib/tasks/.keep +0 -0
  181. data/test/stub/rails4.0/log/.keep +0 -0
  182. data/test/stub/rails4.0/public/404.html +58 -0
  183. data/test/stub/rails4.0/public/422.html +58 -0
  184. data/test/stub/rails4.0/public/500.html +57 -0
  185. data/test/stub/rails4.0/public/favicon.ico +0 -0
  186. data/test/stub/rails4.0/public/robots.txt +5 -0
  187. data/test/stub/rails4.0/test/controllers/.keep +0 -0
  188. data/test/stub/rails4.0/test/fixtures/.keep +0 -0
  189. data/test/stub/rails4.0/test/helpers/.keep +0 -0
  190. data/test/stub/rails4.0/test/integration/.keep +0 -0
  191. data/test/stub/rails4.0/test/mailers/.keep +0 -0
  192. data/test/stub/rails4.0/test/models/.keep +0 -0
  193. data/test/stub/rails4.0/test/test_helper.rb +15 -0
  194. data/test/stub/rails4.0/vendor/assets/javascripts/.keep +0 -0
  195. data/test/stub/rails4.0/vendor/assets/stylesheets/.keep +0 -0
  196. data/test/stub/rails_apps/1.2/empty/.gitignore +3 -0
  197. data/test/stub/rails_apps/1.2/empty/app/models/.gitignore +0 -0
  198. data/test/stub/rails_apps/1.2/empty/db/.gitignore +0 -0
  199. data/test/stub/rails_apps/1.2/empty/public/.htaccess +40 -0
  200. data/test/stub/rails_apps/1.2/empty/public/stylesheets/.gitignore +0 -0
  201. data/test/stub/rails_apps/2.0/empty/.gitignore +3 -0
  202. data/test/stub/rails_apps/2.0/empty/app/models/.gitignore +0 -0
  203. data/test/stub/rails_apps/2.0/empty/db/.gitignore +0 -0
  204. data/test/stub/rails_apps/2.0/empty/public/.htaccess +40 -0
  205. data/test/stub/rails_apps/2.0/empty/public/stylesheets/.gitignore +0 -0
  206. data/test/stub/rails_apps/2.2/empty/.gitignore +3 -0
  207. data/test/stub/rails_apps/2.2/empty/app/models/.gitignore +0 -0
  208. data/test/stub/rails_apps/2.2/empty/db/.gitignore +0 -0
  209. data/test/stub/rails_apps/2.2/empty/public/stylesheets/.gitignore +0 -0
  210. data/test/stub/rails_apps/2.3/empty/.gitignore +3 -0
  211. data/test/stub/rails_apps/2.3/empty/app/models/.gitignore +0 -0
  212. data/test/stub/rails_apps/2.3/empty/db/.gitignore +0 -0
  213. data/test/stub/rails_apps/2.3/empty/public/stylesheets/.gitignore +0 -0
  214. data/test/stub/rails_apps/2.3/mycook/public/.htaccess +42 -0
  215. data/test/stub/rails_apps/2.3/mycook/public/uploads/.gitignore +0 -0
  216. data/test/stub/wsgi/tmp/.gitignore +0 -0
  217. data/test/valgrind-osx.supp +7 -0
  218. metadata +162 -8
  219. metadata.gz.asc +7 -7
  220. data/debian.template/locations.ini +0 -12
  221. data/debian.template/ruby-passenger-dev.install +0 -3
  222. data/debian.template/ruby-passenger-doc.install +0 -2
  223. data/debian.template/ruby-passenger.install +0 -11
  224. data/resources/templates/installer_common/freebsd9_broken_cxx_runtime.txt.erb +0 -19
@@ -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,8 +797,7 @@ install: function(toclevels) {
797
797
  }
798
798
  asciidoc.install();
799
799
  /*]]>*/
800
- </script>
801
- <style type="text/css">
800
+ </script><style type="text/css">
802
801
  body {
803
802
  margin: 1em auto 1em auto;
804
803
  padding: 0 1em 0 1em;
@@ -1055,11 +1054,10 @@ pre {
1055
1054
  }
1056
1055
 
1057
1056
  </style>
1058
- </head>
1057
+ </head>
1059
1058
  <body class="article">
1060
1059
  <div id="topbar" style="display: none">
1061
1060
  <div class="title">
1062
- <!-- Don't put a space between the img and a. That will break the hover layout. -->
1063
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>
1064
1062
  </div>
1065
1063
  <a href="javascript:void(0)" id="current_section"></a>
@@ -1070,13 +1068,12 @@ pre {
1070
1068
  <div class="sectionbody">
1071
1069
  <div class="paragraph"><p><span class="image">
1072
1070
  <a class="image" href="http://www.phusion.nl/">
1073
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
1074
- </a>
1071
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
1075
1072
  </span></p></div>
1076
1073
  <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>
1077
1074
  <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>
1078
1075
  <div class="paragraph"><p>This users guide will teach you:</p></div>
1079
- <div class="ulist"><ul>
1076
+ <div class="ulist"><ul>
1080
1077
  <li>
1081
1078
  <p>
1082
1079
  How to install Nginx with Phusion Passenger support.
@@ -1284,7 +1281,7 @@ if it doesn’t work on your POSIX-compliant operating system.</p></div>
1284
1281
  </div>
1285
1282
  <div class="sect2">
1286
1283
  <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>
1287
- <div class="ulist"><ul>
1284
+ <div class="ulist"><ul>
1288
1285
  <li>
1289
1286
  <p>
1290
1287
  <a href="http://groups.google.com/group/phusion-passenger">Discussion forum</a> - post a
@@ -1323,7 +1320,7 @@ Report security vulnerabilities to <a href="mailto:security@phusion.nl">security
1323
1320
  <div class="sect2">
1324
1321
  <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>
1325
1322
  <div class="paragraph"><p>The Phusion Passenger installation process consists of two steps:</p></div>
1326
- <div class="olist arabic"><ol class="arabic">
1323
+ <div class="olist arabic"><ol class="arabic">
1327
1324
  <li>
1328
1325
  <p>
1329
1326
  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.
@@ -1351,7 +1348,7 @@ The <strong>integration step</strong>, where you configure Phusion Passenger so
1351
1348
  </div>
1352
1349
  </div>
1353
1350
  <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>
1354
- <div class="ulist"><ul>
1351
+ <div class="ulist"><ul>
1355
1352
  <li>
1356
1353
  <p>
1357
1354
  Are you using RVM? Run <span class="monospaced">rvmsudo -s</span>
@@ -1409,8 +1406,8 @@ Is <em>sudo</em> not installed on your system? Run <span class="monospaced">su -
1409
1406
  </div>
1410
1407
  </div>
1411
1408
  <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>
1412
- <div class="paragraph"><p>If you all of the following are applicable to you:</p></div>
1413
- <div class="ulist"><ul>
1409
+ <div class="paragraph"><p>If all of the following are applicable to you:</p></div>
1410
+ <div class="ulist"><ul>
1414
1411
  <li>
1415
1412
  <p>
1416
1413
  You are on Debian or Ubuntu,
@@ -1459,7 +1456,7 @@ chmod o+x /home/phusion</pre>
1459
1456
  <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>
1460
1457
  <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. But it is important that you recompile Nginx with the configure parameters that you used last time.</p></div>
1461
1458
  <div class="paragraph"><p>Here’s how you can uninstall the original Nginx:</p></div>
1462
- <div class="ulist"><ul>
1459
+ <div class="ulist"><ul>
1463
1460
  <li>
1464
1461
  <p>
1465
1462
  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>
@@ -1690,7 +1687,7 @@ sudo apt-get update</pre>
1690
1687
  <div class="paragraph"><p>You’ll then need to enable the Phusion Passenger module in Nginx by creating the following configuration file:</p></div>
1691
1688
  <div class="listingblock">
1692
1689
  <div class="content monospaced">
1693
- <pre>sudo sh -c 'echo "passenger_root /usr/lib/phusion-passenger;" &gt; /etc/nginx/conf.d/passenger.conf'</pre>
1690
+ <pre>sudo sh -c 'echo "passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;" &gt; /etc/nginx/conf.d/passenger.conf'</pre>
1694
1691
  </div>
1695
1692
  </div>
1696
1693
  <div class="paragraph"><p>Then restart Nginx to apply the changes:</p></div>
@@ -1779,7 +1776,7 @@ sudo apt-get update</pre>
1779
1776
  <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>
1780
1777
  <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>
1781
1778
  <div class="paragraph"><p>Customers who have bought Phusion Passenger Enterprise can upgrade their open source installation to Enterprise as follows:</p></div>
1782
- <div class="olist arabic"><ol class="arabic">
1779
+ <div class="olist arabic"><ol class="arabic">
1783
1780
  <li>
1784
1781
  <p>
1785
1782
  <a href="#uninstalling">Uninstall the open source Phusion Passenger</a>.
@@ -1917,18 +1914,18 @@ http://www.gnu.org/software/src-highlite -->
1917
1914
  </div>
1918
1915
  </div>
1919
1916
  <div class="admonitionblock">
1920
- <table><tr>
1917
+ <table><tr>
1921
1918
  <td class="icon">
1922
- <img src="./images/icons/note.png" alt="Note">
1919
+ <img src="./images/icons/note.png" alt="Note">
1923
1920
  </td>
1924
1921
  <td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
1925
- </tr></table>
1922
+ </tr></table>
1926
1923
  </div>
1927
1924
  </div>
1928
1925
  <div class="sect3">
1929
1926
  <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>
1930
1927
  <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>
1931
- <div class="dlist"><dl>
1928
+ <div class="dlist"><dl>
1932
1929
  <dt class="hdlist1">
1933
1930
  <span class="monospaced">EXTRA_PRE_CFLAGS</span>
1934
1931
  </dt>
@@ -1979,19 +1976,19 @@ http://www.gnu.org/software/src-highlite -->
1979
1976
  </dd>
1980
1977
  </dl></div>
1981
1978
  <div class="admonitionblock">
1982
- <table><tr>
1979
+ <table><tr>
1983
1980
  <td class="icon">
1984
- <img src="./images/icons/note.png" alt="Note">
1981
+ <img src="./images/icons/note.png" alt="Note">
1985
1982
  </td>
1986
1983
  <td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
1987
- </tr></table>
1984
+ </tr></table>
1988
1985
  </div>
1989
1986
  </div>
1990
1987
  <div class="sect3">
1991
1988
  <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_command_line_tools_and_dependencies"></span><h4 data-comment-topic="forcing-location-of-certain-command-line-tools-1j93cki" data-anchor="_forcing_location_of_command_line_tools_and_dependencies">2.9.3. Forcing location of command line tools and dependencies</h4>
1992
1989
  <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>
1993
1990
  <div class="paragraph"><p>You can force the build to find certain command line tools at certain locations by using the following environment variables:</p></div>
1994
- <div class="dlist"><dl>
1991
+ <div class="dlist"><dl>
1995
1992
  <dt class="hdlist1">
1996
1993
  <span class="monospaced">HTTPD</span>
1997
1994
  </dt>
@@ -2052,12 +2049,13 @@ http://www.gnu.org/software/src-highlite -->
2052
2049
  </dd>
2053
2050
  </dl></div>
2054
2051
  <div class="admonitionblock">
2055
- <table><tr>
2052
+ <table><tr>
2056
2053
  <td class="icon">
2057
- <img src="./images/icons/note.png" alt="Note">
2054
+ <img src="./images/icons/tip.png" alt="Tip">
2058
2055
  </td>
2059
- <td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
2060
- </tr></table>
2056
+ <td class="content">If you do not know what environment variables are, or how to use them, then please read <a href="#env_vars_and_sudo">Environment variables and sudo</a>.
2057
+ NOTE: If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
2058
+ </tr></table>
2061
2059
  </div>
2062
2060
  </div>
2063
2061
  </div>
@@ -2089,7 +2087,7 @@ line into your Nginx configuration file:</p></div>
2089
2087
  <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>
2090
2088
  <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>
2091
2089
  <div class="paragraph"><p>If you prefer to use an init script then please refer to the following resources:</p></div>
2092
- <div class="ulist"><ul>
2090
+ <div class="ulist"><ul>
2093
2091
  <li>
2094
2092
  <p>
2095
2093
  <a href="http://wiki.nginx.org/Nginx-init-ubuntu">Init script for Ubuntu 8.04-9.10</a>
@@ -2169,7 +2167,7 @@ http {
2169
2167
  <div class="paragraph"><p>To uninstall Phusion Passenger, please first remove all Phusion Passenger
2170
2168
  configuration directives from your web server configuration file(s). After you’ve
2171
2169
  done this, you need to remove the Phusion Passenger files.</p></div>
2172
- <div class="ulist"><ul>
2170
+ <div class="ulist"><ul>
2173
2171
  <li>
2174
2172
  <p>
2175
2173
  If you installed Phusion Passenger via a Ruby gem, then run <span class="monospaced">gem uninstall passenger</span> (or, if you’re a <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> user, <span class="monospaced">gem uninstall passenger-enterprise-server</span>).
@@ -2220,14 +2218,14 @@ virtual host’s root (i.e. the application will be accessible from the root URL
2220
2218
  <em>http://www.mycook.com/</em>), or in a sub URI (i.e. the application will be
2221
2219
  accessible from a sub URL, such as <em>http://www.mycook.com/railsapplication</em>).</p></div>
2222
2220
  <div class="admonitionblock">
2223
- <table><tr>
2221
+ <table><tr>
2224
2222
  <td class="icon">
2225
- <img src="./images/icons/note.png" alt="Note">
2223
+ <img src="./images/icons/note.png" alt="Note">
2226
2224
  </td>
2227
2225
  <td class="content">The default <span class="monospaced">RAILS_ENV</span> environment in which deployed Rails applications
2228
2226
  are run, is “production”. You can change this by changing the
2229
2227
  <a href="#RailsEnv">rails_env</a> configuration option.</td>
2230
- </tr></table>
2228
+ </tr></table>
2231
2229
  </div>
2232
2230
  <div class="sect2">
2233
2231
  <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>
@@ -2301,9 +2299,9 @@ option to the <em>server</em> block:</p></div>
2301
2299
  </div>
2302
2300
  <div class="paragraph"><p>Then restart Nginx. The application has now been deployed.</p></div>
2303
2301
  <div class="admonitionblock">
2304
- <table><tr>
2302
+ <table><tr>
2305
2303
  <td class="icon">
2306
- <img src="./images/icons/tip.png" alt="Tip">
2304
+ <img src="./images/icons/tip.png" alt="Tip">
2307
2305
  </td>
2308
2306
  <td class="content">
2309
2307
  <div class="paragraph"><p>You can deploy multiple Rails applications under a virtual host, by specifying
@@ -2319,7 +2317,7 @@ option to the <em>server</em> block:</p></div>
2319
2317
  </div>
2320
2318
  </div>
2321
2319
  </td>
2322
- </tr></table>
2320
+ </tr></table>
2323
2321
  </div>
2324
2322
  </div>
2325
2323
  <div class="sect2">
@@ -2327,7 +2325,7 @@ option to the <em>server</em> block:</p></div>
2327
2325
  <div class="paragraph"><p>Deploying a new version of a Ruby on Rails application is as simple as
2328
2326
  re-uploading the application files, and restarting the application.</p></div>
2329
2327
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2330
- <div class="olist arabic"><ol class="arabic">
2328
+ <div class="olist arabic"><ol class="arabic">
2331
2329
  <li>
2332
2330
  <p>
2333
2331
  By restarting Nginx.
@@ -2374,7 +2372,7 @@ a shell console, just like one would normally run migrations.</p></div>
2374
2372
  <div class="paragraph"><p>Phusion Passenger assumes that Rack application directories have a certain layout.
2375
2373
  Suppose that you have a Rack application in <em>/webapps/rackapp</em>. Then that
2376
2374
  folder must contain at least three entries:</p></div>
2377
- <div class="ulist"><ul>
2375
+ <div class="ulist"><ul>
2378
2376
  <li>
2379
2377
  <p>
2380
2378
  <em>config.ru</em>, a Rackup file for starting the Rack application. This file must contain
@@ -2410,14 +2408,14 @@ to the virtual host’s root (i.e. the application will be accessible from the r
2410
2408
  <em>http://www.rackapp.com/</em>), or in a sub URI (i.e. the application will be
2411
2409
  accessible from a sub URL, such as <em>http://www.rackapp.com/rackapp</em>).</p></div>
2412
2410
  <div class="admonitionblock">
2413
- <table><tr>
2411
+ <table><tr>
2414
2412
  <td class="icon">
2415
- <img src="./images/icons/note.png" alt="Note">
2413
+ <img src="./images/icons/note.png" alt="Note">
2416
2414
  </td>
2417
2415
  <td class="content">The default <span class="monospaced">RACK_ENV</span> environment in which deployed Rack applications
2418
2416
  are run, is “production”. You can change this by changing the
2419
2417
  <a href="#RackEnv">rack_env</a> configuration option.</td>
2420
- </tr></table>
2418
+ </tr></table>
2421
2419
  </div>
2422
2420
  <div class="sect2">
2423
2421
  <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>
@@ -2532,9 +2530,9 @@ option to the <em>server</em> block:</p></div>
2532
2530
  </div>
2533
2531
  <div class="paragraph"><p>Then restart Nginx. The application has now been deployed.</p></div>
2534
2532
  <div class="admonitionblock">
2535
- <table><tr>
2533
+ <table><tr>
2536
2534
  <td class="icon">
2537
- <img src="./images/icons/tip.png" alt="Tip">
2535
+ <img src="./images/icons/tip.png" alt="Tip">
2538
2536
  </td>
2539
2537
  <td class="content">
2540
2538
  <div class="paragraph"><p>You can deploy multiple Rack applications under a virtual host, by specifying
@@ -2550,7 +2548,7 @@ option to the <em>server</em> block:</p></div>
2550
2548
  </div>
2551
2549
  </div>
2552
2550
  </td>
2553
- </tr></table>
2551
+ </tr></table>
2554
2552
  </div>
2555
2553
  </div>
2556
2554
  <div class="sect2">
@@ -2558,7 +2556,7 @@ option to the <em>server</em> block:</p></div>
2558
2556
  <div class="paragraph"><p>Deploying a new version of a Rack application is as simple as
2559
2557
  re-uploading the application files, and restarting the application.</p></div>
2560
2558
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2561
- <div class="olist arabic"><ol class="arabic">
2559
+ <div class="olist arabic"><ol class="arabic">
2562
2560
  <li>
2563
2561
  <p>
2564
2562
  By restarting Nginx.
@@ -2681,7 +2679,7 @@ run Sinatra::Application</pre>
2681
2679
  <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>
2682
2680
  <div class="sectionbody">
2683
2681
  <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>
2684
- <div class="ulist"><ul>
2682
+ <div class="ulist"><ul>
2685
2683
  <li>
2686
2684
  <p>
2687
2685
  <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>.
@@ -2778,7 +2776,7 @@ root must point to your WSGI application’s <em>public</em> folder. You must al
2778
2776
  <div class="paragraph"><p>Deploying a new version of a WSGI application is as simple as
2779
2777
  re-uploading the application files, and restarting the application.</p></div>
2780
2778
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2781
- <div class="olist arabic"><ol class="arabic">
2779
+ <div class="olist arabic"><ol class="arabic">
2782
2780
  <li>
2783
2781
  <p>
2784
2782
  By restarting Nginx.
@@ -2819,12 +2817,12 @@ this option as well. Please read
2819
2817
  <a href="#moving_phusion_passenger">Moving Phusion Passenger to a different directory</a> for more information.</p></div>
2820
2818
  <div class="paragraph"><p>This required option may only occur once, in the <em>http</em> configuration block.</p></div>
2821
2819
  <div class="admonitionblock">
2822
- <table><tr>
2820
+ <table><tr>
2823
2821
  <td class="icon">
2824
- <img src="./images/icons/note.png" alt="Note">
2822
+ <img src="./images/icons/note.png" alt="Note">
2825
2823
  </td>
2826
2824
  <td class="content">This option has no effect when you are using <a href="#flying_passenger">Flying Passenger</a>.</td>
2827
- </tr></table>
2825
+ </tr></table>
2828
2826
  </div>
2829
2827
  </div>
2830
2828
  <div class="sect2">
@@ -2832,7 +2830,7 @@ this option as well. Please read
2832
2830
  <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>
2833
2831
  <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>
2834
2832
  <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>
2835
- <div class="ulist"><ul>
2833
+ <div class="ulist"><ul>
2836
2834
  <li>
2837
2835
  <p>
2838
2836
  In the <em>http</em> configuration block.
@@ -2974,7 +2972,7 @@ is the parent directory of the <em>public</em> directory. This option allows one
2974
2972
  specify the application’s root independently from the Nginx <em>root</em>, which
2975
2973
  is useful if the <em>public</em> directory lives in a non-standard place.</p></div>
2976
2974
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
2977
- <div class="ulist"><ul>
2975
+ <div class="ulist"><ul>
2978
2976
  <li>
2979
2977
  <p>
2980
2978
  In the <em>http</em> configuration block.
@@ -3014,9 +3012,9 @@ In an <em>if</em> configuration scope.
3014
3012
  <div class="sect2">
3015
3013
  <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>
3016
3014
  <div class="admonitionblock">
3017
- <table><tr>
3015
+ <table><tr>
3018
3016
  <td class="icon">
3019
- <img src="./images/icons/tip.png" alt="Tip">
3017
+ <img src="./images/icons/tip.png" alt="Tip">
3020
3018
  </td>
3021
3019
  <td class="content">
3022
3020
  <div class="title">"What spawn method should I use?"</div>
@@ -3031,12 +3029,12 @@ understand it, as it’s mostly a technical detail. You can basically follow thi
3031
3029
  <div class="paragraph"><p>However, we do recommend you to try to understand it. The <em>smart</em> spawn
3032
3030
  method brings many benefits.</p></div>
3033
3031
  </td>
3034
- </tr></table>
3032
+ </tr></table>
3035
3033
  </div>
3036
3034
  <div class="paragraph"><p>Internally, Phusion Passenger spawns multiple Ruby application processes in order to handle
3037
3035
  requests. But there are multiple ways with which processes can be spawned, each having
3038
3036
  its own set of pros and cons. Supported spawn methods are:</p></div>
3039
- <div class="dlist"><dl>
3037
+ <div class="dlist"><dl>
3040
3038
  <dt class="hdlist1">
3041
3039
  <em>smart</em>
3042
3040
  </dt>
@@ -3080,7 +3078,7 @@ to <em>smart</em>. The old <em>smart</em> spawning has been removed in favor of
3080
3078
  </div>
3081
3079
  </div>
3082
3080
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3083
- <div class="ulist"><ul>
3081
+ <div class="ulist"><ul>
3084
3082
  <li>
3085
3083
  <p>
3086
3084
  In the <em>http</em> configuration block.
@@ -3114,7 +3112,7 @@ of a new application process could take a while, and any requests that
3114
3112
  come in during this time will be blocked until this first application
3115
3113
  process has spawned.</p></div>
3116
3114
  <div class="paragraph"><p>But when rolling restarts are enabled, Phusion Passenger Enterprise will:</p></div>
3117
- <div class="olist arabic"><ol class="arabic">
3115
+ <div class="olist arabic"><ol class="arabic">
3118
3116
  <li>
3119
3117
  <p>
3120
3118
  Spawn a new process in the background.
@@ -3133,7 +3131,7 @@ Step 1 and 2 are repeated until all processes have been replaced.
3133
3131
  </ol></div>
3134
3132
  <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>
3135
3133
  <div class="paragraph"><p>Rolling restarts have a few caveat however that you should be aware of:</p></div>
3136
- <div class="ulist"><ul>
3134
+ <div class="ulist"><ul>
3137
3135
  <li>
3138
3136
  <p>
3139
3137
  Upgrading an application sometimes involves upgrading the database schema.
@@ -3153,7 +3151,7 @@ Because there’s no telling which process will serve a request, users may
3153
3151
  </li>
3154
3152
  </ul></div>
3155
3153
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3156
- <div class="ulist"><ul>
3154
+ <div class="ulist"><ul>
3157
3155
  <li>
3158
3156
  <p>
3159
3157
  In the <em>http</em> configuration block.
@@ -3183,7 +3181,7 @@ In an <em>if</em> configuration scope.
3183
3181
  <div class="paragraph"><p>Enables or disables resistance against deployment errors.</p></div>
3184
3182
  <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>
3185
3183
  <div class="paragraph"><p>By enabling deployment error resistance, Phusion Passenger Enterprise would instead do this:</p></div>
3186
- <div class="ulist"><ul>
3184
+ <div class="ulist"><ul>
3187
3185
  <li>
3188
3186
  <p>
3189
3187
  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.
@@ -3203,7 +3201,7 @@ It sets an internal flag so that no processes for this application will be spawn
3203
3201
  <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>
3204
3202
  <div class="paragraph"><p>Enabling deployment error resistance only works if <a href="#PassengerRollingRestarts">rolling restart</a> is also enabled.</p></div>
3205
3203
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3206
- <div class="ulist"><ul>
3204
+ <div class="ulist"><ul>
3207
3205
  <li>
3208
3206
  <p>
3209
3207
  In the <em>http</em> configuration block.
@@ -3255,12 +3253,12 @@ sudo -E passenger-status
3255
3253
  </div>
3256
3254
  </div>
3257
3255
  <div class="admonitionblock">
3258
- <table><tr>
3256
+ <table><tr>
3259
3257
  <td class="icon">
3260
- <img src="./images/icons/note.png" alt="Note">
3258
+ <img src="./images/icons/note.png" alt="Note">
3261
3259
  </td>
3262
3260
  <td class="content">This option has no effect when you are using <a href="#flying_passenger">Flying Passenger</a>. Instead, you should configure this by passing the <span class="monospaced">--temp-dir</span> command line option to the Flying Passenger daemon.</td>
3263
- </tr></table>
3261
+ </tr></table>
3264
3262
  </div>
3265
3263
  </div>
3266
3264
  <div class="sect2">
@@ -3292,7 +3290,7 @@ for an example.</p></div>
3292
3290
  <div class="paragraph"><p>It is allowed to specify this option multiple times. Do this to deploy multiple
3293
3291
  applications in different sub-URIs under the same virtual host.</p></div>
3294
3292
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3295
- <div class="ulist"><ul>
3293
+ <div class="ulist"><ul>
3296
3294
  <li>
3297
3295
  <p>
3298
3296
  In the <em>http</em> configuration block.
@@ -3330,7 +3328,7 @@ read the application process’s response while discarding all the read data. Th
3330
3328
  EPIPE errors but it’ll also mean the backend process will be unavailable for new requests
3331
3329
  until it is done sending its response.</p></div>
3332
3330
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3333
- <div class="ulist"><ul>
3331
+ <div class="ulist"><ul>
3334
3332
  <li>
3335
3333
  <p>
3336
3334
  In the <em>http</em> configuration block.
@@ -3382,7 +3380,7 @@ passenger_set_cgi_param HTTP_X_FORWARDED_FOR 127.0.0.2;</pre>
3382
3380
  </div>
3383
3381
  </div>
3384
3382
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3385
- <div class="ulist"><ul>
3383
+ <div class="ulist"><ul>
3386
3384
  <li>
3387
3385
  <p>
3388
3386
  In the <em>http</em> configuration block.
@@ -3420,7 +3418,7 @@ anyway, similar to how <em>proxy_pass_header</em> works.</p></div>
3420
3418
  </div>
3421
3419
  </div>
3422
3420
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3423
- <div class="ulist"><ul>
3421
+ <div class="ulist"><ul>
3424
3422
  <li>
3425
3423
  <p>
3426
3424
  In the <em>http</em> configuration block.
@@ -3448,7 +3446,7 @@ In an <em>if</em> configuration scope.
3448
3446
  <div class="paragraph"><p>When turned on, application-generated responses are buffered by Nginx. Buffering will
3449
3447
  happen in memory and also on disk if the response is larger than a certain threshold.</p></div>
3450
3448
  <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>
3451
- <div class="olist arabic"><ol class="arabic">
3449
+ <div class="olist arabic"><ol class="arabic">
3452
3450
  <li>
3453
3451
  <p>
3454
3452
  The Nginx response buffering system. <span class="monospaced">passenger_buffer_response</span> turns this on or off.
@@ -3508,7 +3506,7 @@ after which it receives the entire response at once.
3508
3506
  When <span class="monospaced">passenger_buffer_response</span> is turned off, it works as expected: the client
3509
3507
  receives an "entry X" message every second for 10 seconds.</p></div>
3510
3508
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3511
- <div class="ulist"><ul>
3509
+ <div class="ulist"><ul>
3512
3510
  <li>
3513
3511
  <p>
3514
3512
  In the <em>http</em> configuration block.
@@ -3552,12 +3550,12 @@ They can be used to modify the maximum allowed HTTP header size.</p></div>
3552
3550
  <div class="paragraph"><p>This option may only occur once, in the <em>http</em> configuration block.
3553
3551
  The default value is <em>on</em>.</p></div>
3554
3552
  <div class="admonitionblock">
3555
- <table><tr>
3553
+ <table><tr>
3556
3554
  <td class="icon">
3557
- <img src="./images/icons/note.png" alt="Note">
3555
+ <img src="./images/icons/note.png" alt="Note">
3558
3556
  </td>
3559
3557
  <td class="content">This option has no effect when you are using <a href="#flying_passenger">Flying Passenger</a>. You can disable user switching for Flying Passenger by starting the Flying Passenger daemon as a non-root user.</td>
3560
- </tr></table>
3558
+ </tr></table>
3561
3559
  </div>
3562
3560
  </div>
3563
3561
  <div class="sect3">
@@ -3568,7 +3566,7 @@ by default run the web application as the owner of the file <em>config/environme
3568
3566
  that behavior and explicitly set a user to run the web application as, regardless
3569
3567
  of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</p></div>
3570
3568
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3571
- <div class="ulist"><ul>
3569
+ <div class="ulist"><ul>
3572
3570
  <li>
3573
3571
  <p>
3574
3572
  In the <em>http</em> configuration block.
@@ -3602,7 +3600,7 @@ as, regardless of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</
3602
3600
  <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
3603
3601
  the web application’s group will be set to <em>environment.rb</em>/<em>config.ru</em>'s group.</p></div>
3604
3602
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3605
- <div class="ulist"><ul>
3603
+ <div class="ulist"><ul>
3606
3604
  <li>
3607
3605
  <p>
3608
3606
  In the <em>http</em> configuration block.
@@ -3634,12 +3632,12 @@ run as, if user switching fails or is disabled.</p></div>
3634
3632
  <div class="paragraph"><p>This option may only occur once, in the <em>http</em> configuration block.
3635
3633
  The default value is <em>nobody</em>.</p></div>
3636
3634
  <div class="admonitionblock">
3637
- <table><tr>
3635
+ <table><tr>
3638
3636
  <td class="icon">
3639
- <img src="./images/icons/note.png" alt="Note">
3637
+ <img src="./images/icons/note.png" alt="Note">
3640
3638
  </td>
3641
3639
  <td class="content">This option has no effect when you are using <a href="#flying_passenger">Flying Passenger</a>. There is currently no way to set this option when using Flying Passenger, but if you want to disable user switching for Flying Passenger then you can do so by starting the Flying Passenger daemon as a non-root user.</td>
3642
- </tr></table>
3640
+ </tr></table>
3643
3641
  </div>
3644
3642
  </div>
3645
3643
  <div class="sect3">
@@ -3651,12 +3649,12 @@ run as, if user switching fails or is disabled.</p></div>
3651
3649
  The default value is the primary group of the user specifified by
3652
3650
  <a href="#PassengerDefaultUser">passenger_default_user</a>.</p></div>
3653
3651
  <div class="admonitionblock">
3654
- <table><tr>
3652
+ <table><tr>
3655
3653
  <td class="icon">
3656
- <img src="./images/icons/note.png" alt="Note">
3654
+ <img src="./images/icons/note.png" alt="Note">
3657
3655
  </td>
3658
3656
  <td class="content">This option has no effect when you are using <a href="#flying_passenger">Flying Passenger</a>. There is currently no way to set this option when using Flying Passenger, but if you want to disable user switching for Flying Passenger then you can do so by starting the Flying Passenger daemon as a non-root user.</td>
3659
- </tr></table>
3657
+ </tr></table>
3660
3658
  </div>
3661
3659
  </div>
3662
3660
  <div class="sect3">
@@ -3676,7 +3674,7 @@ X-Powered-By: Phusion Passenger</pre>
3676
3674
  </div>
3677
3675
  </div>
3678
3676
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3679
- <div class="ulist"><ul>
3677
+ <div class="ulist"><ul>
3680
3678
  <li>
3681
3679
  <p>
3682
3680
  In the <em>http</em> configuration block.
@@ -3710,7 +3708,7 @@ but the page might reveal potentially sensitive information, depending on the
3710
3708
  application. Experienced system administrators who are using Phusion Passenger
3711
3709
  on serious production servers should consider turning this feature off.</p></div>
3712
3710
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3713
- <div class="ulist"><ul>
3711
+ <div class="ulist"><ul>
3714
3712
  <li>
3715
3713
  <p>
3716
3714
  In the <em>http</em> configuration block.
@@ -3747,12 +3745,12 @@ but improves the ability to handle concurrent HTTP requests.</p></div>
3747
3745
  <div class="paragraph"><p>This option may only occur once, in the <em>http</em> configuration block.
3748
3746
  The default value is <em>6</em>.</p></div>
3749
3747
  <div class="admonitionblock">
3750
- <table><tr>
3748
+ <table><tr>
3751
3749
  <td class="icon">
3752
- <img src="./images/icons/note.png" alt="Note">
3750
+ <img src="./images/icons/note.png" alt="Note">
3753
3751
  </td>
3754
3752
  <td class="content">This option has no effect when you are using <a href="#flying_passenger">Flying Passenger</a>. Instead, you should configure this by passing the <span class="monospaced">--max-pool-size</span> command line option to the Flying Passenger daemon.</td>
3755
- </tr></table>
3753
+ </tr></table>
3756
3754
  </div>
3757
3755
  </div>
3758
3756
  <div class="sect3">
@@ -3763,7 +3761,7 @@ non-zero value if you want to avoid potentially long startup times after a websi
3763
3761
  has been <a href="#idle_process">idle</a> for an extended period.</p></div>
3764
3762
  <div class="paragraph"><p>Please note that this option does <strong>not</strong> pre-start application processes during Nginx
3765
3763
  startup. It just makes sure that when the application is first accessed:</p></div>
3766
- <div class="olist arabic"><ol class="arabic">
3764
+ <div class="olist arabic"><ol class="arabic">
3767
3765
  <li>
3768
3766
  <p>
3769
3767
  at least the given number of processes will be spawned.
@@ -3806,7 +3804,7 @@ simultanously. Phusion Passenger will start 12 more application processes. After
3806
3804
  timeout of 10 seconds have passed, Phusion Passenger will clean up 12 application
3807
3805
  processes, keeping 3 processes around.</p></div>
3808
3806
  <div class="paragraph"><p>The passenger_min_instances option may occur in the following places:</p></div>
3809
- <div class="ulist"><ul>
3807
+ <div class="ulist"><ul>
3810
3808
  <li>
3811
3809
  <p>
3812
3810
  In the <em>http</em> configuration block.
@@ -3841,7 +3839,7 @@ means that there is no limit placed on the number of processes a single applicat
3841
3839
  may spawn, i.e. only the global limit of <a href="#PassengerMaxPoolSize">passenger_max_pool_size</a>
3842
3840
  will be enforced.</p></div>
3843
3841
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3844
- <div class="ulist"><ul>
3842
+ <div class="ulist"><ul>
3845
3843
  <li>
3846
3844
  <p>
3847
3845
  In the <em>http</em> configuration block.
@@ -3865,9 +3863,9 @@ In an <em>if</em> configuration scope.
3865
3863
  </ul></div>
3866
3864
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
3867
3865
  <div class="admonitionblock">
3868
- <table><tr>
3866
+ <table><tr>
3869
3867
  <td class="icon">
3870
- <img src="./images/icons/tip.png" alt="Tip">
3868
+ <img src="./images/icons/tip.png" alt="Tip">
3871
3869
  </td>
3872
3870
  <td class="content">
3873
3871
  <div class="title">Practical usage example</div>
@@ -3878,7 +3876,7 @@ to 10. The e-commerce website is more important to you. You can then set
3878
3876
  than 3 processes, even if it suddenly gets a lot of traffic. Your e-commerce website
3879
3877
  on the other hand will be free to spawn up to 10 processes if it gets a lot of traffic.</p></div>
3880
3878
  </td>
3881
- </tr></table>
3879
+ </tr></table>
3882
3880
  </div>
3883
3881
  </div>
3884
3882
  <div class="sect3">
@@ -3915,12 +3913,12 @@ applications, each which must be available at all times.</p></div>
3915
3913
  <div class="paragraph"><p>This option may only occur once, in the <em>http</em> configuration block.
3916
3914
  The default value is <em>300</em>.</p></div>
3917
3915
  <div class="admonitionblock">
3918
- <table><tr>
3916
+ <table><tr>
3919
3917
  <td class="icon">
3920
- <img src="./images/icons/note.png" alt="Note">
3918
+ <img src="./images/icons/note.png" alt="Note">
3921
3919
  </td>
3922
3920
  <td class="content">This option has no effect when you are using <a href="#flying_passenger">Flying Passenger</a>. Instead, you should configure this by passing the <span class="monospaced">--pool-idle-time</span> command line option to the Flying Passenger daemon.</td>
3923
- </tr></table>
3921
+ </tr></table>
3924
3922
  </div>
3925
3923
  </div>
3926
3924
  <div class="sect3">
@@ -3938,7 +3936,7 @@ you’re using the <em>smart</em> or <em>smart-lv2</em> <a href="#RailsSpawnMeth
3938
3936
  system has enough memory, is it recommended that you set this option to a high
3939
3937
  value or to <em>0</em>.</p></div>
3940
3938
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3941
- <div class="ulist"><ul>
3939
+ <div class="ulist"><ul>
3942
3940
  <li>
3943
3941
  <p>
3944
3942
  In the <em>http</em> configuration block.
@@ -3962,19 +3960,19 @@ In an <em>if</em> configuration scope.
3962
3960
  </ul></div>
3963
3961
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>300</em> (5 minutes).</p></div>
3964
3962
  <div class="admonitionblock">
3965
- <table><tr>
3963
+ <table><tr>
3966
3964
  <td class="icon">
3967
- <img src="./images/icons/note.png" alt="Note">
3965
+ <img src="./images/icons/note.png" alt="Note">
3968
3966
  </td>
3969
3967
  <td class="content">This option has no effect when you are using <a href="#flying_passenger">Flying Passenger</a>. Instead, you should configure this by passing the <span class="monospaced">--max-preloader-idle-time</span> command line option to the Flying Passenger daemon.</td>
3970
- </tr></table>
3968
+ </tr></table>
3971
3969
  </div>
3972
3970
  </div>
3973
3971
  <div class="sect3">
3974
3972
  <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.13.7. passenger_concurrency_model &lt;process|thread&gt;</h4>
3975
3973
  <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>
3976
3974
  <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>
3977
- <div class="ulist"><ul>
3975
+ <div class="ulist"><ul>
3978
3976
  <li>
3979
3977
  <p>
3980
3978
  <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.
@@ -3987,7 +3985,7 @@ In an <em>if</em> configuration scope.
3987
3985
  </li>
3988
3986
  </ul></div>
3989
3987
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3990
- <div class="ulist"><ul>
3988
+ <div class="ulist"><ul>
3991
3989
  <li>
3992
3990
  <p>
3993
3991
  In the <em>http</em> configuration block.
@@ -4016,7 +4014,7 @@ In an <em>if</em> configuration scope.
4016
4014
  <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>
4017
4015
  <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>
4018
4016
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4019
- <div class="ulist"><ul>
4017
+ <div class="ulist"><ul>
4020
4018
  <li>
4021
4019
  <p>
4022
4020
  In the <em>http</em> configuration block.
@@ -4051,7 +4049,7 @@ reached.</p></div>
4051
4049
  it down after a certain number of requests, all of its memory is guaranteed
4052
4050
  to be freed by the operating system.</p></div>
4053
4051
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4054
- <div class="ulist"><ul>
4052
+ <div class="ulist"><ul>
4055
4053
  <li>
4056
4054
  <p>
4057
4055
  In the <em>http</em> configuration block.
@@ -4075,9 +4073,9 @@ In an <em>if</em> configuration scope.
4075
4073
  </ul></div>
4076
4074
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
4077
4075
  <div class="admonitionblock">
4078
- <table><tr>
4076
+ <table><tr>
4079
4077
  <td class="icon">
4080
- <img src="./images/icons/caution.png" alt="Caution">
4078
+ <img src="./images/icons/caution.png" alt="Caution">
4081
4079
  </td>
4082
4080
  <td class="content">
4083
4081
  <div class="paragraph"><p>The <a href="#PassengerMaxRequests">passenger_max_requests</a> directive should be considered
@@ -4085,7 +4083,7 @@ as a workaround for misbehaving applications. It is advised that you fix the
4085
4083
  problem in your application rather than relying on these directives as a
4086
4084
  measure to avoid memory leaks.</p></div>
4087
4085
  </td>
4088
- </tr></table>
4086
+ </tr></table>
4089
4087
  </div>
4090
4088
  </div>
4091
4089
  <div class="sect3">
@@ -4098,7 +4096,7 @@ restarted upon the next request. A value of 0 means that there is no time limit.
4098
4096
  <div class="paragraph"><p>This option is useful for preventing your application from freezing for an
4099
4097
  indefinite period of time.</p></div>
4100
4098
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4101
- <div class="ulist"><ul>
4099
+ <div class="ulist"><ul>
4102
4100
  <li>
4103
4101
  <p>
4104
4102
  In the <em>http</em> configuration block.
@@ -4146,9 +4144,9 @@ to 10 seconds. You can then configure Phusion Passenger as follows:</p>
4146
4144
  or if a request to any other URI takes more than 2 seconds,
4147
4145
  then the corresponding application process will be forced to shutdown.</p></div>
4148
4146
  <div class="admonitionblock">
4149
- <table><tr>
4147
+ <table><tr>
4150
4148
  <td class="icon">
4151
- <img src="./images/icons/caution.png" alt="Caution">
4149
+ <img src="./images/icons/caution.png" alt="Caution">
4152
4150
  </td>
4153
4151
  <td class="content">
4154
4152
  <div class="paragraph"><p>The <a href="#PassengerMaxRequestTime">passenger_max_request_time</a> directive should be
@@ -4156,18 +4154,18 @@ considered as a workaround for misbehaving applications. It is advised that you
4156
4154
  fix the problem in your application rather than relying on these directives as a
4157
4155
  measure to avoid freezing applications.</p></div>
4158
4156
  </td>
4159
- </tr></table>
4157
+ </tr></table>
4160
4158
  </div>
4161
4159
  <div class="admonitionblock">
4162
- <table><tr>
4160
+ <table><tr>
4163
4161
  <td class="icon">
4164
- <img src="./images/icons/note.png" alt="Note">
4162
+ <img src="./images/icons/note.png" alt="Note">
4165
4163
  </td>
4166
4164
  <td class="content">
4167
4165
  <div class="paragraph"><p>This option is currently only available for Ruby apps. It is not yet available
4168
4166
  for Python and Node.js.</p></div>
4169
4167
  </td>
4170
- </tr></table>
4168
+ </tr></table>
4171
4169
  </div>
4172
4170
  </div>
4173
4171
  <div class="sect3">
@@ -4181,7 +4179,7 @@ will not be checked.</p></div>
4181
4179
  <div class="paragraph"><p>This option is useful if your application is leaking memory. By shutting
4182
4180
  it down, all of its memory is guaranteed to be freed by the operating system.</p></div>
4183
4181
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4184
- <div class="ulist"><ul>
4182
+ <div class="ulist"><ul>
4185
4183
  <li>
4186
4184
  <p>
4187
4185
  In the <em>http</em> configuration block.
@@ -4205,9 +4203,9 @@ In an <em>if</em> configuration scope.
4205
4203
  </ul></div>
4206
4204
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
4207
4205
  <div class="admonitionblock">
4208
- <table><tr>
4206
+ <table><tr>
4209
4207
  <td class="icon">
4210
- <img src="./images/icons/note.png" alt="Note">
4208
+ <img src="./images/icons/note.png" alt="Note">
4211
4209
  </td>
4212
4210
  <td class="content">
4213
4211
  <div class="title">A word about permissions</div>
@@ -4218,12 +4216,12 @@ not obtainable through <span class="monospaced">ps</span>. You should ensure tha
4218
4216
  correctly and that the <span class="monospaced">/proc</span> filesystem is accessible by the
4219
4217
  <span class="monospaced">PassengerHelperAgent</span> process.</p></div>
4220
4218
  </td>
4221
- </tr></table>
4219
+ </tr></table>
4222
4220
  </div>
4223
4221
  <div class="admonitionblock">
4224
- <table><tr>
4222
+ <table><tr>
4225
4223
  <td class="icon">
4226
- <img src="./images/icons/caution.png" alt="Caution">
4224
+ <img src="./images/icons/caution.png" alt="Caution">
4227
4225
  </td>
4228
4226
  <td class="content">
4229
4227
  <div class="paragraph"><p>The <a href="#PassengerMaxRequests">passenger_max_requests</a> and
@@ -4232,7 +4230,7 @@ as workarounds for misbehaving applications. It is advised that you fix the
4232
4230
  problem in your application rather than relying on these directives as a
4233
4231
  measure to avoid memory leaks.</p></div>
4234
4232
  </td>
4235
- </tr></table>
4233
+ </tr></table>
4236
4234
  </div>
4237
4235
  </div>
4238
4236
  <div class="sect3">
@@ -4243,14 +4241,14 @@ web application might experience a small delay as Phusion Passenger is starting
4243
4241
  the web application on demand. If that is undesirable, then this directive can be
4244
4242
  used to pre-started application processes during Nginx startup.</p></div>
4245
4243
  <div class="paragraph"><p>A few things to be careful of:</p></div>
4246
- <div class="ulist"><ul>
4244
+ <div class="ulist"><ul>
4247
4245
  <li>
4248
4246
  <p>
4249
4247
  This directive accepts the <strong>URL</strong> of the web application you want to pre-start,
4250
4248
  not a on/off value! This might seem a bit weird, but read on for rationale. As
4251
4249
  for the specifics of the URL:
4252
4250
  </p>
4253
- <div class="ulist"><ul>
4251
+ <div class="ulist"><ul>
4254
4252
  <li>
4255
4253
  <p>
4256
4254
  The domain part of the URL must be equal to the value of the <em>server_name</em>
@@ -4283,12 +4281,12 @@ You will probably want to combine this option with
4283
4281
  <div class="paragraph"><p>This option may only occur in the <em>http</em> configuration block. It may be specified
4284
4282
  any number of times.</p></div>
4285
4283
  <div class="admonitionblock">
4286
- <table><tr>
4284
+ <table><tr>
4287
4285
  <td class="icon">
4288
- <img src="./images/icons/note.png" alt="Note">
4286
+ <img src="./images/icons/note.png" alt="Note">
4289
4287
  </td>
4290
4288
  <td class="content">This option is currently not available when using <a href="#flying_passenger">Flying Passenger</a>.</td>
4291
- </tr></table>
4289
+ </tr></table>
4292
4290
  </div>
4293
4291
  <div class="sect4">
4294
4292
  <h5 id="_example_1_basic_usage">Example 1: basic usage</h5>
@@ -4466,7 +4464,7 @@ the request ending up at a different web server in the cluster.</p></div>
4466
4464
  write to the Nginx error log file. A higher log level value means that more
4467
4465
  information will be logged.</p></div>
4468
4466
  <div class="paragraph"><p>Possible values are:</p></div>
4469
- <div class="ulist"><ul>
4467
+ <div class="ulist"><ul>
4470
4468
  <li>
4471
4469
  <p>
4472
4470
  <em>0</em>: Show only errors and warnings.
@@ -4500,12 +4498,12 @@ web server error log. This option allows one to specify the file that debugging
4500
4498
  error messages should be written to instead.</p></div>
4501
4499
  <div class="paragraph"><p>This option may only occur once, in the <em>http</em> configuration block.</p></div>
4502
4500
  <div class="admonitionblock">
4503
- <table><tr>
4501
+ <table><tr>
4504
4502
  <td class="icon">
4505
- <img src="./images/icons/note.png" alt="Note">
4503
+ <img src="./images/icons/note.png" alt="Note">
4506
4504
  </td>
4507
4505
  <td class="content">This option has no effect when you are using <a href="#flying_passenger">Flying Passenger</a>. Instead, you should configure this by passing the <span class="monospaced">--log-file</span> command line option to the Flying Passenger daemon.</td>
4508
- </tr></table>
4506
+ </tr></table>
4509
4507
  </div>
4510
4508
  </div>
4511
4509
  <div class="sect3">
@@ -4523,7 +4521,7 @@ gem 'debugger', :platforms =&gt; :ruby_19</pre>
4523
4521
  </div>
4524
4522
  <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>
4525
4523
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4526
- <div class="ulist"><ul>
4524
+ <div class="ulist"><ul>
4527
4525
  <li>
4528
4526
  <p>
4529
4527
  In the <em>http</em> configuration block.
@@ -4554,7 +4552,7 @@ In an <em>if</em> configuration scope.
4554
4552
  <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.15.1. rails_env &lt;string&gt;</h4>
4555
4553
  <div class="paragraph"><p>This option allows one to specify the default <span class="monospaced">RAILS_ENV</span> value.</p></div>
4556
4554
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4557
- <div class="ulist"><ul>
4555
+ <div class="ulist"><ul>
4558
4556
  <li>
4559
4557
  <p>
4560
4558
  In the <em>http</em> configuration block.
@@ -4585,7 +4583,7 @@ In an <em>if</em> configuration scope.
4585
4583
  <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.16.1. rack_env &lt;string&gt;</h4>
4586
4584
  <div class="paragraph"><p>This option allows one to specify the default <span class="monospaced">RACK_ENV</span> value.</p></div>
4587
4585
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4588
- <div class="ulist"><ul>
4586
+ <div class="ulist"><ul>
4589
4587
  <li>
4590
4588
  <p>
4591
4589
  In the <em>http</em> configuration block.
@@ -4675,14 +4673,14 @@ we see that all the Apache and Nginx worker processes only take less than 1 MB m
4675
4673
  This is a lot less than the 50-80 MB-ish memory usage as shown in the <em>VMSize</em> column
4676
4674
  (which is what a lot of people think is the real memory usage, but is actually not).</p></div>
4677
4675
  <div class="admonitionblock">
4678
- <table><tr>
4676
+ <table><tr>
4679
4677
  <td class="icon">
4680
- <img src="./images/icons/note.png" alt="Note">
4678
+ <img src="./images/icons/note.png" alt="Note">
4681
4679
  </td>
4682
4680
  <td class="content">Private dirty RSS reporting only works on Linux. Unfortunately other operating systems
4683
4681
  don’t provide facilities for determining processes' private dirty RSS. On non-Linux systems,
4684
4682
  the Resident Set Size is reported instead.</td>
4685
- </tr></table>
4683
+ </tr></table>
4686
4684
  </div>
4687
4685
  </div>
4688
4686
  <div class="sect2">
@@ -4704,7 +4702,7 @@ inactive = 1
4704
4702
  </div>
4705
4703
  </div>
4706
4704
  <div class="paragraph"><p>The <em>general information</em> section shows the following information:</p></div>
4707
- <div class="dlist"><dl>
4705
+ <div class="dlist"><dl>
4708
4706
  <dt class="hdlist1">
4709
4707
  max
4710
4708
  </dt>
@@ -4748,7 +4746,7 @@ time). The value of <em>inactive</em> equals <span class="monospaced">count - ac
4748
4746
  </dl></div>
4749
4747
  <div class="paragraph"><p>The <em>domains</em> section shows, for each application directory, information about running
4750
4748
  application instances:</p></div>
4751
- <div class="dlist"><dl>
4749
+ <div class="dlist"><dl>
4752
4750
  <dt class="hdlist1">
4753
4751
  Sessions
4754
4752
  </dt>
@@ -4815,13 +4813,13 @@ This is the case with Ruby on Rails. So if you kill a Ruby on Rails application
4815
4813
  running it in a <em>production</em> environment). If you don’t see a backtrace there, check
4816
4814
  the web server error log.</p></div>
4817
4815
  <div class="admonitionblock">
4818
- <table><tr>
4816
+ <table><tr>
4819
4817
  <td class="icon">
4820
- <img src="./images/icons/note.png" alt="Note">
4818
+ <img src="./images/icons/note.png" alt="Note">
4821
4819
  </td>
4822
4820
  <td class="content">It is safe to kill application instances, even in live environments. Phusion Passenger
4823
4821
  will restart killed application instances, as if nothing bad happened.</td>
4824
- </tr></table>
4822
+ </tr></table>
4825
4823
  </div>
4826
4824
  </div>
4827
4825
  <div class="sect2">
@@ -4830,7 +4828,7 @@ will restart killed application instances, as if nothing bad happened.</td>
4830
4828
  the request to the most suitable application process, but sometimes it is desirable to
4831
4829
  be able to directly access the individual application processes. Use cases include, but
4832
4830
  are not limited to:</p></div>
4833
- <div class="ulist"><ul>
4831
+ <div class="ulist"><ul>
4834
4832
  <li>
4835
4833
  <p>
4836
4834
  One wants to debug a memory leak or memory bloat problem that only seems to appear on
@@ -4918,12 +4916,12 @@ and they’re explained further down in this section.</p></div>
4918
4916
  <div class="sect3">
4919
4917
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_requirements"></span><h4 data-comment-topic="requirements-15ozqdj" data-anchor="_requirements">8.1.1. Requirements</h4>
4920
4918
  <div class="paragraph"><p>User switching is only enabled when all of the following conditions are met:</p></div>
4921
- <div class="ulist"><ul>
4919
+ <div class="ulist"><ul>
4922
4920
  <li>
4923
4921
  <p>
4924
4922
  When not using <a href="#flying_passenger">Flying Passenger</a> (this is probably the case):
4925
4923
  </p>
4926
- <div class="ulist"><ul>
4924
+ <div class="ulist"><ul>
4927
4925
  <li>
4928
4926
  <p>
4929
4927
  The
@@ -4942,7 +4940,7 @@ The web server’s control process must have root privileges. This is the case o
4942
4940
  <p>
4943
4941
  When using <a href="#flying_passenger">Flying Passenger</a>:
4944
4942
  </p>
4945
- <div class="ulist"><ul>
4943
+ <div class="ulist"><ul>
4946
4944
  <li>
4947
4945
  <p>
4948
4946
  The Flying Passenger daemon must be run with root privileges.
@@ -4957,49 +4955,49 @@ The Flying Passenger daemon must be run with root privileges.
4957
4955
  <div class="paragraph"><p>When not using Flying Passenger, the following table illustrates the effect for different combinations of the requirements.</p></div>
4958
4956
  <table class="tableblock frame-all grid-all" style="
4959
4957
  width:100%;
4960
- ">
4961
- <col style="width:33%;">
4962
- <col style="width:33%;">
4963
- <col style="width:33%;">
4964
- <tbody>
4965
- <tr>
4958
+ ">
4959
+ <col style="width:33%;">
4960
+ <col style="width:33%;">
4961
+ <col style="width:33%;">
4962
+ <tbody>
4963
+ <tr>
4966
4964
  <td class="tableblock halign-left valign-top"><p class="tableblock"></p></td>
4967
4965
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>passenger_user_switching on</strong></p></td>
4968
4966
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>passenger_user_switching off</strong></p></td>
4969
- </tr>
4970
- <tr>
4967
+ </tr>
4968
+ <tr>
4971
4969
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Web server has root privileges</strong></p></td>
4972
4970
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching enabled.</p></td>
4973
4971
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching disabled. Apps are run as
4974
4972
  <a href="#PassengerDefaultUser">passenger_default_user</a> and
4975
4973
  <a href="#PassengerDefaultGroup">passenger_default_group</a>.</p></td>
4976
- </tr>
4977
- <tr>
4974
+ </tr>
4975
+ <tr>
4978
4976
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Web server has no root privileges</strong></p></td>
4979
4977
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching disabled. Apps are run as the web server’s user.</p></td>
4980
4978
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching disabled. Apps are run as the web server’s user.</p></td>
4981
- </tr>
4982
- </tbody>
4983
- </table>
4979
+ </tr>
4980
+ </tbody>
4981
+ </table>
4984
4982
  <div class="paragraph"><p>When using Flying Passenger, the effect is as follows:</p></div>
4985
4983
  <table class="tableblock frame-all grid-all" style="
4986
4984
  width:100%;
4987
- ">
4988
- <col style="width:50%;">
4989
- <col style="width:50%;">
4990
- <tbody>
4991
- <tr>
4985
+ ">
4986
+ <col style="width:50%;">
4987
+ <col style="width:50%;">
4988
+ <tbody>
4989
+ <tr>
4992
4990
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Daemon run with root privileges</strong></p></td>
4993
4991
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching enabled.</p></td>
4994
- </tr>
4995
- <tr>
4992
+ </tr>
4993
+ <tr>
4996
4994
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Daemon run without root privileges</strong></p></td>
4997
4995
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching disabled. Apps are run as the daemon’s user.</p></td>
4998
- </tr>
4999
- </tbody>
5000
- </table>
4996
+ </tr>
4997
+ </tbody>
4998
+ </table>
5001
4999
  <div class="paragraph"><p>When user switching is enabled, the following rules are followed to determine what user an application should be run as. The first matching rule is the rule that will be followed.</p></div>
5002
- <div class="olist arabic"><ol class="arabic">
5000
+ <div class="olist arabic"><ol class="arabic">
5003
5001
  <li>
5004
5002
  <p>
5005
5003
  If
@@ -5025,7 +5023,7 @@ Otherwise, the application is run as the owner of the startup file.
5025
5023
  <div class="sect3">
5026
5024
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_caveats_amp_troubleshooting"></span><h4 data-comment-topic="caveats-troubleshooting-mbw582" data-anchor="_caveats_amp_troubleshooting">8.1.3. Caveats &amp; troubleshooting</h4>
5027
5025
  <div class="paragraph"><p>If your application regularly encounters permission errors or fails to find certain files, then this is an indication that your application is started as a user that you did not intent it to be run as. Other symptoms include:</p></div>
5028
- <div class="ulist"><ul>
5026
+ <div class="ulist"><ul>
5029
5027
  <li>
5030
5028
  <p>
5031
5029
  The application fails to start because Bundler complains that it cannot find gems. This probably indicates that Bundler does not have read access to the directory that contains Bundler-installed gems.
@@ -5082,7 +5080,7 @@ Requests in top-level queue : 0
5082
5080
  <div class="sect2">
5083
5081
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="reducing_memory_usage"></span><h3 data-comment-topic="reducing-memory-consumption-of-ruby-on-rails-applications-by-33--1o3z66q" data-anchor="reducing_memory_usage">8.2. Copy-on-write memory support (reducing memory consumption of Ruby applications)</h3>
5084
5082
  <div class="paragraph"><p>Phusion Passenger automatically leverages operating system virtual memory copy-on-write features in order to reduce the memory usage of Ruby applications. Experience has shown that this reduces memory usage by 33% on average. For this mechanism to work, a Ruby interpreter with a copy-on-write friendly garbage collector is required. The following Ruby interpreters have copy-on-write friendly garbage collectors:</p></div>
5085
- <div class="ulist"><ul>
5083
+ <div class="ulist"><ul>
5086
5084
  <li>
5087
5085
  <p>
5088
5086
  MRI Ruby &gt;= 2.0. Versions prior to 2.0 did not have a copy-on-write friendly garbage collector.
@@ -5136,7 +5134,7 @@ end</pre>
5136
5134
  The support consists of loading your application under the environment defined by your
5137
5135
  Gemfile. In other words, Phusion Passenger loads your application as if <em>bundle exec</em> was used.</p></div>
5138
5136
  <div class="paragraph"><p>The Bundler support works as follows:</p></div>
5139
- <div class="ulist"><ul>
5137
+ <div class="ulist"><ul>
5140
5138
  <li>
5141
5139
  <p>
5142
5140
  If you have a <em>.bundle/environment.rb</em> in your application root, then Phusion
@@ -5201,9 +5199,9 @@ application’s root folder. Unlike <em>restart.txt</em>, Phusion Passenger does
5201
5199
  check for this file’s timestamp: Phusion Passenger will always restart the
5202
5200
  application, as long as <em>always_restart.txt</em> exists.</p></div>
5203
5201
  <div class="admonitionblock">
5204
- <table><tr>
5202
+ <table><tr>
5205
5203
  <td class="icon">
5206
- <img src="./images/icons/note.png" alt="Note">
5204
+ <img src="./images/icons/note.png" alt="Note">
5207
5205
  </td>
5208
5206
  <td class="content">If you’re just developing a Rails application then you probably don’t need
5209
5207
  this feature. If you set
@@ -5213,7 +5211,7 @@ then Rails will automatically reload your application code after each request.
5213
5211
  <em>always_restart.txt</em> is mostly useful when you’re using a web framework that
5214
5212
  doesn’t support code reloading by itself, of when you’re working on a web framework
5215
5213
  yourself.</td>
5216
- </tr></table>
5214
+ </tr></table>
5217
5215
  </div>
5218
5216
  </div>
5219
5217
  <div class="sect2">
@@ -5261,7 +5259,7 @@ please refer to
5261
5259
  <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>
5262
5260
  <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>
5263
5261
  <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>
5264
- <div class="ulist"><ul>
5262
+ <div class="ulist"><ul>
5265
5263
  <li>
5266
5264
  <p>
5267
5265
  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.
@@ -5274,7 +5272,7 @@ Phusion Passenger can spawn more processes as necessary, in order to prevent sit
5274
5272
  </li>
5275
5273
  </ul></div>
5276
5274
  <div class="paragraph"><p>Applications can use Out-of-Band Work as follows:</p></div>
5277
- <div class="olist arabic"><ol class="arabic">
5275
+ <div class="olist arabic"><ol class="arabic">
5278
5276
  <li>
5279
5277
  <p>
5280
5278
  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.
@@ -5326,7 +5324,7 @@ http://www.gnu.org/software/src-highlite -->
5326
5324
  </div>
5327
5325
  <div class="paragraph"><p>It should be noted that, although the application uses the Phusion Passenger API, it is <a href="#add_passenger_to_gemfile"><strong>not</strong> necessary to add Phusion Passenger to the Gemfile</a>.</p></div>
5328
5326
  <div class="paragraph"><p>References:</p></div>
5329
- <div class="ulist"><ul>
5327
+ <div class="ulist"><ul>
5330
5328
  <li>
5331
5329
  <p>
5332
5330
  <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>
@@ -5340,7 +5338,7 @@ http://www.gnu.org/software/src-highlite -->
5340
5338
  <div class="paragraph"><p>Flying Passenger allows one to decouple Phusion Passenger’s life time from the web server’s life time, so that the web server can be independently restarted from Phusion Passenger, and from any of the application processes served by Phusion Passenger.</p></div>
5341
5339
  <div class="paragraph"><p>Normally, Phusion Passenger starts together with the web server, and shuts down together with the web server. The advantages of this default behavior is that it makes Phusion Passenger easy to administer: one only has to deal with the web server process and can expect all relevant processes to be cleaned up after a web server shut down. However this also brings about a disadvantage: every time one restarts the web server (e.g. to make a minor configuration change), Phusion Passenger and all its application processes also get restarted.</p></div>
5342
5340
  <div class="paragraph"><p>This problem is solved by <em>Flying Passenger</em>, which is an advanced mode of operation in Phusion Passenger that allows the web server to be indepedently restarted from Phusion Passenger. When this mode is enabled:</p></div>
5343
- <div class="ulist"><ul>
5341
+ <div class="ulist"><ul>
5344
5342
  <li>
5345
5343
  <p>
5346
5344
  One must start Phusion Passenger separately from the web server, namely by starting the Flying Passenger daemon. This daemon must - to an extent - be separately configured and managed from the web server.
@@ -5509,7 +5507,7 @@ exec /path-to/flying-passenger \
5509
5507
  <div class="sect3">
5510
5508
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="flying_passenger_caveats"></span><h4 data-comment-topic="caveats-and-limitations-15wakf" data-anchor="flying_passenger_caveats">8.9.5. Caveats and limitations</h4>
5511
5509
  <div class="paragraph"><p>Beware of the following caveats and limitations when using Flying Passenger:</p></div>
5512
- <div class="ulist"><ul>
5510
+ <div class="ulist"><ul>
5513
5511
  <li>
5514
5512
  <p>
5515
5513
  The Nginx executable <strong>must</strong> be compiled with the same version of Phusion Passenger as the Flying Passenger daemon. Failing to meet this requirement may result in cryptic errors, or may result in certain features not working, until you’ve fixed the situation. When upgrading Phusion Passenger, you must restart both Nginx and the Flying Passenger daemon.
@@ -5529,7 +5527,7 @@ When you add a new application to the web server configuration, Flying Passenger
5529
5527
  <p>
5530
5528
  When you remove an application from the web server configuration, Flying Passenger will not detect the removal and will not shut down the associated application processes. Killing the application processes will also not help, because Flying Passenger will restart them per the (now-removed, but still in the Flying Passenger daemon’s memory) <a href="#PassengerMinInstances">passenger_min_instances</a> settings. At the moment, there are two ways to get rid of those processes:
5531
5529
  </p>
5532
- <div class="ulist"><ul>
5530
+ <div class="ulist"><ul>
5533
5531
  <li>
5534
5532
  <p>
5535
5533
  Before removing the application from the web server configuration, explicitly set its <span class="monospaced">passenger_min_instances</span> to 0. Next, send a request to it, which will cause the Flying Passenger daemon to take over the new <span class="monospaced">passenger_min_instances 0</span> option. You can then proceed with removing the application from the web server configuration, and restarting the web server. Finally, kill the PIDs associated to those application processes and remove the application configuration.
@@ -5562,7 +5560,7 @@ This check occurs after checking whether the original mapped filename exists (as
5562
5560
  of static asset serving). All this is done without the need for special mod_rewrite
5563
5561
  rules.</p></div>
5564
5562
  <div class="paragraph"><p>For example, suppose that the browser requests <em>/foo/bar</em>.</p></div>
5565
- <div class="olist arabic"><ol class="arabic">
5563
+ <div class="olist arabic"><ol class="arabic">
5566
5564
  <li>
5567
5565
  <p>
5568
5566
  Phusion Passenger will first check whether this URI maps to a static file, i.e.
@@ -5603,7 +5601,7 @@ whether the following file exists:</p></div>
5603
5601
  </div>
5604
5602
  <div class="paragraph"><p>If you’re not a programmer and don’t understand the above pseudo-code snippet, it means
5605
5603
  that Phusion Passenger will:</p></div>
5606
- <div class="olist arabic"><ol class="arabic">
5604
+ <div class="olist arabic"><ol class="arabic">
5607
5605
  <li>
5608
5606
  <p>
5609
5607
  Extract the parent directory filename from the value of the “root” directive.
@@ -5638,14 +5636,12 @@ Phusion Passenger will look for <em>config.ru</em> instead of <em>config/environ
5638
5636
  Attribution-Share Alike 3.0 Unported License</a>.</p></div>
5639
5637
  <div class="paragraph"><p><span class="image">
5640
5638
  <a class="image" href="http://creativecommons.org/licenses/by-sa/3.0/">
5641
- <img src="images/by_sa.png" alt="images/by_sa.png">
5642
- </a>
5639
+ <img src="images/by_sa.png" alt="images/by_sa.png"></a>
5643
5640
  </span></p></div>
5644
5641
  <div class="paragraph"><p>Phusion Passenger is brought to you by <a href="http://www.phusion.nl/">Phusion</a>.</p></div>
5645
5642
  <div class="paragraph"><p><span class="image">
5646
5643
  <a class="image" href="http://www.phusion.nl/">
5647
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
5648
- </a>
5644
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
5649
5645
  </span></p></div>
5650
5646
  <div class="paragraph"><p>Phusion Passenger is a trademark of Hongli Lai &amp; Ninh Bui.</p></div>
5651
5647
  </div>
@@ -5755,20 +5751,18 @@ programmers jargon, Phusion Passenger calls fork(), but not exec().</p></div>
5755
5751
  <div class="sect2">
5756
5752
  <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>
5757
5753
  <div class="admonitionblock">
5758
- <table><tr>
5754
+ <table><tr>
5759
5755
  <td class="icon">
5760
- <img src="./images/icons/note.png" alt="Note">
5756
+ <img src="./images/icons/note.png" alt="Note">
5761
5757
  </td>
5762
5758
  <td class="content">Smart spawning is supported for all Ruby applications but not for WSGI applications.</td>
5763
- </tr></table>
5759
+ </tr></table>
5764
5760
  </div>
5765
5761
  <div class="paragraph"><p>While direct spawning works well, it’s not as efficient as it could be
5766
5762
  because each worker process has its own private copy of the Rails application
5767
5763
  as well as the Rails framework. This wastes memory as well as startup time.</p></div>
5768
5764
  <div class="paragraph"><p><span class="image">
5769
- <img src="images/direct_spawning.png" alt="Worker processes and direct spawning">
5770
- </span><br>
5771
- <em>Figure: Worker processes and direct spawning. Each worker process has its
5765
+ <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
5772
5766
  own private copy of the application code and Rails framework code.</em></p></div>
5773
5767
  <div class="paragraph"><p>It is possible to make the different worker processes share the memory occupied
5774
5768
  by application and Rails framework code, by utilizing so-called
@@ -5792,15 +5786,13 @@ processes will share as much common
5792
5786
  memory as possible. That is, they will all share the same application and Rails
5793
5787
  framework code.</p></div>
5794
5788
  <div class="paragraph"><p><span class="image">
5795
- <img src="images/smart.png" alt="images/smart.png">
5796
- </span><br>
5797
- <em>Figure: Worker processes and the smart spawn method. All worker processes,
5789
+ <img src="images/smart.png" alt="images/smart.png"></span><br><em>Figure: Worker processes and the smart spawn method. All worker processes,
5798
5790
  as well as the ApplicationSpawner, share the same application code and Rails
5799
5791
  framework code.</em></p></div>
5800
5792
  <div class="paragraph"><p>The <em>smart</em> method allows different worker processes that belong to the same
5801
5793
  application to share memory.</p></div>
5802
5794
  <div class="paragraph"><p>Notes:</p></div>
5803
- <div class="ulist"><ul>
5795
+ <div class="ulist"><ul>
5804
5796
  <li>
5805
5797
  <p>
5806
5798
  Vendored Rails frameworks cannot be shared by different applications, even if
@@ -6034,7 +6026,7 @@ has no effect.</p></div>
6034
6026
  <div class="paragraph"><p>Environment variables are named values that affect how the system works. For example they tell the system where to look for commands (the <span class="monospaced">PATH</span> variable) or where to look for libraries (<span class="monospaced">LD_LIBRARY_PATH</span>). Their names are often in all-uppercase. Sometimes people refer to an environment variable with a dollar sign <span class="monospaced">$</span> in front, but that’s the same thing: when people say "the $PATH environment variable" they mean "the PATH environment variable". This is because the dollar sign <span class="monospaced">$</span> is a shell syntax for refering to an environment variable, as you will learn later.</p></div>
6035
6027
  <div class="paragraph"><p>Environment variables are set on a <strong>per-process</strong> basis, but they are <strong>inherited</strong> by child processes. This means that if you set environment variables in process A, another already running process B will not see these new environment variables. But if A spawns a child process C, then C will have all environment variables that A had. If you once again change the environment variables in A, then C will not see the changes.</p></div>
6036
6028
  <div class="paragraph"><p>The per-process nature of environment variables some implications. When you set environment variables in your <span class="monospaced">bashrc</span> or other bash startup files…</p></div>
6037
- <div class="ulist"><ul>
6029
+ <div class="ulist"><ul>
6038
6030
  <li>
6039
6031
  <p>
6040
6032
  …only newly spawned bash shells see them.
@@ -6052,12 +6044,12 @@ has no effect.</p></div>
6052
6044
  </li>
6053
6045
  </ul></div>
6054
6046
  <div class="admonitionblock">
6055
- <table><tr>
6047
+ <table><tr>
6056
6048
  <td class="icon">
6057
- <img src="./images/icons/note.png" alt="Note">
6049
+ <img src="./images/icons/note.png" alt="Note">
6058
6050
  </td>
6059
6051
  <td class="content">Because this chapter is meant for beginners, it assumes that the reader uses the bash shell. This chapter does not describe instructions for zsh, csh or other shells. We assume that users of other shells are familiar with the Bourne shell syntax, and know how to apply the instructions in this chapter in their shells' native syntaxes.</td>
6060
- </tr></table>
6052
+ </tr></table>
6061
6053
  </div>
6062
6054
  <div class="sect2">
6063
6055
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_working_with_environment_variables"></span><h3 data-comment-topic="working-with-environment-variables-1kmvq8w" data-anchor="_working_with_environment_variables">13.1. Working with environment variables</h3>
@@ -6094,9 +6086,9 @@ ruby -e <span style="color: #FF0000">'p ENV["APXS2"]'</span>
6094
6086
  </div>
6095
6087
  </div>
6096
6088
  <div class="admonitionblock">
6097
- <table><tr>
6089
+ <table><tr>
6098
6090
  <td class="icon">
6099
- <img src="./images/icons/note.png" alt="Note">
6091
+ <img src="./images/icons/note.png" alt="Note">
6100
6092
  </td>
6101
6093
  <td class="content">
6102
6094
  <div class="title">The "export" keyword is important</div>
@@ -6113,7 +6105,7 @@ ruby -e <span style="color: #FF0000">'p ENV["APXS2"]'</span>
6113
6105
  </div>
6114
6106
  </div>
6115
6107
  </td>
6116
- </tr></table>
6108
+ </tr></table>
6117
6109
  </div>
6118
6110
  <div class="paragraph"><p>You can reference an environment variable in your shell by typing the <span class="monospaced">$</span> sign followed by the environment variable’s name. For example, to see the value of the <span class="monospaced">PATH</span> variable:</p></div>
6119
6111
  <div class="listingblock">
@@ -6191,7 +6183,7 @@ user@localhost bash$ frobnicator
6191
6183
  <div class="sect3">
6192
6184
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_adding_phusion_passenger_8217_s_administration_tools_to_path"></span><h4 data-comment-topic="adding-phusion-passenger-s-administration-tools-to-path-1flz2tu" data-anchor="_adding_phusion_passenger_8217_s_administration_tools_to_path">13.2.1. Adding Phusion Passenger’s administration tools to PATH</h4>
6193
6185
  <div class="paragraph"><p>If you get a "command not found" error when invoking one of the Phusion Passenger administration tools (e.g. <span class="monospaced">passenger-status</span> or <span class="monospaced">passenger-memory-stats</span> then that means the tools are not in <span class="monospaced">PATH</span>, so you need to add them.</p></div>
6194
- <div class="ulist"><ul>
6186
+ <div class="ulist"><ul>
6195
6187
  <li>
6196
6188
  <p>
6197
6189
  If you <a href="#rubygems_generic_install">installed Phusion Passenger with RubyGems</a>, then the tools are in your RubyGems executable path. You can view the gem path using the command <span class="monospaced">gem env</span>:
@@ -6249,12 +6241,12 @@ $ sudo find . -name passenger-status
6249
6241
  </li>
6250
6242
  </ul></div>
6251
6243
  <div class="admonitionblock">
6252
- <table><tr>
6244
+ <table><tr>
6253
6245
  <td class="icon">
6254
- <img src="./images/icons/note.png" alt="Note">
6246
+ <img src="./images/icons/note.png" alt="Note">
6255
6247
  </td>
6256
6248
  <td class="content">You may still get a "command not found" when invoking the tools through sudo, even after you’ve added the relevant directory to <span class="monospaced">PATH</span>. Please read <a href="#env_vars_and_sudo">Environment variables and sudo</a> to learn more.</td>
6257
- </tr></table>
6249
+ </tr></table>
6258
6250
  </div>
6259
6251
  </div>
6260
6252
  </div>
@@ -6276,23 +6268,23 @@ echo <span style="color: #FF0000">'export PATH=/usr/local/bin:$PATH'</span> <spa
6276
6268
  </div>
6277
6269
  <div class="paragraph"><p>To make them permanent for future bash sessions <strong>for all users</strong>, add them to <span class="monospaced">/etc/bashrc</span>.</p></div>
6278
6270
  <div class="admonitionblock">
6279
- <table><tr>
6271
+ <table><tr>
6280
6272
  <td class="icon">
6281
- <img src="./images/icons/note.png" alt="Note">
6273
+ <img src="./images/icons/note.png" alt="Note">
6282
6274
  </td>
6283
6275
  <td class="content">Depending on the system, the bashrc file may have a different filename. On Debian and Ubuntu, it’s <span class="monospaced">/etc/bash.bashrc</span>.</td>
6284
- </tr></table>
6276
+ </tr></table>
6285
6277
  </div>
6286
6278
  </div>
6287
6279
  <div class="sect3">
6288
6280
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_apache"></span><h4 data-comment-topic="apache-9hqtyj" data-anchor="_apache">13.3.2. Apache</h4>
6289
6281
  <div class="admonitionblock">
6290
- <table><tr>
6282
+ <table><tr>
6291
6283
  <td class="icon">
6292
- <img src="./images/icons/note.png" alt="Note">
6284
+ <img src="./images/icons/note.png" alt="Note">
6293
6285
  </td>
6294
6286
  <td class="content">This subsection describes how to set environment variables on Apache itself, not on apps served through Phusion Passenger for Apache. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <a href="#env_vars_passenger_apps">Setting environment variables on Phusion Passenger-served apps</a>.</td>
6295
- </tr></table>
6287
+ </tr></table>
6296
6288
  </div>
6297
6289
  <div class="paragraph"><p>On Debian and Ubuntu, with an Apache installed through apt, Apache environment variables are defined in the file <span class="monospaced">/etc/apache2/envvars</span>. This is a shell script so environment variables must be specified with the shell syntax.</p></div>
6298
6290
  <div class="paragraph"><p>On Red Hat, Fedora, CentOS and ScientificLinux, with an Apache installed through YUM, Apache environment variables are defined in <span class="monospaced">/etc/sysconfig/httpd</span>.</p></div>
@@ -6302,24 +6294,24 @@ echo <span style="color: #FF0000">'export PATH=/usr/local/bin:$PATH'</span> <spa
6302
6294
  <div class="sect3">
6303
6295
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_nginx"></span><h4 data-comment-topic="nginx-157dpwy" data-anchor="_nginx">13.3.3. Nginx</h4>
6304
6296
  <div class="admonitionblock">
6305
- <table><tr>
6297
+ <table><tr>
6306
6298
  <td class="icon">
6307
- <img src="./images/icons/note.png" alt="Note">
6299
+ <img src="./images/icons/note.png" alt="Note">
6308
6300
  </td>
6309
6301
  <td class="content">This subsection describes how to set environment variables on Nginx itself, not on apps served through Phusion Passenger for Nginx. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <a href="#env_vars_passenger_apps">Setting environment variables on Phusion Passenger-served apps</a>.</td>
6310
- </tr></table>
6302
+ </tr></table>
6311
6303
  </div>
6312
6304
  <div class="paragraph"><p>If you installed Nginx through <a href="#install_on_debian_ubuntu">the Brightbox packages</a>, then you can define environment variables in <span class="monospaced">/etc/default/nginx</span>. This is a shell script so you must use the <span class="monospaced">export FOO=bar</span> syntax.</p></div>
6313
6305
  <div class="paragraph"><p>Otherwise, environment variables are best set through the script which starts Nginx. For example, if you installed Nginx from source and you used
6314
6306
  &lt;&lt;nginx_init_script,the Nginx init script described earlier in this manual,
6315
6307
  then you should edit that script to define the environment variables. Those init scripts are regular shell scripts, so use the <span class="monospaced">export FOO=bar</span> syntax. Just make sure your set your environment variables before the script starts Nginx.</p></div>
6316
6308
  <div class="admonitionblock">
6317
- <table><tr>
6309
+ <table><tr>
6318
6310
  <td class="icon">
6319
- <img src="./images/icons/note.png" alt="Note">
6311
+ <img src="./images/icons/note.png" alt="Note">
6320
6312
  </td>
6321
6313
  <td class="content">Setting environment variables on Nginx has no effect on the <a href="#flying_passenger">Flying Passenger daemon</a> because the daemon is started seperately. You should set the environment variables in the shell right before starting the daemon.</td>
6322
- </tr></table>
6314
+ </tr></table>
6323
6315
  </div>
6324
6316
  </div>
6325
6317
  <div class="sect3">
@@ -6348,7 +6340,7 @@ PATH=/usr/bin:/usr/local/bin
6348
6340
  <div class="sect3">
6349
6341
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="env_vars_passenger_apps"></span><h4 data-comment-topic="phusion-passenger-served-apps-uiewl5" data-anchor="env_vars_passenger_apps">13.3.5. Phusion Passenger-served apps</h4>
6350
6342
  <div class="paragraph"><p>You can pass environment variables to Phusion Passenger-served apps through various methods:</p></div>
6351
- <div class="ulist"><ul>
6343
+ <div class="ulist"><ul>
6352
6344
  <li>
6353
6345
  <p>
6354
6346
  When running Apache, use the <span class="monospaced">PassEnv</span> and <span class="monospaced">SetEnv</span> directives of <a href="http://httpd.apache.org/docs/2.4/mod/mod_env.html">mod_env</a>. This is supported starting from Phusion Passenger 4.0.
@@ -7105,5 +7097,5 @@ Mizuho.topicListReceived = $.proxy(function(result) {
7105
7097
  $(document).ready(Mizuho.initializeCommenting);
7106
7098
 
7107
7099
  </script>
7108
- </body>
7100
+ </body>
7109
7101
  </html>