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
@@ -90,16 +90,17 @@ The location configuration file is an ini file that looks as follows:
90
90
 
91
91
  [locations]
92
92
  natively_packaged=true
93
- bin=/usr/bin
94
- agents=/usr/lib/phusion-passenger/agents
95
- libdir=/usr/lib/phusion-passenger
96
- helper_scripts=/usr/share/phusion-passenger/helper-scripts
97
- resources=/usr/share/phusion-passenger
98
- includedir=/usr/share/phusion-passenger/include
99
- doc=/usr/share/doc/phusion-passenger
100
- rubylibdir=/usr/lib/ruby/vendor_ruby
101
- apache2_module=/usr/lib/apache2/modules/mod_passenger.so
102
- ruby_extension_source=/usr/share/phusion-passenger/ruby_extension_source
93
+ bin_dir=/usr/bin
94
+ agents_dir=/usr/lib/phusion-passenger/agents
95
+ lib_dir=/usr/lib/phusion-passenger
96
+ helper_scripts_dir=/usr/share/phusion-passenger/helper-scripts
97
+ resources_dir=/usr/share/phusion-passenger
98
+ include_dir=/usr/share/phusion-passenger/include
99
+ doc_dir=/usr/share/doc/phusion-passenger
100
+ ruby_libdir=/usr/lib/ruby/vendor_ruby
101
+ apache2_module_path=/usr/lib/apache2/modules/mod_passenger.so
102
+ ruby_extension_source_dir=/usr/share/phusion-passenger/ruby_extension_source
103
+ nginx_module_source_dir=/usr/share/phusion-passenger/ngx_http_passenger_module
103
104
 
104
105
  All keys except fo `natively_packaged` specify the locations of assets and asset
105
106
  directories. The "Asset types" section provides a description of all asset types.
@@ -162,24 +163,24 @@ a list of all possible assets and asset directories.
162
163
  that contains the entire Phusion passenger source tree. Not available when
163
164
  natively packaged.
164
165
 
165
- * `bin`
166
+ * `bin_dir`
166
167
 
167
168
  A directory containing administration binaries and scripts and like
168
169
  `passenger-status`; tools that the user may directly invoke on the command line.
169
170
 
170
171
  Value when originally packaged: `<SOURCE_ROOT>/bin`
171
172
 
172
- * `agents`
173
+ * `agents_dir`
173
174
 
174
175
  A directory that contains (platform-dependent) binaries that Phusion Passenger
175
176
  uses, but that should not be directly invoked from the command line. Things like
176
177
  PassengerHelperAgent are located here.
177
178
 
178
179
  Value when originally packaged:
179
- - Normally: `<SOURCE_ROOT>/agents`
180
+ - Normally: `<SOURCE_ROOT>/buildout/agents`
180
181
  - Passenger Standalone: `~/.passenger/standalone/<VERSION>/support-<ARCH>`
181
182
 
182
- * `helper_scripts`
183
+ * `helper_scripts_dir`
183
184
 
184
185
  A directory that contains non-binary scripts that Phusion Passenger uses, but
185
186
  that should not be directly invoked from the command line. Things like
@@ -187,7 +188,7 @@ a list of all possible assets and asset directories.
187
188
 
188
189
  Value when originally packaged: `<SOURCE_ROOT>/helper-scripts`
189
190
 
190
- * `resources`
191
+ * `resources_dir`
191
192
 
192
193
  A directory that contains non-executable, platform-independent resource files
193
194
  that the user should not directly access, like error page templates and
@@ -195,27 +196,27 @@ a list of all possible assets and asset directories.
195
196
 
196
197
  Value when originally packaged: `<SOURCE_ROOT>/resources`.
197
198
 
198
- * `doc`
199
+ * `doc_dir`
199
200
 
200
201
  A directory that contains documentation.
201
202
 
202
203
  Value when originally packaged: `<SOURCE_ROOT>/doc`.
203
204
 
204
- * `includedir`
205
+ * `include_dir`
205
206
 
206
207
  A directory that contains the Phusion Passenger header files that are
207
208
  necessary for compiling Nginx.
208
209
 
209
210
  Value when originally packaged: `<SOURCE_ROOT>/ext`
210
211
 
211
- * `libdir`
212
+ * `lib_dir`
212
213
 
213
214
  A directory that contains the Phusion Passenger library files, e.g.
214
215
  libboost_oxt.a and various .o files.
215
216
 
216
- Value when originally packaged: `<SOURCE_ROOT>/libout`
217
+ Value when originally packaged: `<SOURCE_ROOT>/buildout`
217
218
 
218
- * `rubylibdir`
219
+ * `ruby_libdir`
219
220
 
220
221
  A directory that contains the Phusion Passenger Ruby library files. Note that
221
222
  the Phusion Passenger administration tools still locate phusion_passenger.rb
@@ -225,15 +226,15 @@ a list of all possible assets and asset directories.
225
226
 
226
227
  Value when originally packaged: `<SOURCE_ROOT>/lib`.
227
228
 
228
- * `apache2_module`
229
+ * `apache2_module_path`
229
230
 
230
231
  The filename of the Apache 2 module, or the filename that the Apache 2 module
231
232
  will be stored after it's compiled. Used by `passenger-install-module` to
232
233
  print an example configuration snippet.
233
234
 
234
- Value when originally packaged: `<SOURCE_ROOT>/ext/apache2/mod_passenger.so`.
235
+ Value when originally packaged: `<SOURCE_ROOT>/buildout/apache2/mod_passenger.so`.
235
236
 
236
- * `ruby_extension_source`
237
+ * `ruby_extension_source_dir`
237
238
 
238
239
  The directory that contains the source code for the Phusion Passenger Ruby
239
240
  extension. Phusion Passenger uses these sources to build a Ruby extension,
@@ -242,6 +243,14 @@ a list of all possible assets and asset directories.
242
243
 
243
244
  Value when originally packaged: `<SOURCE_ROOT>/ext/ruby`.
244
245
 
246
+ * `nginx_module_source_dir`
247
+
248
+ The directory that contains the source code for the Phusion Passenger Nginx
249
+ module. passenger-install-nginx-module uses these sources to build Nginx
250
+ with Phusion Passenger support.
251
+
252
+ Value when originally packaged: `<SOURCE_ROOT>/ext/nginx`.
253
+
245
254
 
246
255
  # Vendoring of libraries
247
256
 
@@ -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>Security of user switching support in Passenger</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>Security of user switching support in Passenger</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())">Security of user switching support in Passenger</a>
1064
1062
  </div>
1065
1063
  <a href="javascript:void(0)" id="current_section"></a>
