passenger 4.0.23 → 4.0.24

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 (54) hide show
  1. data.tar.gz.asc +7 -7
  2. data/NEWS +17 -0
  3. data/bin/passenger-config +3 -0
  4. data/bin/passenger-install-apache2-module +1 -1
  5. data/bin/passenger-install-nginx-module +1 -1
  6. data/build/integration_tests.rb +5 -3
  7. data/debian.template/control.template +6 -4
  8. data/doc/Users guide Apache.idmap.txt +9 -5
  9. data/doc/Users guide Apache.txt +38 -3
  10. data/doc/Users guide Nginx.idmap.txt +58 -54
  11. data/doc/Users guide Nginx.txt +126 -63
  12. data/doc/Users guide Standalone.idmap.txt +19 -15
  13. data/doc/Users guide Standalone.txt +92 -0
  14. data/doc/users_guide_snippets/environment_variables.txt +11 -0
  15. data/doc/users_guide_snippets/installation.txt +8 -8
  16. data/doc/users_guide_snippets/troubleshooting/default.txt +12 -4
  17. data/ext/apache2/Configuration.cpp +0 -10
  18. data/ext/apache2/Configuration.hpp +0 -3
  19. data/ext/apache2/ConfigurationCommands.cpp +18 -0
  20. data/ext/apache2/ConfigurationFields.hpp +12 -6
  21. data/ext/apache2/ConfigurationFields.hpp.erb +10 -5
  22. data/ext/apache2/ConfigurationSetters.cpp +27 -0
  23. data/ext/apache2/CreateDirConfig.cpp +3 -0
  24. data/ext/apache2/Hooks.cpp +15 -74
  25. data/ext/apache2/MergeDirConfig.cpp +21 -0
  26. data/ext/apache2/SetHeaders.cpp +8 -0
  27. data/ext/common/ApplicationPool2/Group.h +1 -1
  28. data/ext/common/ApplicationPool2/Implementation.cpp +22 -5
  29. data/ext/common/ApplicationPool2/Options.h +10 -1
  30. data/ext/common/ApplicationPool2/Pool.h +4 -0
  31. data/ext/common/Constants.h +4 -2
  32. data/ext/common/agents/HelperAgent/RequestHandler.h +1 -0
  33. data/ext/nginx/CacheLocationConfig.c +20 -0
  34. data/ext/nginx/ConfigurationCommands.c +10 -0
  35. data/ext/nginx/ConfigurationFields.h +2 -0
  36. data/ext/nginx/CreateLocationConfig.c +5 -0
  37. data/ext/nginx/MergeLocationConfig.c +6 -0
  38. data/ext/nginx/config +14 -14
  39. data/lib/phusion_passenger.rb +1 -1
  40. data/lib/phusion_passenger/apache2/config_options.rb +23 -0
  41. data/lib/phusion_passenger/constants.rb +3 -1
  42. data/lib/phusion_passenger/nginx/config_options.rb +4 -0
  43. data/lib/phusion_passenger/platform_info/operating_system.rb +2 -0
  44. data/lib/phusion_passenger/platform_info/ruby.rb +24 -0
  45. data/lib/phusion_passenger/standalone/app_finder.rb +65 -25
  46. data/lib/phusion_passenger/standalone/command.rb +1 -1
  47. data/lib/phusion_passenger/standalone/start_command.rb +6 -5
  48. data/resources/templates/installer_common/run_installer_as_root.txt.erb +4 -1
  49. data/resources/templates/standalone/config.erb +1 -1
  50. data/test/cxx/ApplicationPool2/PoolTest.cpp +18 -0
  51. metadata +13 -5
  52. metadata.gz.asc +7 -7
  53. checksums.yaml +0 -15
  54. checksums.yaml.gz.asc +0 -12
data.tar.gz.asc CHANGED
@@ -2,11 +2,11 @@
2
2
  Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
3
3
  Comment: GPGTools - http://gpgtools.org
4
4
 
5
- iQEcBAABAgAGBQJSc3k/AAoJECrHRaUKISqM9I4IAI8VFAa5vgqAzoQjbV36YBCS
6
- inElj7A0NH/bEOqcFNmu2B3kn4GVUn72/zldo/gbhCJWEVpwNYIwBGUjsc8gQjwY
7
- 6bXWtf8gjuHbu/z9ZSTacJBf9faLD0tRiYre9qBd4cWdh/tC85vC57nnHMcVwsE4
8
- HGd1BBmVDD0dB3J+bOBclLFuQ1OCqXFa3uNtxZThqtNfwcohp4eslmBsGPvFRhsK
9
- Di8lKSr/ATa/vXvbCsm2+v4ybREBWRZQyYChdo4FhPp6NxJT2f/CaOWEKwWphr9g
10
- onhfcsC316G3ywJb4D+2yF6n3ZZIcQWPwLMqRsq6K704o/NRKC4xEAnYGI95nMI=
11
- =//tM
5
+ iQEcBAABAgAGBQJShLLBAAoJECrHRaUKISqM1uUH/RdBRvtxskGHHdZszBUNQvXT
6
+ SfE8B2oFFPLQwLEv/xLrkT+38lZZmRSFUsTdC5oeddByz8mKEKmD8pTQ2KbqpeEO
7
+ isWz9EClNxKdKrLEUiSBP/sHFM6V4uaMbzZ5h85gwrINEidNG+ovBoxLOErraiDV
8
+ 0iX26Sc3QpSD9sWrY+ZtrZIs8wWjzRq0cpRh4QtMe19K2fzUe3TBlcsJDY4bcI3L
9
+ 4lE/Ufwm+5yh8I5IgvTNkxxmA05FDJN7Jh8h/jwHbKxWX4/CqNADqaKvfO9VqXYd
10
+ jffewfennXjyGYJ5K3GvBZ5G5UUOXK+UDTSoRtYrDt3ctP6ylXGOLe5m05JznR0=
11
+ =o6KQ
12
12
  -----END PGP SIGNATURE-----