@@ -1085,13 +1083,13 @@ pre {
1085
1083
  <span class="anchor_helper" id="_problem_description"></span><h2 data-anchor="_problem_description">1. Problem description</h2>
1086
1084
  <div class="sectionbody">
1087
1085
  <div class="admonitionblock">
1088
- <table><tr>
1086
+ <table><tr>
1089
1087
  <td class="icon">
1090
- <img src="./images/icons/tip.png" alt="Tip">
1088
+ <img src="./images/icons/tip.png" alt="Tip">
1091
1089
  </td>
1092
1090
  <td class="content">It is strongly recommended that you first read our
1093
1091
  <a href="Architectural%20overview.html">Architectural Overview</a>.</td>
1094
- </tr></table>
1092
+ </tr></table>
1095
1093
  </div>
1096
1094
  <div class="paragraph"><p>A straightforward implementation of Passenger will spawn Rails applications in
1097
1095
  the same user context as Apache itself. On server machines which host multiple
@@ -1111,7 +1109,7 @@ Passenger’s security may be peer reviewed.</p></div>
1111
1109
  <div class="paragraph"><p>It seems that the only way to solve this problem on Unix, is to run each Rails
1112
1110
  application server as its owner’s user and group. Passenger can make use of
1113
1111
  one of the following methods to implement this:</p></div>
1114
- <div class="olist arabic"><ol class="arabic">
1112
+ <div class="olist arabic"><ol class="arabic">
1115
1113
  <li>
1116
1114
  <p>
1117
1115
  Apache (and thus Passenger) must already be running as root.
@@ -1194,7 +1192,7 @@ a password file, which only Apache and the wrapper can read, through
1194
1192
  the use of proper file permissions. The password file must never be world
1195
1193
  readable or writable.</p></div>
1196
1194
  <div class="paragraph"><p>It works as follows:</p></div>
1197
- <div class="olist arabic"><ol class="arabic">
1195
+ <div class="olist arabic"><ol class="arabic">
1198
1196
  <li>
1199
1197
  <p>
1200
1198
  Passenger runs the wrapper.
@@ -1271,7 +1269,7 @@ or (on Linux) by reading the file <span class="monospaced">/proc/$PID/cmdline</s
1271
1269
  <span class="anchor_helper" id="_common_security_issues"></span><h3 data-anchor="_common_security_issues">2.7. Common security issues</h3>
1272
1270
  <div class="paragraph"><p>Whatever method Passenger will use, the following security principles must be
1273
1271
  honored:</p></div>
1274
- <div class="ulist"><ul>
1272
+ <div class="ulist"><ul>
1275
1273
  <li>
1276
1274
  <p>
1277
1275
  Rails applications must never be run as root.
@@ -1280,7 +1278,7 @@ Rails applications must never be run as root.
1280
1278
  </ul></div>
1281
1279
  <div class="paragraph"><p>It might also be worthy to look into suEXEC’s security model for inspiration.</p></div>
1282
1280
  <div class="paragraph"><p>Also, the following questions remain:</p></div>
1283
- <div class="ulist"><ul>
1281
+ <div class="ulist"><ul>
1284
1282
  <li>
1285
1283
  <p>
1286
1284
  Is there a need for a user whitelist/blacklist? That is, is there a need for
@@ -1829,5 +1827,5 @@ Mizuho.initializeTopBar = $.proxy(function() {
1829
1827
  $(document).ready(Mizuho.initializeTopBar);
1830
1828
 
1831
1829
  </script>
1832
- </body>
1830
+ </body>
1833
1831
  </html>
@@ -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, Apache 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, Apache 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, Apache 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 Apache. 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 Phusion Passenger.
@@ -1314,7 +1311,7 @@ if it doesn’t work on your POSIX-compliant operating system.</p></div>
1314
1311
  </div>
1315
1312
  <div class="sect2">
1316
1313
  <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-f3pbrb" data-anchor="_where_to_get_support">1.2. Where to get support</h3>
1317
- <div class="ulist"><ul>
1314
+ <div class="ulist"><ul>
1318
1315
  <li>
1319
1316
  <p>
1320
1317
  <a href="http://groups.google.com/group/phusion-passenger">Discussion forum</a> - post a
@@ -1353,7 +1350,7 @@ Report security vulnerabilities to <a href="mailto:security@phusion.nl">security
1353
1350
  <div class="sect2">
1354
1351
  <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-l0om5d" data-anchor="_synopsis">2.1. Synopsis</h3>
1355
1352
  <div class="paragraph"><p>The Phusion Passenger installation process consists of two steps:</p></div>
1356
- <div class="olist arabic"><ol class="arabic">
1353
+ <div class="olist arabic"><ol class="arabic">
1357
1354
  <li>
1358
1355
  <p>
1359
1356
  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.
@@ -1381,7 +1378,7 @@ The <strong>integration step</strong>, where you configure Phusion Passenger so
1381
1378
  </div>
1382
1379
  </div>
1383
1380
  <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>
1384
- <div class="ulist"><ul>
1381
+ <div class="ulist"><ul>
1385
1382
  <li>
1386
1383
  <p>
1387
1384
  Are you using RVM? Run <span class="monospaced">rvmsudo -s</span>
@@ -1439,8 +1436,8 @@ Is <em>sudo</em> not installed on your system? Run <span class="monospaced">su -
1439
1436
  </div>
1440
1437
  </div>
1441
1438
  <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>
1442
- <div class="paragraph"><p>If you all of the following are applicable to you:</p></div>
1443
- <div class="ulist"><ul>
1439
+ <div class="paragraph"><p>If all of the following are applicable to you:</p></div>
1440
+ <div class="ulist"><ul>
1444
1441
  <li>
1445
1442
  <p>
1446
1443
  You are on Debian or Ubuntu,
@@ -1711,7 +1708,7 @@ sudo apt-get update</pre>
1711
1708
  <div class="paragraph"><p>You’ll then need to enable the Phusion Passenger module in Nginx by creating the following configuration file:</p></div>
1712
1709
  <div class="listingblock">
1713
1710
  <div class="content monospaced">
1714
- <pre>sudo sh -c 'echo "passenger_root /usr/lib/phusion-passenger;" &gt; /etc/nginx/conf.d/passenger.conf'</pre>
1711
+ <pre>sudo sh -c 'echo "passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;" &gt; /etc/nginx/conf.d/passenger.conf'</pre>
1715
1712
  </div>
1716
1713
  </div>
1717
1714
  <div class="paragraph"><p>Then restart Nginx to apply the changes:</p></div>
@@ -1800,7 +1797,7 @@ sudo apt-get update</pre>
1800
1797
  <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-b17h8g" data-anchor="_upgrading_from_open_source_to_enterprise">2.6. Upgrading from open source to Enterprise</h3>
1801
1798
  <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>
1802
1799
  <div class="paragraph"><p>Customers who have bought Phusion Passenger Enterprise can upgrade their open source installation to Enterprise as follows:</p></div>
1803
- <div class="olist arabic"><ol class="arabic">
1800
+ <div class="olist arabic"><ol class="arabic">
1804
1801
  <li>
1805
1802
  <p>
1806
1803
  <a href="#uninstalling">Uninstall the open source Phusion Passenger</a>.
@@ -1938,18 +1935,18 @@ http://www.gnu.org/software/src-highlite -->
1938
1935
  </div>
1939
1936
  </div>
1940
1937
  <div class="admonitionblock">
1941
- <table><tr>
1938
+ <table><tr>
1942
1939
  <td class="icon">
1943
- <img src="./images/icons/note.png" alt="Note">
1940
+ <img src="./images/icons/note.png" alt="Note">
1944
1941
  </td>
1945
1942
  <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>
1946
- </tr></table>
1943
+ </tr></table>
1947
1944
  </div>
1948
1945
  </div>
1949
1946
  <div class="sect3">
1950
1947
  <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-wzu0ey" data-anchor="_adding_additional_compiler_or_linker_flags">2.9.2. Adding additional compiler or linker flags</h4>
1951
1948
  <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>
1952
- <div class="dlist"><dl>
1949
+ <div class="dlist"><dl>
1953
1950
  <dt class="hdlist1">
1954
1951
  <span class="monospaced">EXTRA_PRE_CFLAGS</span>
1955
1952
  </dt>
@@ -2000,19 +1997,19 @@ http://www.gnu.org/software/src-highlite -->
2000
1997
  </dd>
2001
1998
  </dl></div>
2002
1999
  <div class="admonitionblock">
2003
- <table><tr>
2000
+ <table><tr>
2004
2001
  <td class="icon">
2005
- <img src="./images/icons/note.png" alt="Note">
2002
+ <img src="./images/icons/note.png" alt="Note">
2006
2003
  </td>
2007
2004
  <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>
2008
- </tr></table>
2005
+ </tr></table>
2009
2006
  </div>
2010
2007
  </div>
2011
2008
  <div class="sect3">
2012
2009
  <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-1hym30u" data-anchor="_forcing_location_of_command_line_tools_and_dependencies">2.9.3. Forcing location of command line tools and dependencies</h4>
2013
2010
  <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>
2014
2011
  <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>
2015
- <div class="dlist"><dl>
2012
+ <div class="dlist"><dl>
2016
2013
  <dt class="hdlist1">
2017
2014
  <span class="monospaced">HTTPD</span>
2018
2015
  </dt>
@@ -2073,12 +2070,13 @@ http://www.gnu.org/software/src-highlite -->
2073
2070
  </dd>
2074
2071
  </dl></div>
2075
2072
  <div class="admonitionblock">
2076
- <table><tr>
2073
+ <table><tr>
2077
2074
  <td class="icon">
2078
- <img src="./images/icons/note.png" alt="Note">
2075
+ <img src="./images/icons/tip.png" alt="Tip">
2079
2076
  </td>
2080
- <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>
2081
- </tr></table>
2077
+ <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>.
2078
+ 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>
2079
+ </tr></table>
2082
2080
  </div>
2083
2081
  </div>
2084
2082
  </div>
@@ -2087,7 +2085,7 @@ http://www.gnu.org/software/src-highlite -->
2087
2085
  <div class="paragraph"><p>On most systems the Apache configuration file is located in either <em>/etc/apache2/httpd.conf</em> or <em>/etc/apache2/apache2.conf</em>. However, to allow better organization, many operating systems and Apache distributions also read configuration files in the <em>conf.d</em>, <em>mods-enabled</em> and <em>sites-enabled</em> subdirectories.</p></div>
2088
2086
  <div class="paragraph"><p><em>mods-enabled</em> contains symlinks to files in <em>mods-available</em>. This latter subdirectory contains config files for all available modules, while <em>mods-enabled</em> contains only a subset, namely the modules that should actually be enabled. The symlinks are created using the <span class="monospaced">a2enmod</span> tool. <em><strong>.load</strong></em> files contain <span class="monospaced">LoadModule</span> directives, while <em>.conf</em> files contain all other configuration directives.</p></div>
2089
2087
  <div class="paragraph"><p>Use <em>mods-enabled</em>/<em>mods-available</em> to store Phusion Passenger configuration if you can:</p></div>
2090
- <div class="ulist"><ul>
2088
+ <div class="ulist"><ul>
2091
2089
  <li>
2092
2090
  <p>
2093
2091
  Create <em>/etc/apache2/mods-available/passenger.load</em> and paste the <span class="monospaced">LoadModule ...</span> directive that <span class="monospaced">passenger-install-apache2-module</span> outputs.
@@ -2119,7 +2117,7 @@ Phusion Passenger will not occupy any memory or CPU or otherwise interfere with
2119
2117
  the web server.</p></div>
2120
2118
  <div class="paragraph"><p>To unload Phusion Passenger from the web server, edit your Apache configuration file(s)
2121
2119
  and comment out:</p></div>
2122
- <div class="ulist"><ul>
2120
+ <div class="ulist"><ul>
2123
2121
  <li>
2124
2122
  <p>
2125
2123
  all Phusion Passenger configuration directives.
@@ -2178,7 +2176,7 @@ NameVirtualHosts *:80
2178
2176
  <div class="paragraph"><p>To uninstall Phusion Passenger, please first remove all Phusion Passenger
2179
2177
  configuration directives from your web server configuration file(s). After you’ve
2180
2178
  done this, you need to remove the Phusion Passenger files.</p></div>
2181
- <div class="ulist"><ul>
2179
+ <div class="ulist"><ul>
2182
2180
  <li>
2183
2181
  <p>
2184
2182
  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>).
@@ -2228,20 +2226,20 @@ virtual host’s root (i.e. the application will be accessible from the root URL
2228
2226
  <em>http://www.mycook.com/</em>), or in a sub URI (i.e. the application will be
2229
2227
  accessible from a sub URL, such as <em>http://www.mycook.com/railsapplication</em>).</p></div>
2230
2228
  <div class="admonitionblock">
2231
- <table><tr>
2229
+ <table><tr>
2232
2230
  <td class="icon">
2233
- <img src="./images/icons/note.png" alt="Note">
2231
+ <img src="./images/icons/note.png" alt="Note">
2234
2232
  </td>
2235
2233
  <td class="content">The default <span class="monospaced">RAILS_ENV</span> environment in which deployed Rails applications
2236
2234
  are run, is “production”. You can change this by changing the
2237
2235
  <a href="#rails_env"><em>RailsEnv</em></a> configuration option.</td>
2238
- </tr></table>
2236
+ </tr></table>
2239
2237
  </div>
2240
2238
  <div class="sect2">
2241
2239
  <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-ab4zj6" data-anchor="_deploying_to_a_virtual_host_8217_s_root">3.1. Deploying to a virtual host’s root</h3>
2242
2240
  <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
2243
2241
  following conditions are met:</p></div>
2244
- <div class="ulist"><ul>
2242
+ <div class="ulist"><ul>
2245
2243
  <li>
2246
2244
  <p>
2247
2245
  The virtual host’s document root must point to your Ruby on Rails application’s
@@ -2274,7 +2272,7 @@ MultiViews must be disabled for this folder.
2274
2272
  </div>
2275
2273
  <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
2276
2274
  following folders are readable and executable by Apache:</p></div>
2277
- <div class="ulist"><ul>
2275
+ <div class="ulist"><ul>
2278
2276
  <li>
2279
2277
  <p>
2280
2278
  this <em>public</em> folder.
@@ -2318,7 +2316,7 @@ point to your Ruby on Rails application’s <em>public</em> folder. For example:
2318
2316
  </div>
2319
2317
  <div class="paragraph"><p>Next, add a <a href="#RailsBaseURI">RailsBaseURI</a> option to the virtual host configuration,
2320
2318
  and also make sure that:</p></div>
2321
- <div class="ulist"><ul>
2319
+ <div class="ulist"><ul>
2322
2320
  <li>
2323
2321
  <p>
2324
2322
  The Apache per-directory permissions allow access to this folder.
@@ -2349,21 +2347,21 @@ MultiViews is disabled for this folder.
2349
2347
  </div>
2350
2348
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
2351
2349
  <div class="admonitionblock">
2352
- <table><tr>
2350
+ <table><tr>
2353
2351
  <td class="icon">
2354
- <img src="./images/icons/note.png" alt="Note">
2352
+ <img src="./images/icons/note.png" alt="Note">
2355
2353
  </td>
2356
2354
  <td class="content">If you’re deploying to a sub-URI then please make sure that your view
2357
2355
  templates correctly handles references to sub-URI static assets! Otherwise
2358
2356
  you may find broken links to images, CSS files, JavaScripts, etc. Please read
2359
2357
  <a href="#sub_uri_deployment_uri_fix">How to fix broken images/CSS/JavaScript URIs in sub-URI deployments</a>
2360
2358
  for more information.</td>
2361
- </tr></table>
2359
+ </tr></table>
2362
2360
  </div>
2363
2361
  <div class="admonitionblock">
2364
- <table><tr>
2362
+ <table><tr>
2365
2363
  <td class="icon">
2366
- <img src="./images/icons/tip.png" alt="Tip">
2364
+ <img src="./images/icons/tip.png" alt="Tip">
2367
2365
  </td>
2368
2366
  <td class="content">
2369
2367
  <div class="paragraph"><p>You can deploy multiple Rails applications under a virtual host, by specifying
@@ -2379,7 +2377,7 @@ for more information.</td>
2379
2377
  </div>
2380
2378
  </div>
2381
2379
  </td>
2382
- </tr></table>
2380
+ </tr></table>
2383
2381
  </div>
2384
2382
  </div>
2385
2383
  <div class="sect2">
@@ -2387,7 +2385,7 @@ for more information.</td>
2387
2385
  <div class="paragraph"><p>Deploying a new version of a Ruby on Rails application is as simple as
2388
2386
  re-uploading the application files, and restarting the application.</p></div>
2389
2387
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2390
- <div class="olist arabic"><ol class="arabic">
2388
+ <div class="olist arabic"><ol class="arabic">
2391
2389
  <li>
2392
2390
  <p>
2393
2391
  By restarting Apache.
@@ -2434,7 +2432,7 @@ a shell console, just like one would normally run migrations.</p></div>
2434
2432
  <div class="paragraph"><p>Phusion Passenger assumes that Rack application directories have a certain layout.
2435
2433
  Suppose that you have a Rack application in <em>/webapps/rackapp</em>. Then that
2436
2434
  folder must contain at least three entries:</p></div>
2437
- <div class="ulist"><ul>
2435
+ <div class="ulist"><ul>
2438
2436
  <li>
2439
2437
  <p>
2440
2438
  <em>config.ru</em>, a Rackup file for starting the Rack application. This file must contain
@@ -2470,14 +2468,14 @@ to the virtual host’s root (i.e. the application will be accessible from the r
2470
2468
  <em>http://www.rackapp.com/</em>), or in a sub URI (i.e. the application will be
2471
2469
  accessible from a sub URL, such as <em>http://www.rackapp.com/rackapp</em>).</p></div>
2472
2470
  <div class="admonitionblock">
2473
- <table><tr>
2471
+ <table><tr>
2474
2472
  <td class="icon">
2475
- <img src="./images/icons/note.png" alt="Note">
2473
+ <img src="./images/icons/note.png" alt="Note">
2476
2474
  </td>
2477
2475
  <td class="content">The default <span class="monospaced">RACK_ENV</span> environment in which deployed Rack applications
2478
2476
  are run, is “production”. You can change this by changing the
2479
2477
  <a href="#rack_env"><em>RackEnv</em></a> configuration option.</td>
2480
- </tr></table>
2478
+ </tr></table>
2481
2479
  </div>
2482
2480
  <div class="sect2">
2483
2481
  <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-axp5z5" 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>
@@ -2523,7 +2521,7 @@ under the URL <em>http://www.rackexample.com/</em>.</p></div>
2523
2521
  <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_2"></span><h3 data-comment-topic="deploying-to-a-virtual-host-s-root-u9bfax" data-anchor="_deploying_to_a_virtual_host_8217_s_root_2">4.2. Deploying to a virtual host’s root</h3>
2524
2522
  <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
2525
2523
  following conditions are met:</p></div>
2526
- <div class="ulist"><ul>
2524
+ <div class="ulist"><ul>
2527
2525
  <li>
2528
2526
  <p>
2529
2527
  The virtual host’s document root must point to your Rack application’s
@@ -2556,7 +2554,7 @@ MultiViews must be disabled for this folder.
2556
2554
  </div>
2557
2555
  <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
2558
2556
  following folders are readable and executable by Apache:</p></div>
2559
- <div class="ulist"><ul>
2557
+ <div class="ulist"><ul>
2560
2558
  <li>
2561
2559
  <p>
2562
2560
  this <em>public</em> folder.
@@ -2600,7 +2598,7 @@ point to your Rack application’s <em>public</em> folder. For example:</p></div
2600
2598
  </div>
2601
2599
  <div class="paragraph"><p>Next, add a <a href="#RackBaseURI">RackBaseURI</a> option to the virtual host configuration,
2602
2600
  and also make sure that:</p></div>
2603
- <div class="ulist"><ul>
2601
+ <div class="ulist"><ul>
2604
2602
  <li>
2605
2603
  <p>
2606
2604
  The Apache per-directory permissions allow access to this folder.
@@ -2631,9 +2629,9 @@ MultiViews is disabled for this folder.
2631
2629
  </div>
2632
2630
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
2633
2631
  <div class="admonitionblock">
2634
- <table><tr>
2632
+ <table><tr>
2635
2633
  <td class="icon">
2636
- <img src="./images/icons/tip.png" alt="Tip">
2634
+ <img src="./images/icons/tip.png" alt="Tip">
2637
2635
  </td>
2638
2636
  <td class="content">
2639
2637
  <div class="paragraph"><p>You can deploy multiple Rack applications under a virtual host, by specifying
@@ -2649,7 +2647,7 @@ MultiViews is disabled for this folder.
2649
2647
  </div>
2650
2648
  </div>
2651
2649
  </td>
2652
- </tr></table>
2650
+ </tr></table>
2653
2651
  </div>
2654
2652
  </div>
2655
2653
  <div class="sect2">
@@ -2657,7 +2655,7 @@ MultiViews is disabled for this folder.
2657
2655
  <div class="paragraph"><p>Deploying a new version of a Rack application is as simple as
2658
2656
  re-uploading the application files, and restarting the application.</p></div>
2659
2657
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2660
- <div class="olist arabic"><ol class="arabic">
2658
+ <div class="olist arabic"><ol class="arabic">
2661
2659
  <li>
2662
2660
  <p>
2663
2661
  By restarting Apache.
@@ -2780,7 +2778,7 @@ run Sinatra::Application</pre>
2780
2778
  <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-7aygdl" data-anchor="_deploying_a_wsgi_python_application">5. Deploying a WSGI (Python) application</h2>
2781
2779
  <div class="sectionbody">
2782
2780
  <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>
2783
- <div class="ulist"><ul>
2781
+ <div class="ulist"><ul>
2784
2782
  <li>
2785
2783
  <p>
2786
2784
  <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>.
@@ -2852,7 +2850,7 @@ under the URL <em>http://www.wsgiexample.com/</em>.</p></div>
2852
2850
  <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_3"></span><h3 data-comment-topic="deploying-to-a-virtual-host-s-root-zzo4v7" data-anchor="_deploying_to_a_virtual_host_8217_s_root_3">5.2. Deploying to a virtual host’s root</h3>
2853
2851
  <div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
2854
2852
  following conditions are met:</p></div>
2855
- <div class="ulist"><ul>
2853
+ <div class="ulist"><ul>
2856
2854
  <li>
2857
2855
  <p>
2858
2856
  The virtual host’s document root must point to your WSGI application’s
@@ -2885,7 +2883,7 @@ MultiViews must be disabled for this folder.
2885
2883
  </div>
2886
2884
  <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
2887
2885
  following folders are readable and executable by Apache:</p></div>
2888
- <div class="ulist"><ul>
2886
+ <div class="ulist"><ul>
2889
2887
  <li>
2890
2888
  <p>
2891
2889
  this <em>public</em> folder.
@@ -2909,7 +2907,7 @@ all parent folders. That is, /webapps/wsgiapp and /webapps must also be readable
2909
2907
  <div class="paragraph"><p>Deploying a new version of a WSGI application is as simple as
2910
2908
  re-uploading the application files, and restarting the application.</p></div>
2911
2909
  <div class="paragraph"><p>There are two ways to restart the application:</p></div>
2912
- <div class="olist arabic"><ol class="arabic">
2910
+ <div class="olist arabic"><ol class="arabic">
2913
2911
  <li>
2914
2912
  <p>
2915
2913
  By restarting Apache.
@@ -2960,7 +2958,7 @@ this option as well. Please read
2960
2958
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="PassengerRuby"></span><h3 data-comment-topic="passengerruby-filename--1r3fv73" data-anchor="PassengerRuby">6.3. PassengerRuby &lt;filename&gt;</h3>
2961
2959
  <div class="paragraph"><p>The <span class="monospaced">PassengerDefaultRuby</span> and <span class="monospaced">PassengerRuby</span> directives specify the Ruby interpreter to use. Similarly, the <span class="monospaced">PassengerPython</span> directive is for specifying the Python interpreter.</p></div>
2962
2960
  <div class="paragraph"><p>The relationship between <span class="monospaced">PassengerDefaultRuby</span> and <span class="monospaced">PassengerRuby</span> is as follows:</p></div>
2963
- <div class="ulist"><ul>
2961
+ <div class="ulist"><ul>
2964
2962
  <li>
2965
2963
  <p>
2966
2964
  <span class="monospaced">PassengerDefaultRuby</span> may only occur in the global server configuration.
@@ -3087,7 +3085,7 @@ is the parent directory of the <em>public</em> directory. This option allows one
3087
3085
  specify the application’s root independently from the DocumentRoot, which
3088
3086
  is useful if the <em>public</em> directory lives in a non-standard place.</p></div>
3089
3087
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3090
- <div class="ulist"><ul>
3088
+ <div class="ulist"><ul>
3091
3089
  <li>
3092
3090
  <p>
3093
3091
  In the global server configuration.
@@ -3125,9 +3123,9 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3125
3123
  <div class="sect2">
3126
3124
  <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="passengerspawnmethod-string--sodg2y" data-anchor="PassengerSpawnMethod">6.6. PassengerSpawnMethod &lt;string&gt;</h3>
3127
3125
  <div class="admonitionblock">
3128
- <table><tr>
3126
+ <table><tr>
3129
3127
  <td class="icon">
3130
- <img src="./images/icons/tip.png" alt="Tip">
3128
+ <img src="./images/icons/tip.png" alt="Tip">
3131
3129
  </td>
3132
3130
  <td class="content">
3133
3131
  <div class="title">"What spawn method should I use?"</div>
@@ -3142,12 +3140,12 @@ understand it, as it’s mostly a technical detail. You can basically follow thi
3142
3140
  <div class="paragraph"><p>However, we do recommend you to try to understand it. The <em>smart</em> and <em>smart-lv2</em> spawn
3143
3141
  methods bring many benefits.</p></div>
3144
3142
  </td>
3145
- </tr></table>
3143
+ </tr></table>
3146
3144
  </div>
3147
3145
  <div class="paragraph"><p>Internally, Phusion Passenger spawns multiple Ruby application processes in order to handle
3148
3146
  requests. But there are multiple ways with which processes can be spawned, each having
3149
3147
  its own set of pros and cons. Supported spawn methods are:</p></div>
3150
- <div class="dlist"><dl>
3148
+ <div class="dlist"><dl>
3151
3149
  <dt class="hdlist1">
3152
3150
  <em>smart</em>
3153
3151
  </dt>
@@ -3191,7 +3189,7 @@ to <em>smart</em>. The old <em>smart</em> spawning has been removed in favor of
3191
3189
  </div>
3192
3190
  </div>
3193
3191
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3194
- <div class="ulist"><ul>
3192
+ <div class="ulist"><ul>
3195
3193
  <li>
3196
3194
  <p>
3197
3195
  In the global server configuration.
@@ -3228,7 +3226,7 @@ follows:</p></div>
3228
3226
  </div>
3229
3227
  <div class="paragraph"><p>This way, Phusion Passenger will not interfere with Wordpress.</p></div>
3230
3228
  <div class="paragraph"><p><em>PassengerEnabled</em> may occur in the following places:</p></div>
3231
- <div class="ulist"><ul>
3229
+ <div class="ulist"><ul>
3232
3230
  <li>
3233
3231
  <p>
3234
3232
  In the global server configuration.
@@ -3300,7 +3298,7 @@ Apache worker processes as different users. So if you’re using apace2-mpm-itk,
3300
3298
  you should set this option to a directory that is writable by all Apache worker
3301
3299
  processes, such as <em>/tmp</em>.</p></div>
3302
3300
  <div class="paragraph"><p>You may specify <em>PassengerUploadBufferDir</em> in the following places:</p></div>
3303
- <div class="ulist"><ul>
3301
+ <div class="ulist"><ul>
3304
3302
  <li>
3305
3303
  <p>
3306
3304
  In the global server configuration.
@@ -3333,7 +3331,7 @@ may be desirable for Phusion Passenger to look in a different directory instead,
3333
3331
  for example for security reasons (see below). This option allows you to
3334
3332
  customize the directory in which <em>restart.txt</em> is searched for.</p></div>
3335
3333
  <div class="paragraph"><p>You may specify <em>PassengerRestartDir</em> in the following places:</p></div>
3336
- <div class="ulist"><ul>
3334
+ <div class="ulist"><ul>
3337
3335
  <li>
3338
3336
  <p>
3339
3337
  In the global server configuration.
@@ -3403,7 +3401,7 @@ directory that’s readable by Apache, but only writable by administrators.</p><
3403
3401
  <div class="paragraph"><p>When turned on, application-generated responses are buffered by Apache. Buffering will
3404
3402
  happen in memory.</p></div>
3405
3403
  <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 Apache, there are in fact two response buffering systems active:</p></div>
3406
- <div class="olist arabic"><ol class="arabic">
3404
+ <div class="olist arabic"><ol class="arabic">
3407
3405
  <li>
3408
3406
  <p>
3409
3407
  The Apache response buffering system. <span class="monospaced">PassengerBufferResponse</span> turns this on or off.
@@ -3464,7 +3462,7 @@ after which it receives the entire response at once.
3464
3462
  When <span class="monospaced">PassengerBufferResponse</span> is turned off, it works as expected: the client
3465
3463
  receives an "entry X" message every second for 10 seconds.</p></div>
3466
3464
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3467
- <div class="ulist"><ul>
3465
+ <div class="ulist"><ul>
3468
3466
  <li>
3469
3467
  <p>
3470
3468
  In the global server configuration.
@@ -3488,15 +3486,15 @@ In <em>.htaccess</em>.
3488
3486
  </ul></div>
3489
3487
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>off</em>.</p></div>
3490
3488
  <div class="admonitionblock">
3491
- <table><tr>
3489
+ <table><tr>
3492
3490
  <td class="icon">
3493
- <img src="./images/icons/note.png" alt="Note">
3491
+ <img src="./images/icons/note.png" alt="Note">
3494
3492
  </td>
3495
3493
  <td class="content">
3496
3494
  <div class="paragraph"><p>The <a href="#PassengerBufferResponse">PassengerBufferResponse</a> directive should be turned off
3497
3495
  if responses can be huge. Because entire responses are buffered in memory when turned on.</p></div>
3498
3496
  </td>
3499
- </tr></table>
3497
+ </tr></table>
3500
3498
  </div>
3501
3499
  </div>
3502
3500
  <div class="sect2">
@@ -3509,7 +3507,7 @@ of a new application process could take a while, and any requests that
3509
3507
  come in during this time will be blocked until this first application
3510
3508
  process has spawned.</p></div>
3511
3509
  <div class="paragraph"><p>But when rolling restarts are enabled, Phusion Passenger Enterprise will:</p></div>
3512
- <div class="olist arabic"><ol class="arabic">
3510
+ <div class="olist arabic"><ol class="arabic">
3513
3511
  <li>
3514
3512
  <p>
3515
3513
  Spawn a new process in the background.
@@ -3528,7 +3526,7 @@ Step 1 and 2 are repeated until all processes have been replaced.
3528
3526
  </ol></div>
3529
3527
  <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>
3530
3528
  <div class="paragraph"><p>Rolling restarts have a few caveat however that you should be aware of:</p></div>
3531
- <div class="ulist"><ul>
3529
+ <div class="ulist"><ul>
3532
3530
  <li>
3533
3531
  <p>
3534
3532
  Upgrading an application sometimes involves upgrading the database schema.
@@ -3548,7 +3546,7 @@ Because there’s no telling which process will serve a request, users may
3548
3546
  </li>
3549
3547
  </ul></div>
3550
3548
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3551
- <div class="ulist"><ul>
3549
+ <div class="ulist"><ul>
3552
3550
  <li>
3553
3551
  <p>
3554
3552
  In the global server configuration.
@@ -3578,7 +3576,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
3578
3576
  <div class="paragraph"><p>Enables or disables resistance against deployment errors.</p></div>
3579
3577
  <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>
3580
3578
  <div class="paragraph"><p>By enabling deployment error resistance, Phusion Passenger Enterprise would instead do this:</p></div>
3581
- <div class="ulist"><ul>
3579
+ <div class="ulist"><ul>
3582
3580
  <li>
3583
3581
  <p>
3584
3582
  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.
@@ -3598,7 +3596,7 @@ It sets an internal flag so that no processes for this application will be spawn
3598
3596
  <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>
3599
3597
  <div class="paragraph"><p>Enabling deployment error resistance only works if <a href="#PassengerRollingRestarts">rolling restart</a> is also enabled.</p></div>
3600
3598
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3601
- <div class="ulist"><ul>
3599
+ <div class="ulist"><ul>
3602
3600
  <li>
3603
3601
  <p>
3604
3602
  In the global server configuration.
@@ -3638,7 +3636,7 @@ by default run the web application as the owner of the file <em>config/environme
3638
3636
  that behavior and explicitly set a user to run the web application as, regardless
3639
3637
  of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</p></div>
3640
3638
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3641
- <div class="ulist"><ul>
3639
+ <div class="ulist"><ul>
3642
3640
  <li>
3643
3641
  <p>
3644
3642
  In the global server configuration.
@@ -3667,7 +3665,7 @@ as, regardless of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</
3667
3665
  <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
3668
3666
  the web application’s group will be set to <em>environment.rb</em>/<em>config.ru</em>'s group.</p></div>
3669
3667
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3670
- <div class="ulist"><ul>
3668
+ <div class="ulist"><ul>
3671
3669
  <li>
3672
3670
  <p>
3673
3671
  In the global server configuration.
@@ -3713,7 +3711,7 @@ but the page might reveal potentially sensitive information, depending on the
3713
3711
  application. Experienced system administrators who are using Phusion Passenger
3714
3712
  on serious production servers should consider turning this feature off.</p></div>
3715
3713
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3716
- <div class="ulist"><ul>
3714
+ <div class="ulist"><ul>
3717
3715
  <li>
3718
3716
  <p>
3719
3717
  In the global server configuration.
@@ -3758,7 +3756,7 @@ non-zero value if you want to avoid potentially long startup times after a websi
3758
3756
  has been <a href="#idle_process">idle</a> for an extended period.</p></div>
3759
3757
  <div class="paragraph"><p>Please note that this option does <strong>not</strong> pre-start application processes during Apache
3760
3758
  startup. It just makes sure that when the application is first accessed:</p></div>
3761
- <div class="olist arabic"><ol class="arabic">
3759
+ <div class="olist arabic"><ol class="arabic">
3762
3760
  <li>
3763
3761
  <p>
3764
3762
  at least the given number of processes will be spawned.
@@ -3797,7 +3795,7 @@ simultanously. Phusion Passenger will start 12 more application processes. After
3797
3795
  timeout of 10 seconds have passed, Phusion Passenger will clean up 12 application
3798
3796
  processes, keeping 3 processes around.</p></div>
3799
3797
  <div class="paragraph"><p>The PassengerMinInstances option may occur in the following places:</p></div>
3800
- <div class="ulist"><ul>
3798
+ <div class="ulist"><ul>
3801
3799
  <li>
3802
3800
  <p>
3803
3801
  In the global server configuration.
@@ -3832,7 +3830,7 @@ means that there is no limit placed on the number of processes a single applicat
3832
3830
  may spawn, i.e. only the global limit of <a href="#PassengerMaxPoolSize">PassengerMaxPoolSize</a>
3833
3831
  will be enforced.</p></div>
3834
3832
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3835
- <div class="ulist"><ul>
3833
+ <div class="ulist"><ul>
3836
3834
  <li>
3837
3835
  <p>
3838
3836
  In the global server configuration.
@@ -3846,9 +3844,9 @@ In a virtual host configuration block.
3846
3844
  </ul></div>
3847
3845
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
3848
3846
  <div class="admonitionblock">
3849
- <table><tr>
3847
+ <table><tr>
3850
3848
  <td class="icon">
3851
- <img src="./images/icons/tip.png" alt="Tip">
3849
+ <img src="./images/icons/tip.png" alt="Tip">
3852
3850
  </td>
3853
3851
  <td class="content">
3854
3852
  <div class="title">Practical usage example</div>
@@ -3859,7 +3857,7 @@ to 10. The e-commerce website is more important to you. You can then set
3859
3857
  than 3 processes, even if it suddenly gets a lot of traffic. Your e-commerce website
3860
3858
  on the other hand will be free to spawn up to 10 processes if it gets a lot of traffic.</p></div>
3861
3859
  </td>
3862
- </tr></table>
3860
+ </tr></table>
3863
3861
  </div>
3864
3862
  </div>
3865
3863
  <div class="sect3">
@@ -3874,9 +3872,9 @@ will be enforced.</p></div>
3874
3872
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
3875
3873
  The default value is <em>0</em>.</p></div>
3876
3874
  <div class="admonitionblock">
3877
- <table><tr>
3875
+ <table><tr>
3878
3876
  <td class="icon">
3879
- <img src="./images/icons/tip.png" alt="Tip">
3877
+ <img src="./images/icons/tip.png" alt="Tip">
3880
3878
  </td>
3881
3879
  <td class="content">
3882
3880
  <div class="title">Practical usage example</div>
@@ -3890,12 +3888,12 @@ settled down and it has released more pool slots.</p></div>
3890
3888
  <em>PassengerMaxInstancesPerApp</em> to 5. This way, both blogs will never use more
3891
3889
  than 5 pool slots.</p></div>
3892
3890
  </td>
3893
- </tr></table>
3891
+ </tr></table>
3894
3892
  </div>
3895
3893
  <div class="admonitionblock">
3896
- <table><tr>
3894
+ <table><tr>
3897
3895
  <td class="icon">
3898
- <img src="./images/icons/note.png" alt="Note">
3896
+ <img src="./images/icons/note.png" alt="Note">
3899
3897
  </td>
3900
3898
  <td class="content">
3901
3899
  <div class="title">Relation with PassengerMaxInstances</div>
@@ -3912,7 +3910,7 @@ on the other hand will be free to use up all 10 slots if it gets a lot of traffi
3912
3910
  different web applications, while <em>PassengerMaxInstances</em> allows one to divide
3913
3911
  the pool unequally, according to each web application’s relative importance.</p></div>
3914
3912
  </td>
3915
- </tr></table>
3913
+ </tr></table>
3916
3914
  </div>
3917
3915
  </div>
3918
3916
  <div class="sect3">
@@ -3952,7 +3950,7 @@ you’re using the <em>smart</em> or <em>smart-lv2</em> <a href="#PassengerSpawn
3952
3950
  system has enough memory, is it recommended that you set this option to a high
3953
3951
  value or to <em>0</em>.</p></div>
3954
3952
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3955
- <div class="ulist"><ul>
3953
+ <div class="ulist"><ul>
3956
3954
  <li>
3957
3955
  <p>
3958
3956
  In the global server configuration.
@@ -3970,7 +3968,7 @@ In a virtual host configuration block.
3970
3968
  <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="passengerconcurrencymodel-process-thread--1eipofj" data-anchor="PassengerConcurrencyModel">6.15.7. PassengerConcurrencyModel &lt;process|thread&gt;</h4>
3971
3969
  <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>
3972
3970
  <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>
3973
- <div class="ulist"><ul>
3971
+ <div class="ulist"><ul>
3974
3972
  <li>
3975
3973
  <p>
3976
3974
  <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.
@@ -3983,7 +3981,7 @@ In a virtual host configuration block.
3983
3981
  </li>
3984
3982
  </ul></div>
3985
3983
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
3986
- <div class="ulist"><ul>
3984
+ <div class="ulist"><ul>
3987
3985
  <li>
3988
3986
  <p>
3989
3987
  In the global server configuration.
@@ -4012,7 +4010,7 @@ In <em>.htaccess</em>.
4012
4010
  <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>
4013
4011
  <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">PassengerConcurrencyModel</a> is <em>thread</em>.</p></div>
4014
4012
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4015
- <div class="ulist"><ul>
4013
+ <div class="ulist"><ul>
4016
4014
  <li>
4017
4015
  <p>
4018
4016
  In the global server configuration.
@@ -4047,7 +4045,7 @@ reached.</p></div>
4047
4045
  it down after a certain number of requests, all of its memory is guaranteed
4048
4046
  to be freed by the operating system.</p></div>
4049
4047
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4050
- <div class="ulist"><ul>
4048
+ <div class="ulist"><ul>
4051
4049
  <li>
4052
4050
  <p>
4053
4051
  In the global server configuration.
@@ -4071,9 +4069,9 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> i
4071
4069
  </ul></div>
4072
4070
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
4073
4071
  <div class="admonitionblock">
4074
- <table><tr>
4072
+ <table><tr>
4075
4073
  <td class="icon">
4076
- <img src="./images/icons/caution.png" alt="Caution">
4074
+ <img src="./images/icons/caution.png" alt="Caution">
4077
4075
  </td>
4078
4076
  <td class="content">
4079
4077
  <div class="paragraph"><p>The <a href="#PassengerMaxRequests">PassengerMaxRequests</a> directive should be considered
@@ -4081,7 +4079,7 @@ as a workaround for misbehaving applications. It is advised that you fix the
4081
4079
  problem in your application rather than relying on these directives as a
4082
4080
  measure to avoid memory leaks.</p></div>
4083
4081
  </td>
4084
- </tr></table>
4082
+ </tr></table>
4085
4083
  </div>
4086
4084
  </div>
4087
4085
  <div class="sect3">
@@ -4094,7 +4092,7 @@ restarted upon the next request. A value of 0 means that there is no time limit.
4094
4092
  <div class="paragraph"><p>This option is useful for preventing your application from freezing for an
4095
4093
  indefinite period of time.</p></div>
4096
4094
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4097
- <div class="ulist"><ul>
4095
+ <div class="ulist"><ul>
4098
4096
  <li>
4099
4097
  <p>
4100
4098
  In the global server configuration.
@@ -4140,9 +4138,9 @@ to 10 seconds. You can then configure Phusion Passenger as follows:</p>
4140
4138
  or if a request to any other URI takes more than 2 seconds,
4141
4139
  then the corresponding application process will be forced to shutdown.</p></div>
4142
4140
  <div class="admonitionblock">
4143
- <table><tr>
4141
+ <table><tr>
4144
4142
  <td class="icon">
4145
- <img src="./images/icons/caution.png" alt="Caution">
4143
+ <img src="./images/icons/caution.png" alt="Caution">
4146
4144
  </td>
4147
4145
  <td class="content">
4148
4146
  <div class="paragraph"><p>The <a href="#PassengerMaxRequestTime">PassengerMaxRequestTime</a> directive should be
@@ -4150,18 +4148,18 @@ considered as a workaround for misbehaving applications. It is advised that you
4150
4148
  fix the problem in your application rather than relying on these directives as a
4151
4149
  measure to avoid freezing applications.</p></div>
4152
4150
  </td>
4153
- </tr></table>
4151
+ </tr></table>
4154
4152
  </div>
4155
4153
  <div class="admonitionblock">
4156
- <table><tr>
4154
+ <table><tr>
4157
4155
  <td class="icon">
4158
- <img src="./images/icons/note.png" alt="Note">
4156
+ <img src="./images/icons/note.png" alt="Note">
4159
4157
  </td>
4160
4158
  <td class="content">
4161
4159
  <div class="paragraph"><p>This option is currently only available for Ruby apps. It is not yet available
4162
4160
  for Python and Node.js.</p></div>
4163
4161
  </td>
4164
- </tr></table>
4162
+ </tr></table>
4165
4163
  </div>
4166
4164
  </div>
4167
4165
  <div class="sect3">
@@ -4175,7 +4173,7 @@ will not be checked.</p></div>
4175
4173
  <div class="paragraph"><p>This option is useful if your application is leaking memory. By shutting
4176
4174
  it down, all of its memory is guaranteed to be freed by the operating system.</p></div>
4177
4175
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4178
- <div class="ulist"><ul>
4176
+ <div class="ulist"><ul>
4179
4177
  <li>
4180
4178
  <p>
4181
4179
  In the global server configuration.
@@ -4199,9 +4197,9 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> i
4199
4197
  </ul></div>
4200
4198
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
4201
4199
  <div class="admonitionblock">
4202
- <table><tr>
4200
+ <table><tr>
4203
4201
  <td class="icon">
4204
- <img src="./images/icons/note.png" alt="Note">
4202
+ <img src="./images/icons/note.png" alt="Note">
4205
4203
  </td>
4206
4204
  <td class="content">
4207
4205
  <div class="title">A word about permissions</div>
@@ -4212,12 +4210,12 @@ not obtainable through <span class="monospaced">ps</span>. You should ensure tha
4212
4210
  correctly and that the <span class="monospaced">/proc</span> filesystem is accessible by the
4213
4211
  <span class="monospaced">PassengerHelperAgent</span> process.</p></div>
4214
4212
  </td>
4215
- </tr></table>
4213
+ </tr></table>
4216
4214
  </div>
4217
4215
  <div class="admonitionblock">
4218
- <table><tr>
4216
+ <table><tr>
4219
4217
  <td class="icon">
4220
- <img src="./images/icons/caution.png" alt="Caution">
4218
+ <img src="./images/icons/caution.png" alt="Caution">
4221
4219
  </td>
4222
4220
  <td class="content">
4223
4221
  <div class="paragraph"><p>The <a href="#PassengerMaxRequests">PassengerMaxRequests</a> and
@@ -4226,14 +4224,14 @@ as workarounds for misbehaving applications. It is advised that you fix the
4226
4224
  problem in your application rather than relying on these directives as a
4227
4225
  measure to avoid memory leaks.</p></div>
4228
4226
  </td>
4229
- </tr></table>
4227
+ </tr></table>
4230
4228
  </div>
4231
4229
  </div>
4232
4230
  <div class="sect3">
4233
4231
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_passengerstatthrottlerate_lt_integer_gt"></span><h4 data-comment-topic="passengerstatthrottlerate-integer--1dcfda3" data-anchor="_passengerstatthrottlerate_lt_integer_gt">6.15.12. PassengerStatThrottleRate &lt;integer&gt;</h4>
4234
4232
  <div class="paragraph"><p>By default, Phusion Passenger performs several filesystem checks (or, in
4235
4233
  programmers jargon, <em>stat() calls</em>) each time a request is processed:</p></div>
4236
- <div class="ulist"><ul>
4234
+ <div class="ulist"><ul>
4237
4235
  <li>
4238
4236
  <p>
4239
4237
  It checks whether <em>config/environment.rb</em>, <em>config.ru</em> or <em>passenger_wsgi.py</em>
@@ -4257,7 +4255,7 @@ seconds. Setting it to a value of <em>0</em> means that no throttling will take
4257
4255
  or in other words, that the above list of filesystem checks will be performed on
4258
4256
  every request.</p></div>
4259
4257
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4260
- <div class="ulist"><ul>
4258
+ <div class="ulist"><ul>
4261
4259
  <li>
4262
4260
  <p>
4263
4261
  In the global server configuration.
@@ -4289,14 +4287,14 @@ web application might experience a small delay as Phusion Passenger is starting
4289
4287
  the web application on demand. If that is undesirable, then this directive can be
4290
4288
  used to pre-started application processes during Apache startup.</p></div>
4291
4289
  <div class="paragraph"><p>A few things to be careful of:</p></div>
4292
- <div class="ulist"><ul>
4290
+ <div class="ulist"><ul>
4293
4291
  <li>
4294
4292
  <p>
4295
4293
  This directive accepts the <strong>URL</strong> of the web application you want to pre-start,
4296
4294
  not a on/off value! This might seem a bit weird, but read on for rationale. As
4297
4295
  for the specifics of the URL:
4298
4296
  </p>
4299
- <div class="ulist"><ul>
4297
+ <div class="ulist"><ul>
4300
4298
  <li>
4301
4299
  <p>
4302
4300
  The domain part of the URL must be equal to the value of the <em>ServerName</em>
@@ -4327,7 +4325,7 @@ You will probably want to combine this option with
4327
4325
  </li>
4328
4326
  </ul></div>
4329
4327
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4330
- <div class="ulist"><ul>
4328
+ <div class="ulist"><ul>
4331
4329
  <li>
4332
4330
  <p>
4333
4331
  In the global server configuration.
@@ -4445,7 +4443,7 @@ PassengerPreStart http://bar.com:3500/</pre>
4445
4443
  <div class="paragraph"><p>A directive that accepts a simple on/off flag is definitely more intuitive,
4446
4444
  but due technical difficulties w.r.t. the way Apache works, it’s very hard
4447
4445
  to implement it like that:</p></div>
4448
- <div class="ulist"><ul>
4446
+ <div class="ulist"><ul>
4449
4447
  <li>
4450
4448
  <p>
4451
4449
  It is very hard to obtain a full list of web applications defined in the
@@ -4533,7 +4531,7 @@ performance mode via testing.</p></div>
4533
4531
  <div class="paragraph"><p>This option is <strong>not</strong> an all-or-nothing global option: you can enable high
4534
4532
  performance mode for certain virtual hosts or certain URLs only.
4535
4533
  The <em>PassengerHighPerformance</em> option may occur in the following places:</p></div>
4536
- <div class="ulist"><ul>
4534
+ <div class="ulist"><ul>
4537
4535
  <li>
4538
4536
  <p>
4539
4537
  In the global server configuration.
@@ -4610,7 +4608,7 @@ then you can enable high performance mode for a certain URL only. For example:</
4610
4608
  <div class="paragraph"><p>Configures whether Phusion Passenger should resolve symlinks in the document root.
4611
4609
  Please refer to <a href="#application_detection">How Phusion Passenger detects whether a virtual host is a web application</a> for more information.</p></div>
4612
4610
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4613
- <div class="ulist"><ul>
4611
+ <div class="ulist"><ul>
4614
4612
  <li>
4615
4613
  <p>
4616
4614
  In the global server configuration.
@@ -4644,7 +4642,7 @@ as well as Apache’s
4644
4642
  <div class="paragraph"><p>Is it important that you turn on both AllowEncodedSlashes <strong>and</strong> PassengerAllowEncodedSlashes,
4645
4643
  otherwise this feature will not work properly.</p></div>
4646
4644
  <div class="paragraph"><p>PassengerAllowEncodedSlashes may occur in the following places:</p></div>
4647
- <div class="ulist"><ul>
4645
+ <div class="ulist"><ul>
4648
4646
  <li>
4649
4647
  <p>
4650
4648
  In the global server configuration.
@@ -4711,7 +4709,7 @@ displaying maintenance.html will work fine even for URLs starting with "/users".
4711
4709
  write to the Apache error log file. A higher log level value means that more
4712
4710
  information will be logged.</p></div>
4713
4711
  <div class="paragraph"><p>Possible values are:</p></div>
4714
- <div class="ulist"><ul>
4712
+ <div class="ulist"><ul>
4715
4713
  <li>
4716
4714
  <p>
4717
4715
  <em>0</em>: Show only errors and warnings.
@@ -4760,7 +4758,7 @@ gem 'debugger', :platforms =&gt; :ruby_19</pre>
4760
4758
  </div>
4761
4759
  <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>
4762
4760
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4763
- <div class="ulist"><ul>
4761
+ <div class="ulist"><ul>
4764
4762
  <li>
4765
4763
  <p>
4766
4764
  In the global server configuration.
@@ -4796,7 +4794,7 @@ Ruby on Rails &gt;= 3.x applications are considered Rack applications.</p></div>
4796
4794
  <div class="paragraph"><p>It is allowed to specify this option multiple times. Do this to deploy multiple
4797
4795
  Rails applications in different sub-URIs under the same virtual host.</p></div>
4798
4796
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4799
- <div class="ulist"><ul>
4797
+ <div class="ulist"><ul>
4800
4798
  <li>
4801
4799
  <p>
4802
4800
  In the global server configuration.
@@ -4823,7 +4821,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4823
4821
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="rails_env"></span><h4 data-comment-topic="railsenv-string--1b0xxvu" data-anchor="rails_env">6.18.2. RailsEnv &lt;string&gt;</h4>
4824
4822
  <div class="paragraph"><p>This option allows one to specify the default <span class="monospaced">RAILS_ENV</span> value.</p></div>
4825
4823
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4826
- <div class="ulist"><ul>
4824
+ <div class="ulist"><ul>
4827
4825
  <li>
4828
4826
  <p>
4829
4827
  In the global server configuration.
@@ -4857,7 +4855,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4857
4855
  <div class="paragraph"><p>It is allowed to specify this option multiple times. Do this to deploy multiple
4858
4856
  Rack applications in different sub-URIs under the same virtual host.</p></div>
4859
4857
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4860
- <div class="ulist"><ul>
4858
+ <div class="ulist"><ul>
4861
4859
  <li>
4862
4860
  <p>
4863
4861
  In the global server configuration.
@@ -4886,7 +4884,7 @@ In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span>
4886
4884
  environment variable. This allows one to define the environment in which
4887
4885
  Rack applications are run, very similar to <span class="monospaced">RAILS_ENV</span>.</p></div>
4888
4886
  <div class="paragraph"><p>This option may occur in the following places:</p></div>
4889
- <div class="ulist"><ul>
4887
+ <div class="ulist"><ul>
4890
4888
  <li>
4891
4889
  <p>
4892
4890
  In the global server configuration.
@@ -4984,7 +4982,7 @@ to fix this problem.</p></div>
4984
4982
  <div class="content">
4985
4983
  <div class="title">Symptoms</div>
4986
4984
  <div class="paragraph"><p>Installing Phusion Passenger fails because of one of the following errors:</p></div>
4987
- <div class="ulist"><ul>
4985
+ <div class="ulist"><ul>
4988
4986
  <li>
4989
4987
  <p>
4990
4988
  The Phusion Passenger installer tells you that the Ruby development headers
@@ -5009,7 +5007,7 @@ must be installed. On most Linux systems, Ruby and the Ruby development headers
5009
5007
  are contained in separate packages, so having Ruby installed does not
5010
5008
  automatically imply having the development headers installed.</p></div>
5011
5009
  <div class="paragraph"><p>Here’s how you can install the development headers:</p></div>
5012
- <div class="dlist"><dl>
5010
+ <div class="dlist"><dl>
5013
5011
  <dt class="hdlist1">
5014
5012
  Ubuntu/Debian
5015
5013
  </dt>
@@ -5065,15 +5063,15 @@ Other operating systems
5065
5063
  </dd>
5066
5064
  </dl></div>
5067
5065
  <div class="admonitionblock">
5068
- <table><tr>
5066
+ <table><tr>
5069
5067
  <td class="icon">
5070
- <img src="./images/icons/note.png" alt="Note">
5068
+ <img src="./images/icons/note.png" alt="Note">
5071
5069
  </td>
5072
5070
  <td class="content">If you’ve installed a new Ruby version (i.e. your system now contains
5073
5071
  multiple Ruby installations), then you will need to tell Phusion Passenger
5074
5072
  which Ruby installation you want to use. Please read
5075
5073
  <a href="#specifying_ruby_installation">Specifying the correct Ruby installation</a>.</td>
5076
- </tr></table>
5074
+ </tr></table>
5077
5075
  </div>
5078
5076
  </div>
5079
5077
  <div class="sect3">
@@ -5082,7 +5080,7 @@ which Ruby installation you want to use. Please read
5082
5080
  <div class="content">
5083
5081
  <div class="title">Symptoms</div>
5084
5082
  <div class="paragraph"><p>Installing Phusion Passenger fails because of one of the following errors:</p></div>
5085
- <div class="ulist"><ul>
5083
+ <div class="ulist"><ul>
5086
5084
  <li>
5087
5085
  <p>
5088
5086
  The installer says that the Apache development headers aren’t installed.
@@ -5098,7 +5096,7 @@ else similar to <em>http_*.h</em>.)</p></div>
5098
5096
  </ul></div>
5099
5097
  </div>
5100
5098
  </div>
5101
- <div class="dlist"><dl>
5099
+ <div class="dlist"><dl>
5102
5100
  <dt class="hdlist1">
5103
5101
  Ubuntu
5104
5102
  </dt>
@@ -5173,7 +5171,7 @@ Other operating systems
5173
5171
  <div class="content">
5174
5172
  <div class="title">Symptoms</div>
5175
5173
  <div class="paragraph"><p>Installing Phusion Passenger fails because one of the following errors:</p></div>
5176
- <div class="ulist"><ul>
5174
+ <div class="ulist"><ul>
5177
5175
  <li>
5178
5176
  <p>
5179
5177
  The installer tells you that APR development headers aren’t installed.
@@ -5192,7 +5190,7 @@ The error message “'apr_strings.h: No such file or directory”' occurs.
5192
5190
  </ul></div>
5193
5191
  </div>
5194
5192
  </div>
5195
- <div class="dlist"><dl>
5193
+ <div class="dlist"><dl>
5196
5194
  <dt class="hdlist1">
5197
5195
  Ubuntu
5198
5196
  </dt>
@@ -5265,9 +5263,9 @@ Other operating systems
5265
5263
  <div class="sect2">
5266
5264
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_problems_after_installation"></span><h3 data-comment-topic="problems-after-installation-fwd23q" data-anchor="_problems_after_installation">7.3. Problems after installation</h3>
5267
5265
  <div class="admonitionblock">
5268
- <table><tr>
5266
+ <table><tr>
5269
5267
  <td class="icon">
5270
- <img src="./images/icons/tip.png" alt="Tip">
5268
+ <img src="./images/icons/tip.png" alt="Tip">
5271
5269
  </td>
5272
5270
  <td class="content">
5273
5271
  <div class="title">The golden tip: read your Apache error logs!</div>
@@ -5275,7 +5273,7 @@ Other operating systems
5275
5273
  you’re experiencing post-installation problems, please look
5276
5274
  inside the Apache error logs. It will tell you what exactly went wrong.</p></div>
5277
5275
  </td>
5278
- </tr></table>
5276
+ </tr></table>
5279
5277
  </div>
5280
5278
  <div class="sect3">
5281
5279
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_my_rails_application_works_on_mongrel_but_not_on_phusion_passenger"></span><h4 data-comment-topic="my-rails-application-works-on-mongrel-but-not-on-phusion-passenger-1f28drx" data-anchor="_my_rails_application_works_on_mongrel_but_not_on_phusion_passenger">7.3.1. My Rails application works on Mongrel, but not on Phusion Passenger</h4>
@@ -5303,7 +5301,7 @@ Apache installations on their system.</p></div>
5303
5301
  <div class="paragraph"><p>Static assets are accelerated, i.e. they are served directly by Apache and do not
5304
5302
  go through the Rails stack. There are two reasons why Apache doesn’t serve static
5305
5303
  assets correctly:</p></div>
5306
- <div class="olist arabic"><ol class="arabic">
5304
+ <div class="olist arabic"><ol class="arabic">
5307
5305
  <li>
5308
5306
  <p>
5309
5307
  Your Apache configuration is too strict, and does not allow HTTP clients to
@@ -5339,7 +5337,7 @@ with SELinux. On Fedora, CentOS and RedHat Enterprise Linux, Apache is locked
5339
5337
  down by SELinux policies.</p></div>
5340
5338
  <div class="paragraph"><p>To solve this problem, you must set some permissions on the Phusion Passenger files
5341
5339
  and folders, so that Apache can access them.</p></div>
5342
- <div class="ulist"><ul>
5340
+ <div class="ulist"><ul>
5343
5341
  <li>
5344
5342
  <p>
5345
5343
  If you’ve installed Phusion Passenger via a gem, then run this command to determine
@@ -5386,7 +5384,7 @@ specified).</p></div>
5386
5384
  <div class="sect3">
5387
5385
  <a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_my_rails_application_8217_s_log_file_is_not_being_written_to"></span><h4 data-comment-topic="my-rails-application-s-log-file-is-not-being-written-to-3i747l" data-anchor="_my_rails_application_8217_s_log_file_is_not_being_written_to">7.3.7. My Rails application’s log file is not being written to</h4>
5388
5386
  <div class="paragraph"><p>There are a couple things that you should be aware of:</p></div>
5389
- <div class="ulist"><ul>
5387
+ <div class="ulist"><ul>
5390
5388
  <li>
5391
5389
  <p>
5392
5390
  By default, Phusion Passenger runs Rails applications in <em>production</em> mode,
@@ -5527,14 +5525,14 @@ we see that all the Apache and Nginx worker processes only take less than 1 MB m
5527
5525
  This is a lot less than the 50-80 MB-ish memory usage as shown in the <em>VMSize</em> column
5528
5526
  (which is what a lot of people think is the real memory usage, but is actually not).</p></div>
5529
5527
  <div class="admonitionblock">
5530
- <table><tr>
5528
+ <table><tr>
5531
5529
  <td class="icon">
5532
- <img src="./images/icons/note.png" alt="Note">
5530
+ <img src="./images/icons/note.png" alt="Note">
5533
5531
  </td>
5534
5532
  <td class="content">Private dirty RSS reporting only works on Linux. Unfortunately other operating systems
5535
5533
  don’t provide facilities for determining processes' private dirty RSS. On non-Linux systems,
5536
5534
  the Resident Set Size is reported instead.</td>
5537
- </tr></table>
5535
+ </tr></table>
5538
5536
  </div>
5539
5537
  </div>
5540
5538
  <div class="sect2">
@@ -5556,7 +5554,7 @@ inactive = 1
5556
5554
  </div>
5557
5555
  </div>
5558
5556
  <div class="paragraph"><p>The <em>general information</em> section shows the following information:</p></div>
5559
- <div class="dlist"><dl>
5557
+ <div class="dlist"><dl>
5560
5558
  <dt class="hdlist1">
5561
5559
  max
5562
5560
  </dt>
@@ -5600,7 +5598,7 @@ time). The value of <em>inactive</em> equals <span class="monospaced">count - ac
5600
5598
  </dl></div>
5601
5599
  <div class="paragraph"><p>The <em>domains</em> section shows, for each application directory, information about running
5602
5600
  application instances:</p></div>
5603
- <div class="dlist"><dl>
5601
+ <div class="dlist"><dl>
5604
5602
  <dt class="hdlist1">
5605
5603
  Sessions
5606
5604
  </dt>
@@ -5667,13 +5665,13 @@ This is the case with Ruby on Rails. So if you kill a Ruby on Rails application
5667
5665
  running it in a <em>production</em> environment). If you don’t see a backtrace there, check
5668
5666
  the web server error log.</p></div>
5669
5667
  <div class="admonitionblock">
5670
- <table><tr>
5668
+ <table><tr>
5671
5669
  <td class="icon">
5672
- <img src="./images/icons/note.png" alt="Note">
5670
+ <img src="./images/icons/note.png" alt="Note">
5673
5671
  </td>
5674
5672
  <td class="content">It is safe to kill application instances, even in live environments. Phusion Passenger
5675
5673
  will restart killed application instances, as if nothing bad happened.</td>
5676
- </tr></table>
5674
+ </tr></table>
5677
5675
  </div>
5678
5676
  </div>
5679
5677
  <div class="sect2">
@@ -5682,7 +5680,7 @@ will restart killed application instances, as if nothing bad happened.</td>
5682
5680
  the request to the most suitable application process, but sometimes it is desirable to
5683
5681
  be able to directly access the individual application processes. Use cases include, but
5684
5682
  are not limited to:</p></div>
5685
- <div class="ulist"><ul>
5683
+ <div class="ulist"><ul>
5686
5684
  <li>
5687
5685
  <p>
5688
5686
  One wants to debug a memory leak or memory bloat problem that only seems to appear on
@@ -5770,12 +5768,12 @@ and they’re explained further down in this section.</p></div>
5770
5768
  <div class="sect3">