data/NEWS CHANGED
@@ -1,3 +1,20 @@
1
+ Release 4.0.24
2
+ --------------
3
+
4
+ * Introduced the `PassengerNodejs` (Apache) and `passenger_nodejs` (Nginx)
5
+ configuration options.
6
+ * [Apache] Introduced the `PassengerErrorOverride` option, so that HTTP error
7
+ responses generated by applications can be intercepted by Apache and customized
8
+ using the `ErrorDocument` directive.
9
+ * [Standalone] It is now possible to specify some configuration options in
10
+ a configuration file `passenger-standalone.json`. When Passenger Standalone
11
+ is used in Mass Deployment mode, this configuration file can be used to customize
12
+ settings on a per-application basis.
13
+ * [Enterprise] Fixed a potential crash when a rolling restart is triggered
14
+ while a process is already shutting down.
15
+ * [Enterprise] Fixed Mass Deployment support for Node.js and Meteor.
16
+
17
+
1
18
  Release 4.0.23
2
19
  --------------
3
20
 
@@ -47,6 +47,7 @@ def help
47
47
  puts " --make-locations-ini Generate a locations.ini based on the current install paths."
48
48
  puts " --detect-apache2 Autodetect Apache installations."
49
49
  puts " --ruby-command Print the correct command for invoking the Ruby interpreter."
50
+ puts " --ruby-libdir Show Phusion Passenger's Ruby library directory."
50
51
  puts " --rubyext-compat-id Print the Ruby extension binary compatibility ID."
51
52
  puts " --cxx-compat-id Print the C++ binary compatibility ID."
52
53
  puts " --version Show version number."
@@ -137,6 +138,8 @@ when "--ruby-command"
137
138
  puts
138
139
  puts "## Notes for RVM users"
139
140
  puts "Do you want to know which command to use for a different Ruby interpreter? 'rvm use' that Ruby interpreter, then re-run 'passenger-config --ruby-command'."
141
+ when "--ruby-libdir"
142
+ puts PhusionPassenger.ruby_libdir
140
143
  when "--rubyext-compat-id"
141
144
  require 'phusion_passenger/platform_info/binary_compatibility'
142
145
  puts PhusionPassenger::PlatformInfo.ruby_extension_binary_compatibility_id
@@ -208,7 +208,7 @@ private
208
208
  render_template 'installer_common/run_installer_as_root',
209
209
  :dir => PhusionPassenger.source_root,
210
210
  :sudo => PhusionPassenger::PlatformInfo.ruby_sudo_command,
211
- :sudo_e => "#{PhusionPassenger::PlatformInfo.ruby_sudo_command} -E",
211
+ :sudo_s_e => PhusionPassenger::PlatformInfo.ruby_sudo_shell_command("-E"),
212
212
  :ruby => PhusionPassenger::PlatformInfo.ruby_command,
213
213
  :installer => "#{PhusionPassenger.bin_dir}/passenger-install-apache2-module #{ORIG_ARGV.join(' ')}"
214
214
  end
@@ -367,7 +367,7 @@ private
367
367
  render_template 'installer_common/run_installer_as_root',
368
368
  :dir => dir,
369
369
  :sudo => PhusionPassenger::PlatformInfo.ruby_sudo_command,
370
- :sudo_e => "#{PhusionPassenger::PlatformInfo.ruby_sudo_command} -E",
370
+ :sudo_s_e => PhusionPassenger::PlatformInfo.ruby_sudo_shell_command("-E"),
371
371
  :ruby => PhusionPassenger::PlatformInfo.ruby_command,
372
372
  :installer => "#{PhusionPassenger.bin_dir}/passenger-install-nginx-module #{ORIG_ARGV.join(' ')}"
373
373
  end
@@ -47,9 +47,11 @@ task 'test:integration:nginx' => dependencies do
47
47
  if PlatformInfo.rspec.nil?
48
48
  abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo.ruby_command}'. Please install it."
49
49
  else
50
- Dir.chdir("test") do
51
- ruby "#{PlatformInfo.rspec} -c -f s integration_tests/nginx_tests.rb"
50
+ command = "#{PlatformInfo.rspec} -c -f s integration_tests/nginx_tests.rb"
51
+ if boolean_option('SUDO')
52
+ command = "#{PlatformInfo.ruby_sudo_command} -E #{command}"
52
53
  end
54
+ sh "cd test && #{command}"
53
55
  end
54
56
  end
55
57
 
@@ -60,7 +62,7 @@ task 'test:integration:standalone' => dependencies do
60
62
  abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo.ruby_command}'. Please install it."
61
63
  else
62
64
  Dir.chdir("test") do
63
- ruby "#{PlatformInfo.rspec} -c -f s integration_tests/standalone_tests.rb"
65
+ #ruby "#{PlatformInfo.rspec} -c -f s integration_tests/standalone_tests.rb"
64
66
  end
65
67
  end
66
68
  end
@@ -6,10 +6,10 @@ Uploaders: Phusion <info@phusion.nl>, Hongli Lai <hongli@phusion.nl>
6
6
  Build-Depends: debhelper (>= 7.0.50~), rake,
7
7
  ruby1.8, ruby1.8-dev, rubygems1.8,
8
8
  ruby1.9.1, ruby1.9.1-dev,
9
- apache2-mpm-worker | apache2-mpm, apache2-threaded-dev,
10
9
  #if is_distribution?('<= lucid')
11
10
  rubygems1.9,
12
11
  #endif
12
+ apache2-mpm-worker | apache2-mpm, apache2-threaded-dev,
13
13
  #if is_distribution?('>= precise') || is_distribution?('>= wheezy')
14
14
  libev-dev (>= 1:4.0.0),
15
15
  #endif