5771
5769
  <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-yxvtxo" data-anchor="_requirements">9.1.1. Requirements</h4>
5772
5770
  <div class="paragraph"><p>User switching is only enabled when all of the following conditions are met:</p></div>
5773
- <div class="ulist"><ul>
5771
+ <div class="ulist"><ul>
5774
5772
  <li>
5775
5773
  <p>
5776
5774
  When not using <a href="#flying_passenger">Flying Passenger</a> (this is probably the case):
5777
5775
  </p>
5778
- <div class="ulist"><ul>
5776
+ <div class="ulist"><ul>
5779
5777
  <li>
5780
5778
  <p>
5781
5779
  The
@@ -5794,7 +5792,7 @@ The web server’s control process must have root privileges. This is the case o
5794
5792
  <p>
5795
5793
  When using <a href="#flying_passenger">Flying Passenger</a>:
5796
5794
  </p>
5797
- <div class="ulist"><ul>
5795
+ <div class="ulist"><ul>
5798
5796
  <li>
5799
5797
  <p>
5800
5798
  The Flying Passenger daemon must be run with root privileges.
@@ -5809,49 +5807,49 @@ The Flying Passenger daemon must be run with root privileges.
5809
5807
  <div class="paragraph"><p>When not using Flying Passenger, the following table illustrates the effect for different combinations of the requirements.</p></div>
5810
5808
  <table class="tableblock frame-all grid-all" style="
5811
5809
  width:100%;
5812
- ">
5813
- <col style="width:33%;">
5814
- <col style="width:33%;">
5815
- <col style="width:33%;">
5816
- <tbody>
5817
- <tr>
5810
+ ">
5811
+ <col style="width:33%;">
5812
+ <col style="width:33%;">
5813
+ <col style="width:33%;">
5814
+ <tbody>
5815
+ <tr>
5818
5816
  <td class="tableblock halign-left valign-top"><p class="tableblock"></p></td>
5819
5817
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>PassengerUserSwitching on</strong></p></td>
5820
5818
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>PassengerUserSwitching off</strong></p></td>
5821
- </tr>
5822
- <tr>
5819
+ </tr>
5820
+ <tr>
5823
5821
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Web server has root privileges</strong></p></td>
5824
5822
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching enabled.</p></td>
5825
5823
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching disabled. Apps are run as
5826
5824
  <a href="#PassengerDefaultUser">PassengerDefaultUser</a> and
5827
5825
  <a href="#PassengerDefaultGroup">PassengerDefaultGroup</a>.</p></td>
5828
- </tr>
5829
- <tr>
5826
+ </tr>
5827
+ <tr>
5830
5828
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Web server has no root privileges</strong></p></td>
5831
5829
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching disabled. Apps are run as the web server’s user.</p></td>
5832
5830
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching disabled. Apps are run as the web server’s user.</p></td>
5833
- </tr>
5834
- </tbody>
5835
- </table>
5831
+ </tr>
5832
+ </tbody>
5833
+ </table>
5836
5834
  <div class="paragraph"><p>When using Flying Passenger, the effect is as follows:</p></div>