@@ -22,8 +22,9 @@ XS-Ruby-Versions: all
22
22
 
23
23
  Package: passenger
24
24
  Architecture: any
25
- Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter,
26
- rubygems (>= 1.2),
25
+ Depends: ${shlibs:Depends}, ${misc:Depends},
26
+ ruby2.0 | ruby1.9.1 | ruby1.8 | ruby-interpreter,
27
+ rubygems2.0 | rubygems1.9.1 | rubygems1.9 | rubygems (>= 1.2),
27
28
  #if is_distribution?('<= lucid') || is_distribution?('<= squeeze')
28
29
  librack-ruby,
29
30
  #else
@@ -45,7 +46,8 @@ Description: Rails and Rack support for Apache2 and Nginx
45
46
 
46
47
  Package: passenger-dev
47
48
  Architecture: any
48
- Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter,
49
+ Depends: ${shlibs:Depends}, ${misc:Depends},
50
+ ruby2.0 | ruby1.9.1 | ruby1.8 | ruby-interpreter,
49
51
  passenger (= ${binary:Version})
50
52
  Suggests: python
51
53
  Replaces: ruby-passenger-dev
@@ -130,13 +130,15 @@
130
130
 
131
131
  6.3.3. PassengerPython <filename> => passengerpython-filename--1ssesv3
132
132
 
133
- 6.3.4. PassengerAppRoot <path/to/root> => passengerapproot-path-to-root--uf24yd
133
+ 6.3.4. PassengerNodejs <filename> => passengernodejs-filename--2mjb1j
134
134
 
135
- 6.3.5. PassengerRestartDir <directory> => passengerrestartdir-directory--1fmhmv0
135
+ 6.3.5. PassengerAppRoot <path/to/root> => passengerapproot-path-to-root--uf24yd
136
136
 
137
- 6.3.6. PassengerRollingRestarts <on|off> => passengerrollingrestarts
137
+ 6.3.6. PassengerRestartDir <directory> => passengerrestartdir-directory--1fmhmv0
138
138
 
139
- 6.3.7. PassengerResistDeploymentErrors <on|off> => passengerresistdeploymenterrors
139
+ 6.3.7. PassengerRollingRestarts <on|off> => passengerrollingrestarts
140
+
141
+ 6.3.8. PassengerResistDeploymentErrors <on|off> => passengerresistdeploymenterrors
140
142
 
141
143
  6.4. Process spawning options => process-spawning-options-v2vscm
142
144
 
@@ -194,7 +196,9 @@
194
196
 
195
197
  6.7.1. PassengerBufferResponse <on|off> => passengerbufferresponse-on-off--1y7ilka
196
198
 
197
- 6.7.2. PassengerMaxRequestQueueSize <number> => passenger-max-request-queue-size-number--1f1uocd
199
+ 6.7.2. PassengerErrorOverride <on|off> => passengererroroverride-on-off--1pq9nez
200
+
201
+ 6.7.3. PassengerMaxRequestQueueSize <number> => passenger-max-request-queue-size-number--1f1uocd
198
202
 
199
203
  6.8. Compatibility options => compatibility-options-8jve5a
200
204
 
@@ -534,7 +534,7 @@ In each place, it may be specified at most once. The default value is 'on'.
534
534
 
535
535
  [[PassengerRuby]]
536
536
  ==== PassengerRuby <filename>
537
- The `PassengerDefaultRuby` and `PassengerRuby` directives specify the Ruby interpreter to use. Similarly, the `PassengerPython` directive is for specifying the Python interpreter.
537
+ The `PassengerDefaultRuby` and `PassengerRuby` directives specify the Ruby interpreter to use. Similarly, the `PassengerPython` and `PassengerNodejs` directives are for specifying the Python interpreter and the Node.js command, respectively.
538
538
 
539
539
  The relationship between `PassengerDefaultRuby` and `PassengerRuby` is as follows:
540
540
 
@@ -548,15 +548,17 @@ It is okay if `PassengerDefaultRuby` refers to a different Ruby interpreter than
548
548
 
549
549
  The reason why `PassengerDefaultRuby` exists at all is because limitations in the Apache API prevents us from implementing the same behavior using only the `PassengerRuby` directive.
550
550
 
551
- There is no `PassengerDefaultPython` because there are no Phusion Passenger tools written in Python. As such, having `PassengerPython` is enough.
551
+ There is no `PassengerDefaultPython` etc because there are no Phusion Passenger tools written in Python. As such, having `PassengerPython` is enough.
552
552
 
553
- The following example illustrates how it works and how you can use these options to specify different Ruby/Python interpreters for different web apps.
553
+ The following example illustrates how it works and how you can use these options to specify different interpreters for different web apps.
554
554
 
555
555
  ------------------------------
556
556
  # Use Ruby 1.8.7 by default.
557
557
  PassengerDefaultRuby /usr/bin/ruby1.8
558
558
  # Use Python 2.6 by default.
559
559
  PassengerPython /usr/bin/python2.6
560
+ # Use /usr/bin/node by default.
561
+ PassengerNodejs /usr/bin/node;
560
562
 
561
563
  <VirtualHost *:80>
562
564
  # This Rails web app will use Ruby 1.8.7
@@ -595,6 +597,12 @@ include::users_guide_snippets/since_version.txt[]
595
597
 
596
598
  This option allows one to specify the Python interpreter to use. See <<PassengerRuby,PassengerRuby>> for more information. The default value is 'python', meaning that the Python interpreter will be looked up according to the `PATH` environment variable.
597
599
 
600
+ ==== PassengerNodejs <filename>
601
+ :version: 4.0.24
602
+ include::users_guide_snippets/since_version.txt[]
603
+
604
+ This option allows one to specify the Node.js command to use. See <<PassengerRuby,PassengerRuby>> for more information. The default value is 'node', meaning that the Node.js command will be looked up according to the `PATH` environment variable.
605
+
598
606
  [[PassengerAppRoot]]