5837
5835
  <table class="tableblock frame-all grid-all" style="
5838
5836
  width:100%;
5839
- ">
5840
- <col style="width:50%;">
5841
- <col style="width:50%;">
5842
- <tbody>
5843
- <tr>
5837
+ ">
5838
+ <col style="width:50%;">
5839
+ <col style="width:50%;">
5840
+ <tbody>
5841
+ <tr>
5844
5842
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Daemon run with root privileges</strong></p></td>
5845
5843
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching enabled.</p></td>
5846
- </tr>
5847
- <tr>
5844
+ </tr>
5845
+ <tr>
5848
5846
  <td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Daemon run without root privileges</strong></p></td>
5849
5847
  <td class="tableblock halign-left valign-top"><p class="tableblock">User switching disabled. Apps are run as the daemon’s user.</p></td>
5850
- </tr>
5851
- </tbody>
5852
- </table>
5848
+ </tr>
5849
+ </tbody>
5850
+ </table>
5853
5851
  <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>
5854
- <div class="olist arabic"><ol class="arabic">
5852
+ <div class="olist arabic"><ol class="arabic">
5855
5853
  <li>
5856
5854
  <p>
5857
5855
  If
@@ -5877,7 +5875,7 @@ Otherwise, the application is run as the owner of the startup file.
5877
5875
  <div class="sect3">
5878
5876
  <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-161hgge" data-anchor="_caveats_amp_troubleshooting">9.1.3. Caveats &amp; troubleshooting</h4>
5879
5877
  <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>
5880
- <div class="ulist"><ul>
5878
+ <div class="ulist"><ul>
5881
5879
  <li>
5882
5880
  <p>
5883
5881
  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.
@@ -5934,7 +5932,7 @@ Requests in top-level queue : 0
5934
5932
  <div class="sect2">
5935
5933
  <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--1ubxnq0" data-anchor="reducing_memory_usage">9.2. Copy-on-write memory support (reducing memory consumption of Ruby applications)</h3>
5936
5934
  <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>
5937
- <div class="ulist"><ul>
5935
+ <div class="ulist"><ul>
5938
5936
  <li>
5939
5937
  <p>
5940
5938
  MRI Ruby &gt;= 2.0. Versions prior to 2.0 did not have a copy-on-write friendly garbage collector.
@@ -5988,7 +5986,7 @@ end</pre>
5988
5986
  The support consists of loading your application under the environment defined by your
5989
5987
  Gemfile. In other words, Phusion Passenger loads your application as if <em>bundle exec</em> was used.</p></div>
5990
5988
  <div class="paragraph"><p>The Bundler support works as follows:</p></div>
5991
- <div class="ulist"><ul>
5989
+ <div class="ulist"><ul>
5992
5990
  <li>
5993
5991
  <p>
5994
5992
  If you have a <em>.bundle/environment.rb</em> in your application root, then Phusion
@@ -6053,9 +6051,9 @@ application’s root folder. Unlike <em>restart.txt</em>, Phusion Passenger does
6053
6051
  check for this file’s timestamp: Phusion Passenger will always restart the
6054
6052
  application, as long as <em>always_restart.txt</em> exists.</p></div>
6055
6053
  <div class="admonitionblock">
6056
- <table><tr>
6054
+ <table><tr>
6057
6055
  <td class="icon">
6058
- <img src="./images/icons/note.png" alt="Note">
6056
+ <img src="./images/icons/note.png" alt="Note">
6059
6057
  </td>
6060
6058
  <td class="content">If you’re just developing a Rails application then you probably don’t need
6061
6059
  this feature. If you set
@@ -6065,7 +6063,7 @@ then Rails will automatically reload your application code after each request.
6065
6063
  <em>always_restart.txt</em> is mostly useful when you’re using a web framework that
6066
6064
  doesn’t support code reloading by itself, of when you’re working on a web framework
6067
6065
  yourself.</td>
6068
- </tr></table>
6066
+ </tr></table>
6069
6067
  </div>
6070
6068
  </div>
6071
6069
  <div class="sect2">
@@ -6113,7 +6111,7 @@ please refer to
6113
6111
  <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>
6114
6112
  <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>
6115
6113
  <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>
6116
- <div class="ulist"><ul>
6114
+ <div class="ulist"><ul>
6117
6115
  <li>
6118
6116
  <p>
6119
6117
  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.
@@ -6126,7 +6124,7 @@ Phusion Passenger can spawn more processes as necessary, in order to prevent sit
6126
6124
  </li>
6127
6125
  </ul></div>
6128
6126
  <div class="paragraph"><p>Applications can use Out-of-Band Work as follows:</p></div>
6129
- <div class="olist arabic"><ol class="arabic">
6127
+ <div class="olist arabic"><ol class="arabic">
6130
6128
  <li>
6131
6129
  <p>
6132
6130
  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.
@@ -6178,7 +6176,7 @@ http://www.gnu.org/software/src-highlite -->
6178
6176
  </div>
6179
6177
  <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>
6180
6178
  <div class="paragraph"><p>References:</p></div>
6181
- <div class="ulist"><ul>
6179
+ <div class="ulist"><ul>
6182
6180
  <li>
6183
6181
  <p>
6184
6182
  <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>
@@ -6192,7 +6190,7 @@ http://www.gnu.org/software/src-highlite -->
6192
6190
  <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>
6193
6191
  <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>
6194
6192
  <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>
6195
- <div class="ulist"><ul>
6193
+ <div class="ulist"><ul>
6196
6194
  <li>
6197
6195
  <p>
6198
6196
  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.
@@ -6361,7 +6359,7 @@ exec /path-to/flying-passenger \
6361
6359
  <div class="sect3">
6362
6360
  <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-lz3rbb" data-anchor="flying_passenger_caveats">9.9.5. Caveats and limitations</h4>
6363
6361
  <div class="paragraph"><p>Beware of the following caveats and limitations when using Flying Passenger:</p></div>
6364
- <div class="ulist"><ul>
6362
+ <div class="ulist"><ul>
6365
6363
  <li>
6366
6364
  <p>
6367
6365
  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.
@@ -6381,7 +6379,7 @@ When you add a new application to the web server configuration, Flying Passenger
6381
6379
  <p>
6382
6380
  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:
6383
6381
  </p>
6384
- <div class="ulist"><ul>
6382
+ <div class="ulist"><ul>
6385
6383
  <li>
6386
6384
  <p>
6387
6385
  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.
@@ -6445,7 +6443,7 @@ This check occurs after checking whether the original mapped filename exists (as
6445
6443
  of static asset serving). All this is done without the need for special mod_rewrite