599
607
  ==== PassengerAppRoot <path/to/root>
600
608
  By default, Phusion Passenger assumes that the application's root directory
@@ -1628,6 +1636,26 @@ The <<PassengerBufferResponse,PassengerBufferResponse>> directive should be turn
1628
1636
  if responses can be huge. Because entire responses are buffered in memory when turned on.
1629
1637
  =====================================================
1630
1638
 
1639
+ [[PassengerErrorOverride]]
1640
+ ==== PassengerErrorOverride <on|off> ====
1641
+ :version: 4.0.24
1642
+ include::users_guide_snippets/since_version.txt[]
1643
+
1644
+ Decides whether Apache will intercept and handle responses with HTTP status codes of 400 and higher. This directive is useful where you want to have a common look and feel on the error pages seen by the end user. This also allows for included files (via mod_include's SSI) to get the error code and act accordingly (default behavior would display the error page of the proxied server, turning this on shows the SSI Error message).
1645
+
1646
+ This directive does not affect the processing of informational (1xx), normal success (2xx), or redirect (3xx) responses.
1647
+
1648
+ By default, all responses are sent as-is from the application or from the Phusion Passenger core. If you turn this option on then Apache will be able to handle such responses using the Apache `ErrorDocument` option.
1649
+
1650
+ This option may occur in the following places:
1651
+
1652
+ * In the global server configuration.
1653
+ * In a virtual host configuration block.
1654
+ * In a `<Directory>` or `<Location>` block.
1655
+ * In '.htaccess'.
1656
+
1657
+ In each place, it may be specified at most once. The default value is 'off'.
1658
+
1631
1659
  [[PassengerMaxRequestQueueSize]]
1632
1660
  ==== PassengerMaxRequestQueueSize <number> ====
1633
1661
  :version: 4.0.15
@@ -1637,6 +1665,13 @@ When all application processes are already handling their maximum number of conc
1637
1665
 
1638
1666
  A value of 0 means that the queue is unbounded.
1639
1667
 
1668
+ You may combine this with <<PassengerErrorOverride,PassengerErrorOverride>> and `ErrorDocument` to set a custom error page whenever the queue is full. In the following example, Apache will serve /error503.html whenever the queue is full:
1669
+
1670
+ ---------------------------------
1671
+ PassengerErrorOverride on
1672
+ ErrorDocument 504 /error504.html
1673
+ ---------------------------------
1674
+
1640
1675
  This option may occur in the following places:
1641
1676
 
1642
1677
  * In the global server configuration.
@@ -116,7 +116,9 @@
116
116
 
117
117
  5.2. Deploying to a virtual host’s root => deploying-to-a-virtual-host-s-root-1chcpbj
118
118
 
119
- 5.3. Redeploying (restarting the WSGI application) => redeploying-restarting-the-wsgi-application--10zdh2k
119
+ 5.3. Deploying to a sub URI => deploying-to-a-sub-uri-5v6zmg
120
+
121
+ 5.4. Redeploying (restarting the WSGI application) => redeploying-restarting-the-wsgi-application--10zdh2k
120
122
 
121
123
  6. Configuring Phusion Passenger => configuring-phusion-passenger-1g1svey
122
124
 
@@ -126,111 +128,113 @@
126
128
 
127
129
  6.3. passenger_python <filename> => passenger-python-filename--14p554
128
130
 
129
- 6.4. passenger_app_root <path/to/root> => passenger-app-root-path-to-root--1dbudc6
131
+ 6.4. passenger_nodejs <filename> => passenger-nodejs-filename--16hzjsv
132
+
133
+ 6.5. passenger_app_root <path/to/root> => passenger-app-root-path-to-root--1dbudc6
130
134
 
131
- 6.5. passenger_spawn_method <string> => passenger-spawn-method-string--1sc6njl
135
+ 6.6. passenger_spawn_method <string> => passenger-spawn-method-string--1sc6njl
132
136
 
133
- 6.6. passenger_load_shell_envvars <on|off> => passenger-load-shell-envvars-on-off--fw5u4l
137
+ 6.7. passenger_load_shell_envvars <on|off> => passenger-load-shell-envvars-on-off--fw5u4l
134
138
 
135
- 6.7. passenger_rolling_restarts <on|off> => passenger-rolling-restarts
139
+ 6.8. passenger_rolling_restarts <on|off> => passenger-rolling-restarts
136
140
 
137
- 6.8. passenger_resist_deployment_errors <on|off> => passenger-resist-deployment-errors-on-off--k9yf1
141
+ 6.9. passenger_resist_deployment_errors <on|off> => passenger-resist-deployment-errors-on-off--k9yf1
138
142
 
139
- 6.9. passenger_temp_dir <directory> => passenger-temp-dir-directory--1t3opri
143
+ 6.10. passenger_temp_dir <directory> => passenger-temp-dir-directory--1t3opri
140
144
 
141
- 6.10. passenger_fly_with <socket filename> => passenger-fly-with-socket-filename--1amd1xn
145
+ 6.11. passenger_fly_with <socket filename> => passenger-fly-with-socket-filename--1amd1xn
142
146
 
143
- 6.11. Important deployment options => important-deployment-options-av567
147
+ 6.12. Important deployment options => important-deployment-options-av567
144
148
 
145
- 6.11.1. passenger_enabled <on|off> => passenger-enabled-on-off--1rpb2t7
149
+ 6.12.1. passenger_enabled <on|off> => passenger-enabled-on-off--1rpb2t7
146
150
 
147
- 6.11.2. passenger_base_uri <uri> => passenger-base-uri-uri--1xtuo50
151
+ 6.12.2. passenger_base_uri <uri> => passenger-base-uri-uri--1xtuo50
148
152
 
149
- 6.12. Connection handling options => connection-handling-options-8jgq90
153
+ 6.13. Connection handling options => connection-handling-options-8jgq90
150
154
 
151
- 6.12.1. passenger_ignore_client_abort <on|off> => passenger-ignore-client-abort
155
+ 6.13.1. passenger_ignore_client_abort <on|off> => passenger-ignore-client-abort
152
156
 
153
- 6.12.2. passenger_set_cgi_param <CGI environment name> <value> => passenger-set-cgi-param-cgi-environment-name-value--rx9gc0
157
+ 6.13.2. passenger_set_cgi_param <CGI environment name> <value> => passenger-set-cgi-param-cgi-environment-name-value--rx9gc0
154
158
 
155
- 6.12.3. passenger_pass_header <header name> => passenger-pass-header-header-name--1cg31je
159
+ 6.13.3. passenger_pass_header <header name> => passenger-pass-header-header-name--1cg31je
156
160
 
157
- 6.12.4. passenger_buffer_response <on|off> => passenger-buffer-response
161
+ 6.13.4. passenger_buffer_response <on|off> => passenger-buffer-response
158
162
 
159
- 6.12.5. passenger_buffer_size => passenger-buffer-size-1jfkq87
163
+ 6.13.5. passenger_buffer_size => passenger-buffer-size-1jfkq87
160
164
 
161
- 6.12.6. passenger_buffers => passenger-busy-buffers
165
+ 6.13.6. passenger_buffers => passenger-busy-buffers
162
166
 
163
- 6.12.7. passenger_busy_buffer_size => passenger-busy-buffer-size-124sj61
167
+ 6.13.7. passenger_busy_buffer_size => passenger-busy-buffer-size-124sj61
164
168
 
165
- 6.12.8. passenger_intercept_errors <on|off> => passenger-intercept-errors-1uvcb9x
169
+ 6.13.8. passenger_intercept_errors <on|off> => passenger-intercept-errors-1uvcb9x
166
170
 
167
- 6.12.9. passenger_max_request_queue_size <number> => passenger-max-request-queue-size-number--i0te1b
171
+ 6.13.9. passenger_max_request_queue_size <number> => passenger-max-request-queue-size-number--i0te1b
168
172
 
169
- 6.12.10. passenger_request_queue_overflow_status_code <code> => passenger-request-queue-overflow-status-code-code--1wcwuxl
173
+ 6.13.10. passenger_request_queue_overflow_status_code <code> => passenger-request-queue-overflow-status-code-code--1wcwuxl
170
174
 
171
- 6.13. Security options => security-options-1bv93g4
175
+ 6.14. Security options => security-options-1bv93g4
172
176
 
173
- 6.13.1. passenger_user_switching <on|off> => passenger-user-switching-on-off--1p37u3l
177
+ 6.14.1. passenger_user_switching <on|off> => passenger-user-switching-on-off--1p37u3l
174
178
 
175
- 6.13.2. passenger_user <username> => passenger-user-username--b06ur7
179
+ 6.14.2. passenger_user <username> => passenger-user-username--b06ur7
176
180
 
177
- 6.13.3. passenger_group <group name> => passenger-user-group-name--1fco4j7
181
+ 6.14.3. passenger_group <group name> => passenger-user-group-name--1fco4j7
178
182
 
179
- 6.13.4. passenger_default_user <username> => passenger-default-user-username--1h6cdmf
183
+ 6.14.4. passenger_default_user <username> => passenger-default-user-username--1h6cdmf
180
184
 
181
- 6.13.5. Passenger_default_group <group name> => passenger-default-group-group-name--1qxn2qa
185
+ 6.14.5. Passenger_default_group <group name> => passenger-default-group-group-name--1qxn2qa
182
186
 
183
- 6.13.6. passenger_show_version_in_header <on|off> => passenger-show-version-in-header-on-off--2h49av
187
+ 6.14.6. passenger_show_version_in_header <on|off> => passenger-show-version-in-header-on-off--2h49av
184
188
 
185
- 6.13.7. passenger_friendly_error_pages <on|off> => passenger-friendly-error-pages-on-off--1ti1a0e
189
+ 6.14.7. passenger_friendly_error_pages <on|off> => passenger-friendly-error-pages-on-off--1ti1a0e
186
190
 
187
- 6.14. Resource control and optimization options => resource-control-and-optimization-options-xd7evs
191
+ 6.15. Resource control and optimization options => resource-control-and-optimization-options-xd7evs
188
192
 
189
- 6.14.1. passenger_max_pool_size <integer> => passenger-max-pool-size-integer--3jzefs
193
+ 6.15.1. passenger_max_pool_size <integer> => passenger-max-pool-size-integer--3jzefs
190
194
 
191
- 6.14.2. passenger_min_instances <integer> => passenger-min-instances-integer--uclykt
195
+ 6.15.2. passenger_min_instances <integer> => passenger-min-instances-integer--uclykt
192
196
 
193
- 6.14.3. passenger_max_instances <integer> => passenger-max-instances
197
+ 6.15.3. passenger_max_instances <integer> => passenger-max-instances
194
198
 
195
- 6.14.4. passenger_max_instances_per_app <integer> => passenger-max-instances-per-app-integer--1xhbbne
199
+ 6.15.4. passenger_max_instances_per_app <integer> => passenger-max-instances-per-app-integer--1xhbbne
196
200
 
197
- 6.14.5. passenger_pool_idle_time <integer> => passenger-pool-idle-time-integer--xcw65o
201
+ 6.15.5. passenger_pool_idle_time <integer> => passenger-pool-idle-time-integer--xcw65o
198
202
 
199
- 6.14.6. passenger_max_preloader_idle_time <integer> => rails-app-spawner-idle-time-integer--1xjqe4b
203
+ 6.15.6. passenger_max_preloader_idle_time <integer> => rails-app-spawner-idle-time-integer--1xjqe4b
200
204
 
201
- 6.14.7. passenger_start_timeout <seconds> => passenger-start-timeout-seconds--8xn504
205
+ 6.15.7. passenger_start_timeout <seconds> => passenger-start-timeout-seconds--8xn504
202
206
 
203
- 6.14.8. passenger_concurrency_model <process|thread> => passenger-concurrency-model-process-thread--brcvkk
207
+ 6.15.8. passenger_concurrency_model <process|thread> => passenger-concurrency-model-process-thread--brcvkk
204
208
 
205
- 6.14.9. passenger_thread_count <number> => passenger-thread-count-number--1kd6ffy
209
+ 6.15.9. passenger_thread_count <number> => passenger-thread-count-number--1kd6ffy
206
210
 
207
- 6.14.10. passenger_max_requests <integer> => passenger-max-requests-integer--sgzint
211
+ 6.15.10. passenger_max_requests <integer> => passenger-max-requests-integer--sgzint
208
212
 
209
- 6.14.11. passenger_max_request_time <seconds> => passenger-max-request-time-seconds--1htog2g
213
+ 6.15.11. passenger_max_request_time <seconds> => passenger-max-request-time-seconds--1htog2g
210
214
 
211
- 6.14.12. passenger_memory_limit <integer> => passenger-memory-limit-integer--1ry7dwx
215
+ 6.15.12. passenger_memory_limit <integer> => passenger-memory-limit-integer--1ry7dwx
212
216
 
213
- 6.14.13. passenger_pre_start <url> => passenger-pre-start-url--npldeb
217
+ 6.15.13. passenger_pre_start <url> => passenger-pre-start-url--npldeb
214
218
 
215
- 6.15. Logging and debugging options => logging-and-debugging-options-14e91ni
219
+ 6.16. Logging and debugging options => logging-and-debugging-options-14e91ni
216
220
 
217
- 6.15.1. passenger_log_level <integer> => passenger-log-level-integer--17snhon
221
+ 6.16.1. passenger_log_level <integer> => passenger-log-level-integer--17snhon
218
222
 
219
- 6.15.2. passenger_debug_log_file <filename> => passenger-debug-log-file-filename--21ubaj
223
+ 6.16.2. passenger_debug_log_file <filename> => passenger-debug-log-file-filename--21ubaj
220
224
 
221
- 6.15.3. passenger_debugger <on|off> => passenger-debugger-on-off--1wkuq85
225
+ 6.16.3. passenger_debugger <on|off> => passenger-debugger-on-off--1wkuq85
222
226
 
223
- 6.16. Ruby on Rails-specific options => ruby-on-rails-specific-options-12vfokt
227
+ 6.17. Ruby on Rails-specific options => ruby-on-rails-specific-options-12vfokt
224
228
 
225
- 6.16.1. rails_env <string> => rails-env-string--jlh7v9
229
+ 6.17.1. rails_env <string> => rails-env-string--jlh7v9
226
230
 
227
- 6.17. Rack and Rails >= 3 specific options => rack-specific-options-13yvdxs
231
+ 6.18. Rack and Rails >= 3 specific options => rack-specific-options-13yvdxs
228
232
 
229
- 6.17.1. rack_env <string> => rack-env-string--tqmrt0
233
+ 6.18.1. rack_env <string> => rack-env-string--tqmrt0
230
234
 
231
- 6.18. Deprecated options => deprecated-options-1dtzo0g
235
+ 6.19. Deprecated options => deprecated-options-1dtzo0g
232
236
 
233
- 6.18.1. rails_spawn_method => rails-spawn-method-17vdnpt
237
+ 6.19.1. rails_spawn_method => rails-spawn-method-17vdnpt
234
238
 
235
239
  7. Troubleshooting => troubleshooting-1pt0c76
236
240
 
@@ -67,7 +67,7 @@ Then restart Nginx. The application has now been deployed.
67
67
  [[deploying_rails_to_sub_uri]]
68
68
  === Deploying to a sub URI ===
69
69
 
70
- Suppose that you already have a 'server' virtual host entry:
70
+ Suppose that you already have a virtual host for the application `/websites/phusion`:
71
71
 
72
72
  -------------------------------------------
73
73
  http {
@@ -77,23 +77,26 @@ http {
77
77
  listen 80;
78
78
  server_name www.phusion.nl;
79
79
  root /websites/phusion;
80
+ passenger_enabled on;
80
81
  }
81
82
 
82
83
  ...
83
84
  }
84
85
  -------------------------------------------
85
86
 
86
- And you want your Ruby on Rails application to be accessible from the URL
87
- 'http://www.phusion.nl/rails'.
87
+ And you want your Rails application, located in `/websites/rails`, to be accessible from the URL
88
+ 'http://www.phusion.nl/subapp'.
88
89
 
89
- To do this, make a symlink in the virtual host's document root, and have it
90
- point to your Ruby on Rails application's 'public' folder. For example:
91
- -------------------------------------------
92
- ln -s /webapps/mycook/public /websites/phusion/rails
93
- -------------------------------------------
90
+ To do this, you need to perform the following:
91
+
92
+ 1. Create a `location <SUBURI>` block.
93
+ 2. Inside the location block, set `passenger_base_uri <SUBURI>`.
94
+ 3. Inside the location block, set `alias <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>`.
95
+ 4. Inside the location block, set `passenger_app_root <PATH TO YOUR APPLICATION ROOT>`.
96
+ 5. Inside the location block, re-specify `passenger_enabled on`.
97
+
98
+ Here is an example:
94
99
 
95
- Next, set 'passenger_enabled on' and add a <<PassengerBaseURI,passenger_base_uri>>
96
- option to the 'server' block:
97
100
  -------------------------------------------
98
101
  http {
99
102
  ...
@@ -102,28 +105,21 @@ http {
102
105
  listen 80;
103
106
  server_name www.phusion.nl;
104
107
  root /websites/phusion;
105
- passenger_enabled on; # <--- These lines have
106
- passenger_base_uri /rails; # <--- been added.
108
+
109
+ # This block has been added.
110
+ location /subapp {
111
+ passenger_base_uri /subapp;
112
+ alias /websites/rails/public; # <-- be sure to point to 'public'!
113
+ passenger_app_root /websites/rails;
114
+ passenger_enabled on;
115
+ }
107
116
  }
108
117
 
109
118
  ...
110
119
  }
111
120
  -------------------------------------------
112
- Then restart Nginx. The application has now been deployed.
113
121
 
114
- [TIP]
115
- ======================================
116
- You can deploy multiple Rails applications under a virtual host, by specifying
117
- <<PassengerBaseURI,passenger_base_uri>> multiple times. For example:
118
- ---------------------------------
119
- server {
120
- ...
121
- passenger_base_uri /app1;
122
- passenger_base_uri /app2;
123
- passenger_base_uri /app3;
124
- }
125
- ---------------------------------
126
- ======================================
122
+ Then restart Nginx. The application has now been deployed on the sub-URI.
127
123
 
128
124
  === Redeploying (restarting the Ruby on Rails application) ===
129
125
 
@@ -262,7 +258,7 @@ Then restart Nginx. The application has now been deployed.
262
258
  [[deploying_rack_to_sub_uri]]
263
259
  === Deploying to a sub URI ===
264
260
 
265
- Suppose that you already have a virtual host:
261
+ Suppose that you already have a virtual host for the application `/websites/phusion`:
266
262
 
267
263
  -------------------------------------------
268
264
  http {
@@ -279,17 +275,19 @@ http {
279
275
  }
280
276
  -------------------------------------------
281
277
 
282
- And you want your Rack application to be accessible from the URL
283
- 'http://www.phusion.nl/rack'.
278
+ And you want your Rack application, located in `/websites/rack`, to be accessible from the URL
279
+ 'http://www.phusion.nl/subapp'.
284
280
 
285
- To do this, make a symlink in the virtual host's document root, and have it
286
- point to your Rack application's 'public' folder. For example:
287
- -------------------------------------------
288
- ln -s /webapps/rackapp/public /websites/phusion/rack
289
- -------------------------------------------
281
+ To do this, you need to perform the following:
282
+
283
+ 1. Create a `location <SUBURI>` block.
284
+ 2. Inside the location block, set `passenger_base_uri <SUBURI>`.
285
+ 3. Inside the location block, set `alias <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>`.
286
+ 4. Inside the location block, set `passenger_app_root <PATH TO YOUR APPLICATION ROOT>`.
287
+ 5. Inside the location block, re-specify `passenger_enabled on`.
288
+
289
+ Here is an example:
290
290
 
291
- Next, set 'passenger_enabled on' and add a <<PassengerBaseURI,passenger_base_uri>>
292
- option to the 'server' block:
293
291
  -------------------------------------------
294
292
  http {
295
293
  ...
@@ -298,28 +296,20 @@ http {
298
296
  listen 80;
299
297
  server_name www.phusion.nl;
300
298
  root /websites/phusion;
301
- passenger_enabled on; # <--- These lines have
302
- passenger_base_uri /rack; # <--- been added.
299
+
300
+ # This block has been added.
301
+ location /subapp {
302
+ passenger_base_uri /subapp;
303
+ alias /websites/rack/public; # <-- be sure to point to 'public'!
304
+ passenger_app_root /websites/rack;
305
+ passenger_enabled on;
306
+ }
303
307
  }
304
308
 
305
309
  ...
306
310
  }
307
311
  -------------------------------------------
308
- Then restart Nginx. The application has now been deployed.
309
-
310
- [TIP]
311
- ======================================
312
- You can deploy multiple Rack applications under a virtual host, by specifying
313
- <<PassengerBaseURI,passenger_base_uri>> multiple times. For example:
314
- ---------------------------------
315
- server {
316
- ...
317
- passenger_base_uri /app1;
318
- passenger_base_uri /app2;
319
- passenger_base_uri /app3;
320
- }
321
- ---------------------------------
322
- ======================================
312
+ Then restart Nginx. The application has now been deployed on the sub-URI.
323
313
 
324
314
  === Redeploying (restarting the Rack application) ===
325
315
 
@@ -425,6 +415,63 @@ http {
425
415
  -------------------------------------------
426
416
  Then restart Nginx. The application has now been deployed.
427
417
 
418
+ [[deploying_wsgi_to_sub_uri]]
419
+ === Deploying to a sub URI ===
420
+
421
+ Suppose that you already have a virtual host for the application `/websites/phusion`:
422
+
423
+ -------------------------------------------
424
+ http {
425
+ ...
426
+
427
+ server {
428
+ listen 80;
429
+ server_name www.phusion.nl;
430
+ root /websites/phusion;
431
+ passenger_enabled on;
432
+ }
433
+
434
+ ...
435
+ }
436
+ -------------------------------------------
437
+
438
+ And you want your WSGI application, located in `/websites/wsgi`, to be accessible from the URL
439
+ 'http://www.phusion.nl/subapp'.
440
+
441
+ To do this, you need to perform the following:
442
+
443
+ 1. Create a `location <SUBURI>` block.
444
+ 2. Inside the location block, set `passenger_base_uri <SUBURI>`.
445
+ 3. Inside the location block, set `alias <PATH TO YOUR APPLICATION'S PUBLIC DIRECTORY>`.
446
+ 4. Inside the location block, set `passenger_app_root <PATH TO YOUR APPLICATION ROOT>`.
447
+ 5. Inside the location block, re-specify `passenger_enabled on`.
448
+
449
+ Here is an example:
450
+
451
+ -------------------------------------------
452
+ http {
453
+ ...
454
+
455
+ server {
456
+ listen 80;
457
+ server_name www.phusion.nl;
458
+ root /websites/phusion;
459
+
460
+ # This block has been added.
461
+ location /subapp {
462
+ passenger_base_uri /subapp;
463
+ alias /websites/wsgi/public; # <-- be sure to point to 'public'!
464
+ passenger_app_root /websites/wsgi;
465
+ passenger_enabled on;
466
+ }
467
+ }
468
+
469
+ ...
470
+ }
471
+ -------------------------------------------
472
+
473
+ Then restart Nginx. The application has now been deployed on the sub-URI.
474
+
428
475
  === Redeploying (restarting the WSGI application) ===
429
476
 
430
477
  Deploying a new version of a WSGI application is as simple as
@@ -466,7 +513,7 @@ NOTE: This option has no effect when you are using <<flying_passenger,Flying Pas
466
513
 
467
514
  [[PassengerRuby]]
468
515
  === passenger_ruby <filename> ===
469
- The `passenger_ruby` option allows one to specify the Ruby interpreter to use. Similarly, the `passenger_python` option is for specifying the Python interpreter.
516
+ The `passenger_ruby` option allows one to specify the Ruby interpreter to use. Similarly, the `passenger_python` and `passenger_nodejs` options are for specifying the Python interpreter and Node.js commands, respectively.
470
517
 
471
518
  In versions prior to 4.0.0, only a single Ruby version was supported for the entire Nginx instance, so `passenger_ruby` may only occur in the global server configuration. Also, the `passenger_python` option was not supported.
472
519
 
@@ -481,9 +528,9 @@ The `passenger_ruby` in the `http` block - that is, the one that `passenger-inst
481
528
 
482
529
  The `passenger_ruby` directive in the `http` block is also used as the default Ruby interpreter for Ruby web apps. You don't *have* to specify a `passenger_ruby` in the `http` block though, because the default is to use the first `ruby` command found in `$PATH`.
483
530
 
484
- The `passenger_python` option works in a similar manner, but applies to Python instead.
531
+ The `passenger_python` and `passenger_nodejs` options works in a similar manner, but apply to Python and Node.js instead.
485
532
 
486
- You can also override `passenger_ruby` or `passenger_python` in specific contexts if you want to use a different Ruby/Python interpreter for that web app. For example:
533
+ You can also override `passenger_ruby` and other directives in specific contexts if you want to use a different interpreter for that web app. For example:
487
534
 
488
535
  ------------------------------
489
536
  http {
@@ -493,6 +540,8 @@ http {
493
540
  passenger_ruby /usr/bin/ruby1.8;
494
541
  # Use Python 2.6 by default.
495
542
  passenger_python /usr/bin/python2.6;
543
+ # Use /usr/bin/node by default.
544
+ passenger_nodejs /usr/bin/node;
496
545
 
497
546
  server {
498
547
  # This Rails web app will use Ruby 1.8.7
@@ -538,6 +587,12 @@ include::users_guide_snippets/since_version.txt[]
538
587
 
539
588
  This option allows one to specify the Python interpreter to use. See <<PassengerRuby,passenger_ruby>> for more information. The default value is 'python', meaning that the Python interpreter will be looked up according to the `PATH` environment variable.
540
589
 
590
+ === passenger_nodejs <filename> ===
591
+ :version: 4.0.24
592
+ include::users_guide_snippets/since_version.txt[]
593
+
594
+ This option allows one to specify the Node.js command to use. See <<PassengerRuby,passenger_ruby>> for more information. The default value is 'node', meaning that the Node.js command will be looked up according to the `PATH` environment variable.
595
+
541
596
  [[PassengerAppRoot]]
542
597
  === passenger_app_root <path/to/root> ===
543
598
  :version: 4.0.0
@@ -755,9 +810,12 @@ server {
755
810
  [[PassengerBaseURI]]
756
811
  ==== passenger_base_uri <uri> ====
757
812
  Used to specify that the given URI is an distinct application that should
758
- be served by Phusion Passenger. This option can be used for both Rails and
759
- Rack applications. See <<deploying_rack_to_sub_uri,Deploying Rack to a sub URI>>
760
- for an example.
813
+ be served by Phusion Passenger. Please refer to the following sections for
814
+ more information:
815
+
816
+ * <<deploying_rack_to_sub_uri,Deploying Rack to a sub URI>>
817
+ * <<deploying_wsgi_to_sub_uri,Deploying WSGI to a sub URI>>
818
+ * <<deploying_rails_to_sub_uri,Deploying Rails 1 and Rails 2 to a sub URI>>
761
819
 
762
820
  It is allowed to specify this option multiple times. Do this to deploy multiple
763
821
  applications in different sub-URIs under the same virtual host.
@@ -793,12 +851,17 @@ This option may occur in the following places:
793
851
  In each place, it may be specified at most once. The default value is 'off'.
794
852
 
795
853
  ==== passenger_set_cgi_param <CGI environment name> <value> ====
796
- Allows one to define additional CGI environment variables to pass to the backend
797
- application. This is equivalent to ngx_http_fastcgi_module's 'fastcgi_param'
798
- directive, and is comparable to ngx_http_proxy_module's 'proxy_set_header' option.
854
+ Allows one to define additional CGI environment variables to pass to the web
855
+ application. This is comparable to ngx_http_fastcgi_module's 'fastcgi_param'
856
+ directive, and to ngx_http_proxy_module's 'proxy_set_header' option.
799
857
  Nginx variables in the value are interpolated.
800
858
 
801
- For example:
859
+ These variables passed in the following manner:
860
+
861
+ * On every request, in the form of a request variable.
862
+ * During application spawning, in the form of a system environment variable that can be looked up through `getenv()`.
863
+
864
+ Example usage:
802
865
  ------------------------------
803
866
  # Application will see a CGI environment "APP_NAME" with value "my super blog".
804
867
  passenger_set_cgi_param APP_NAME "my super blog";