6446
6444
  rules.</p></div>
6447
6445
  <div class="paragraph"><p>For example, suppose that the browser requests <em>/foo/bar</em>.</p></div>
6448
- <div class="olist arabic"><ol class="arabic">
6446
+ <div class="olist arabic"><ol class="arabic">
6449
6447
  <li>
6450
6448
  <p>
6451
6449
  Phusion Passenger will first check whether this URI maps to a static file, i.e.
@@ -6486,7 +6484,7 @@ whether the following file exists:</p></div>
6486
6484
  </div>
6487
6485
  <div class="paragraph"><p>If you’re not a programmer and don’t understand the above pseudo-code snippet, it means
6488
6486
  that Phusion Passenger will:</p></div>
6489
- <div class="olist arabic"><ol class="arabic">
6487
+ <div class="olist arabic"><ol class="arabic">
6490
6488
  <li>
6491
6489
  <p>
6492
6490
  Extract the parent directory filename from the value of the DocumentRoot directory.
@@ -6529,14 +6527,12 @@ Phusion Passenger will look for <em>config.ru</em> instead of <em>config/environ
6529
6527
  Attribution-Share Alike 3.0 Unported License</a>.</p></div>
6530
6528
  <div class="paragraph"><p><span class="image">
6531
6529
  <a class="image" href="http://creativecommons.org/licenses/by-sa/3.0/">
6532
- <img src="images/by_sa.png" alt="images/by_sa.png">
6533
- </a>
6530
+ <img src="images/by_sa.png" alt="images/by_sa.png"></a>
6534
6531
  </span></p></div>
6535
6532
  <div class="paragraph"><p>Phusion Passenger is brought to you by <a href="http://www.phusion.nl/">Phusion</a>.</p></div>
6536
6533
  <div class="paragraph"><p><span class="image">
6537
6534
  <a class="image" href="http://www.phusion.nl/">
6538
- <img src="images/phusion_banner.png" alt="images/phusion_banner.png">
6539
- </a>
6535
+ <img src="images/phusion_banner.png" alt="images/phusion_banner.png"></a>
6540
6536
  </span></p></div>
6541
6537
  <div class="paragraph"><p>Phusion Passenger is a trademark of Hongli Lai &amp; Ninh Bui.</p></div>
6542
6538
  </div>
@@ -6646,20 +6642,18 @@ programmers jargon, Phusion Passenger calls fork(), but not exec().</p></div>
6646
6642
  <div class="sect2">
6647
6643
  <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-1cvu9dd" data-anchor="_the_smart_spawning_method">13.2. The smart spawning method</h3>
6648
6644
  <div class="admonitionblock">
6649
- <table><tr>
6645
+ <table><tr>
6650
6646
  <td class="icon">
6651
- <img src="./images/icons/note.png" alt="Note">
6647
+ <img src="./images/icons/note.png" alt="Note">
6652
6648
  </td>
6653
6649
  <td class="content">Smart spawning is supported for all Ruby applications but not for WSGI applications.</td>
6654
- </tr></table>
6650
+ </tr></table>
6655
6651
  </div>
6656
6652
  <div class="paragraph"><p>While direct spawning works well, it’s not as efficient as it could be
6657
6653
  because each worker process has its own private copy of the Rails application
6658
6654
  as well as the Rails framework. This wastes memory as well as startup time.</p></div>
6659
6655
  <div class="paragraph"><p><span class="image">
6660
- <img src="images/direct_spawning.png" alt="Worker processes and direct spawning">
6661
- </span><br>
6662
- <em>Figure: Worker processes and direct spawning. Each worker process has its
6656
+ <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
6663
6657
  own private copy of the application code and Rails framework code.</em></p></div>
6664
6658
  <div class="paragraph"><p>It is possible to make the different worker processes share the memory occupied
6665
6659
  by application and Rails framework code, by utilizing so-called
@@ -6683,15 +6677,13 @@ processes will share as much common
6683
6677
  memory as possible. That is, they will all share the same application and Rails
6684
6678
  framework code.</p></div>
6685
6679
  <div class="paragraph"><p><span class="image">
6686
- <img src="images/smart.png" alt="images/smart.png">
6687
- </span><br>
6688
- <em>Figure: Worker processes and the smart spawn method. All worker processes,
6680
+ <img src="images/smart.png" alt="images/smart.png"></span><br><em>Figure: Worker processes and the smart spawn method. All worker processes,
6689
6681
  as well as the ApplicationSpawner, share the same application code and Rails
6690
6682
  framework code.</em></p></div>
6691
6683
  <div class="paragraph"><p>The <em>smart</em> method allows different worker processes that belong to the same
6692
6684
  application to share memory.</p></div>
6693
6685
  <div class="paragraph"><p>Notes:</p></div>
6694
- <div class="ulist"><ul>
6686
+ <div class="ulist"><ul>
6695
6687
  <li>
6696
6688
  <p>
6697
6689
  Vendored Rails frameworks cannot be shared by different applications, even if
@@ -6925,7 +6917,7 @@ has no effect.</p></div>
6925
6917
  <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>
6926
6918
  <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>
6927
6919
  <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>
6928
- <div class="ulist"><ul>
6920
+ <div class="ulist"><ul>
6929
6921
  <li>
6930
6922
  <p>
6931
6923
  …only newly spawned bash shells see them.
@@ -6943,12 +6935,12 @@ has no effect.</p></div>
6943
6935
  </li>
6944
6936
  </ul></div>
6945
6937
  <div class="admonitionblock">
6946
- <table><tr>
6938
+ <table><tr>
6947
6939
  <td class="icon">
6948
- <img src="./images/icons/note.png" alt="Note">
6940
+ <img src="./images/icons/note.png" alt="Note">
6949
6941
  </td>
6950
6942
  <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>
6951
- </tr></table>
6943
+ </tr></table>
6952
6944
  </div>
6953
6945
  <div class="sect2">
6954
6946
  <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-85e6aa" data-anchor="_working_with_environment_variables">14.1. Working with environment variables</h3>
@@ -6985,9 +6977,9 @@ ruby -e <span style="color: #FF0000">'p ENV["APXS2"]'</span>
6985
6977
  </div>
6986
6978
  </div>
6987
6979
  <div class="admonitionblock">
6988
- <table><tr>
6980
+ <table><tr>
6989
6981
  <td class="icon">
6990
- <img src="./images/icons/note.png" alt="Note">
6982
+ <img src="./images/icons/note.png" alt="Note">
6991
6983
  </td>
6992
6984
  <td class="content">
6993
6985
  <div class="title">The "export" keyword is important</div>
@@ -7004,7 +6996,7 @@ ruby -e <span style="color: #FF0000">'p ENV["APXS2"]'</span>
7004
6996
  </div>
7005
6997
  </div>
7006
6998
  </td>
7007
- </tr></table>
6999
+ </tr></table>
7008
7000
  </div>
7009
7001
  <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>
7010
7002
  <div class="listingblock">
@@ -7082,7 +7074,7 @@ user@localhost bash$ frobnicator
7082
7074
  <div class="sect3">
7083
7075
  <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-xwppud" data-anchor="_adding_phusion_passenger_8217_s_administration_tools_to_path">14.2.1. Adding Phusion Passenger’s administration tools to PATH</h4>
7084
7076
  <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>
7085
- <div class="ulist"><ul>
7077
+ <div class="ulist"><ul>
7086
7078
  <li>
7087
7079
  <p>
7088
7080
  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>:
@@ -7140,12 +7132,12 @@ $ sudo find . -name passenger-status
7140
7132
  </li>
7141
7133
  </ul></div>
7142
7134
  <div class="admonitionblock">
7143
- <table><tr>
7135
+ <table><tr>
7144
7136
  <td class="icon">
7145
- <img src="./images/icons/note.png" alt="Note">
7137
+ <img src="./images/icons/note.png" alt="Note">
7146
7138
  </td>
7147
7139
  <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>
7148
- </tr></table>
7140
+ </tr></table>
7149
7141
  </div>
7150
7142
  </div>
7151
7143
  </div>
@@ -7167,23 +7159,23 @@ echo <span style="color: #FF0000">'export PATH=/usr/local/bin:$PATH'</span> <spa
7167
7159
  </div>
7168
7160
  <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>
7169
7161
  <div class="admonitionblock">
7170
- <table><tr>
7162
+ <table><tr>
7171
7163
  <td class="icon">
7172
- <img src="./images/icons/note.png" alt="Note">
7164
+ <img src="./images/icons/note.png" alt="Note">
7173
7165
  </td>
7174
7166
  <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>
7175
- </tr></table>
7167
+ </tr></table>
7176
7168
  </div>
7177
7169
  </div>
7178
7170
  <div class="sect3">
7179
7171
  <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-15zqjvi" data-anchor="_apache">14.3.2. Apache</h4>
7180
7172
  <div class="admonitionblock">
7181
- <table><tr>
7173
+ <table><tr>
7182
7174
  <td class="icon">
7183
- <img src="./images/icons/note.png" alt="Note">
7175
+ <img src="./images/icons/note.png" alt="Note">
7184
7176
  </td>
7185
7177
  <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>
7186
- </tr></table>
7178
+ </tr></table>
7187
7179
  </div>
7188
7180
  <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>
7189
7181
  <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>
@@ -7193,24 +7185,24 @@ echo <span style="color: #FF0000">'export PATH=/usr/local/bin:$PATH'</span> <spa
7193
7185
  <div class="sect3">
7194
7186
  <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-l7ztbb" data-anchor="_nginx">14.3.3. Nginx</h4>
7195
7187
  <div class="admonitionblock">
7196
- <table><tr>
7188
+ <table><tr>
7197
7189
  <td class="icon">
7198
- <img src="./images/icons/note.png" alt="Note">
7190
+ <img src="./images/icons/note.png" alt="Note">
7199
7191
  </td>
7200
7192
  <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>
7201
- </tr></table>
7193
+ </tr></table>
7202
7194
  </div>
7203
7195
  <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>
7204
7196
  <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
7205
7197
  the Nginx init script described in the <a href="http://www.modrails.com/documentation/Users%20guide%20Nginx.html">Phusion Passenger Users Guide, Nginx version</a>,
7206
7198
  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>
7207
7199
  <div class="admonitionblock">
7208
- <table><tr>
7200
+ <table><tr>
7209
7201
  <td class="icon">
7210
- <img src="./images/icons/note.png" alt="Note">
7202
+ <img src="./images/icons/note.png" alt="Note">
7211
7203
  </td>
7212
7204
  <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>
7213
- </tr></table>
7205
+ </tr></table>
7214
7206
  </div>
7215
7207
  </div>
7216
7208
  <div class="sect3">
@@ -7239,7 +7231,7 @@ PATH=/usr/bin:/usr/local/bin
7239
7231
  <div class="sect3">
7240
7232
  <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-478vyt" data-anchor="env_vars_passenger_apps">14.3.5. Phusion Passenger-served apps</h4>
7241
7233
  <div class="paragraph"><p>You can pass environment variables to Phusion Passenger-served apps through various methods:</p></div>
7242
- <div class="ulist"><ul>
7234
+ <div class="ulist"><ul>
7243
7235
  <li>
7244
7236
  <p>
7245
7237
  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.
@@ -7996,5 +7988,5 @@ Mizuho.topicListReceived = $.proxy(function(result) {
7996
7988
  $(document).ready(Mizuho.initializeCommenting);
7997
7989
 
7998
7990
  </script>
7999
- </body>
7991
+ </body>
8000
7992
  </html>