passenger 2.2.4 → 2.2.5

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 (105) hide show
  1. data/NEWS +137 -0
  2. data/Rakefile +101 -19
  3. data/bin/passenger-install-nginx-module +10 -3
  4. data/bin/passenger-make-enterprisey +1 -1
  5. data/doc/Users guide Apache.html +227 -92
  6. data/doc/Users guide Apache.txt +169 -75
  7. data/doc/Users guide Nginx.html +1 -1
  8. data/doc/cxxapi/Bucket_8h-source.html +1 -1
  9. data/doc/cxxapi/Configuration_8h-source.html +373 -338
  10. data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
  11. data/doc/cxxapi/Hooks_8h-source.html +1 -1
  12. data/doc/cxxapi/annotated.html +1 -1
  13. data/doc/cxxapi/classHooks-members.html +1 -1
  14. data/doc/cxxapi/classHooks.html +2 -2
  15. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
  16. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
  17. data/doc/cxxapi/classes.html +1 -1
  18. data/doc/cxxapi/definitions_8h-source.html +1 -1
  19. data/doc/cxxapi/files.html +1 -1
  20. data/doc/cxxapi/functions.html +1 -1
  21. data/doc/cxxapi/functions_func.html +1 -1
  22. data/doc/cxxapi/graph_legend.html +1 -1
  23. data/doc/cxxapi/group__Configuration.html +1 -1
  24. data/doc/cxxapi/group__Core.html +1 -1
  25. data/doc/cxxapi/group__Hooks.html +1 -1
  26. data/doc/cxxapi/group__Support.html +1 -1
  27. data/doc/cxxapi/main.html +1 -1
  28. data/doc/cxxapi/modules.html +1 -1
  29. data/doc/rdoc/classes/ConditionVariable.html +59 -59
  30. data/doc/rdoc/classes/Exception.html +11 -11
  31. data/doc/rdoc/classes/GC.html +4 -4
  32. data/doc/rdoc/classes/IO.html +14 -14
  33. data/doc/rdoc/classes/PhusionPassenger.html +1 -1
  34. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +8 -8
  35. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +136 -136
  36. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +254 -254
  37. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +61 -61
  38. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +4 -4
  39. data/doc/rdoc/classes/PhusionPassenger/Application.html +14 -14
  40. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +12 -12
  41. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +4 -4
  42. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +12 -12
  43. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +5 -5
  44. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +139 -139
  45. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +61 -56
  46. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +3 -3
  47. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +7 -7
  48. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +15 -15
  49. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +119 -119
  50. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +4 -4
  51. data/doc/rdoc/classes/PhusionPassenger/Utils.html +310 -312
  52. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +169 -0
  53. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +4 -4
  54. data/doc/rdoc/classes/PlatformInfo.html +165 -164
  55. data/doc/rdoc/classes/Signal.html +23 -23
  56. data/doc/rdoc/created.rid +1 -1
  57. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
  58. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +26 -28
  59. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +26 -28
  60. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +1 -1
  61. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +1 -1
  62. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +26 -28
  63. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +1 -1
  64. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +1 -1
  65. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +26 -28
  66. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +1 -2
  67. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +1 -1
  68. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +26 -28
  69. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +26 -28
  70. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +34 -36
  71. data/doc/rdoc/fr_class_index.html +1 -0
  72. data/doc/rdoc/fr_method_index.html +72 -68
  73. data/ext/apache2/Configuration.cpp +69 -15
  74. data/ext/apache2/Configuration.h +37 -2
  75. data/ext/apache2/Hooks.cpp +167 -59
  76. data/ext/common/ApplicationPoolServerExecutable.cpp +1 -1
  77. data/ext/common/MessageChannel.h +4 -4
  78. data/ext/common/StandardApplicationPool.h +1 -1
  79. data/ext/common/Timer.h +2 -0
  80. data/ext/common/Version.h +1 -1
  81. data/ext/nginx/Configuration.c +3 -3
  82. data/ext/nginx/ContentHandler.c +16 -4
  83. data/ext/nginx/HelperServer.cpp +1 -1
  84. data/ext/oxt/system_calls.cpp +6 -1
  85. data/ext/oxt/thread.hpp +17 -2
  86. data/ext/phusion_passenger/native_support.c +4 -4
  87. data/lib/phusion_passenger/abstract_request_handler.rb +3 -3
  88. data/lib/phusion_passenger/abstract_server.rb +1 -0
  89. data/lib/phusion_passenger/constants.rb +1 -1
  90. data/lib/phusion_passenger/message_channel.rb +1 -0
  91. data/lib/phusion_passenger/platform_info.rb +3 -2
  92. data/lib/phusion_passenger/rack/request_handler.rb +11 -7
  93. data/lib/phusion_passenger/railz/application_spawner.rb +7 -4
  94. data/lib/phusion_passenger/railz/request_handler.rb +1 -0
  95. data/lib/phusion_passenger/spawn_manager.rb +1 -0
  96. data/lib/phusion_passenger/utils.rb +38 -20
  97. data/test/integration_tests/apache2_tests.rb +162 -100
  98. data/test/integration_tests/mycook_spec.rb +63 -62
  99. data/test/integration_tests/nginx_tests.rb +12 -5
  100. data/test/ruby/utils_spec.rb +98 -14
  101. data/test/stub/apache2/httpd.conf.erb +2 -1
  102. data/test/stub/rails_apps/mycook/app/controllers/welcome_controller.rb +8 -0
  103. data/test/support/apache2_controller.rb +5 -1
  104. data/test/support/test_helper.rb +42 -13
  105. metadata +7 -137
data/NEWS CHANGED
@@ -0,0 +1,137 @@
1
+ Release 2.2.5
2
+ -------------
3
+
4
+ * [Apache] Small file uploads are now buffered; fixes potential DoS attack
5
+ Phusion Passenger buffers large file uploads to temp files so that it
6
+ doesn't block applications while an upload is in progress, but it sent
7
+ small uploads directly to the application without buffering it. This could
8
+ result in a potential DoS attack: the client can send many small, incomplete
9
+ file uploads to the server, and this would block all application processes
10
+ until a timeout occurs. In order to solve this problem, Phusion Passenger
11
+ now buffers small file uploads in memory. Bug #356.
12
+
13
+ * [Apache] Fixed support for mod_rewrite passthrough rules
14
+ Mod_rewrite passthrough rules were not properly supported because of a bug
15
+ fix for supporting encoded slashes (%2f) in URLs. Unfortunately, due to
16
+ bugs/limitations in Apache, we can support either encoded slashes or
17
+ mod_rewrite passthrough rules, but not both; supporting one will break the
18
+ other.
19
+
20
+ Support for mod_rewrite passthrough rules is now enabled by default; that
21
+ is, support for encoded slashes is disabled by default. A new configuration
22
+ option, "PassengerAllowEncodedSlashes", has been added. Turning this option
23
+ on will enable support for encoded slashes and disable support for
24
+ mod_rewrite passthrough rules.
25
+
26
+ Issue #113 and issue #230.
27
+
28
+ * [Apache] Added a configuration option for resolving symlinks in the document root path
29
+ Phusion Passenger 2.2.0 and higher no longer resolves symlinks in
30
+ the document root path in order to properly support Capistrano-style
31
+ directory structures. The exact behavior is documented in the Users Guide,
32
+ section "How Phusion Passenger detects whether a virtual host is a web
33
+ application".
34
+
35
+ However, some people relied on the old behavior. A new configuration option,
36
+ PassengerResolveSymlinksInDocumentRoot, has been added to allow reverting
37
+ back to the old behavior.
38
+
39
+ Patch contributed by Locaweb (http://www.locaweb.com.br/).
40
+
41
+ * [Apache] mod_env variables are now also passed through CGI environment headers
42
+ Prior to version 2.2.3, environment variables set by mod_env are passed to
43
+ the application as CGI environment headers, not through Ruby's ENV variable.
44
+ In the last release we introduced support for setting ENV environment
45
+ variables with mod_env, and got rid of the code for setting CGI environment
46
+ headers. It turns out that some people relied on the old behavior, we so now
47
+ environment variables set with mod_env are set in both ENV and in the CGI
48
+ environment.
49
+
50
+ Fixes bug #335.
51
+
52
+ * [Apache] Fixed compilation problems on some Linux systems with older versions of Apache
53
+ If you used to see compilation errors like this:
54
+
55
+ ext/apache2/Configuration.cpp:554: error: expected primary-expression before '.' token
56
+
57
+ then this version should compile properly.
58
+
59
+ * [Apache] Fixed I/O timeouts for communication with backend processes
60
+ Got rid of the code for enforcing I/O timeouts when reading from or writing to
61
+ a backend process. This caused more problems than it solved.
62
+
63
+ * [Nginx] Support for streaming responses (e.g. Comet or HTTP push)
64
+ Buffering of backend responses is now disabled. This fixes support for
65
+ streaming responses, something which the Apache version has supported
66
+ for a while now. One can generate streaming responses in Ruby on Rails
67
+ like this:
68
+
69
+ render :text => lambda { |response, output|
70
+ 10_000.times do |i|
71
+ output.write("hello #{i}!\n")
72
+ end
73
+ }
74
+
75
+ * [Nginx] Installer now installs Nginx 0.7.61 by default
76
+ Previously it installed 0.6.37 by default.
77
+
78
+ * [Nginx] Fixed the installer's --extra-configure-flags flag when combined with --auto-download
79
+ Arguments passed to --extra-configure-flags were not being passed to the
80
+ Nginx configure script when --auto-download is given. This has been
81
+ fixed: bug #349.
82
+
83
+ * [Nginx] Fixed unnecessary download of PCRE
84
+ The installer now checks whether PCRE is installed in /opt/local (e.g.
85
+ MacPorts) as well before concluding that it isn't installed and going ahead
86
+ with downloading PCRE.
87
+
88
+ * Fixed STDERR capturing
89
+ While spawning an application, Phusion Passenger captures any output written
90
+ to STDERR so that it can show them later if the application failed to start.
91
+ This turns out to be much more difficult than expected, with all kinds of
92
+ corner cases that can mess up this feature.
93
+
94
+ For example, if the Rails log file is not writable, then this can cause
95
+ Rails to crash with a bizarre and unhelpful error message whenever it tries
96
+ to write to STDERR:
97
+
98
+ /!\ FAILSAFE /!\ Thu Aug 20 14:58:39 +1000 2009
99
+ Status: 500 Internal Server Error
100
+ undefined method `[]' for nil:NilClass
101
+
102
+ Some applications reopen STDERR to a log file. This didn't work.
103
+
104
+ Of all of these problems have been fixed now. (Bug #332)
105
+
106
+ * Fixed some bugs in application sources preloading
107
+ Rails >= 2.2 already preloads the application sources, in which case Phusion
108
+ Passenger wasn't supposed to perform it's own preloading, but the Rails
109
+ >= 2.2 detection code was bugged. This has been fixed.
110
+
111
+ Rails < 2.2 doesn't preload the application sources by itself, but there
112
+ should be a certain order with which the sources are preloaded, otherwise
113
+ preloading could fail in some applications. We now enforce a specific load
114
+ order: first models, then controllers, then helpers.
115
+
116
+ Bug #359.
117
+
118
+ * Fixed a few bugs in WSGI compliance
119
+ PATH_INFO is supposed to be set to the request URI, but without the query
120
+ string and without the base URI. This has been fixed: bug #360.
121
+
122
+ * Fixed some Ruby 1.9-specific crashes caused by encoding issues. Bug #354.
123
+ * Fixed loading of config/environment.rb on Ruby 1.9.2, because Ruby 1.9.2
124
+ no longer has "." in the default load path. Patch by metaljastix, issue #368.
125
+ * The Users Guide for Apache now mentions something about correct permissions
126
+ for application directories.
127
+ * Fixed compilation problems on IA-64 (bug #118). We also reduced the stack
128
+ sizes for the threads by half, so Phusion Passenger should use even less
129
+ virtual memory now.
130
+ * Fixed compilation problems on Linux systems with ARM CPU.
131
+ * Fixed a few compatibility problems with 64-bit OpenBSD.
132
+ * Fixed a few typos and minor bugs.
133
+
134
+
135
+ Older releases
136
+ --------------
137
+ Please consult the blog posts on http://blog.phusion.nl/ for the information about older releases.
data/Rakefile CHANGED
@@ -95,7 +95,7 @@ end
95
95
 
96
96
  ##### Boost and OXT static library
97
97
 
98
- def define_libboost_oxt_task(output_dir, extra_compiler_flags = nil)
98
+ def define_libboost_oxt_task(namespace, output_dir, extra_compiler_flags = nil)
99
99
  output_file = "#{output_dir}/libboost_oxt.a"
100
100
  output_dir_base = "#{output_dir}/libboost_oxt"
101
101
  flags = "-Iext #{extra_compiler_flags} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
@@ -136,7 +136,7 @@ def define_libboost_oxt_task(output_dir, extra_compiler_flags = nil)
136
136
  "#{output_dir_base}/oxt/*.o")
137
137
  end
138
138
 
139
- task :clean do
139
+ task "#{namespace}:clean" do
140
140
  sh "rm -rf #{output_file} #{output_dir_base}"
141
141
  end
142
142
 
@@ -147,7 +147,7 @@ end
147
147
  ##### Static library for Passenger source files that are shared between
148
148
  ##### the Apache module and the Nginx helper server.
149
149
 
150
- def define_common_library_task(output_dir, extra_compiler_flags = nil,
150
+ def define_common_library_task(namespace, output_dir, extra_compiler_flags = nil,
151
151
  with_application_pool_server_exe = false,
152
152
  boost_oxt_library = nil,
153
153
  extra_compiler_flags_for_server_exe = nil,
@@ -214,7 +214,7 @@ def define_common_library_task(output_dir, extra_compiler_flags = nil,
214
214
  end
215
215
  end
216
216
 
217
- task :clean do
217
+ task "#{namespace}:clean" do
218
218
  sh "rm -rf #{targets.join(' ')} #{objects_output_dir}"
219
219
  end
220
220
 
@@ -255,9 +255,9 @@ end
255
255
 
256
256
  # NOTE: APACHE2_BOOST_OXT_LIBRARY is a task name, while APACHE2_COMMON_LIBRARY
257
257
  # is an array of task names.
258
- APACHE2_BOOST_OXT_LIBRARY = define_libboost_oxt_task("ext/apache2",
258
+ APACHE2_BOOST_OXT_LIBRARY = define_libboost_oxt_task("apache2", "ext/apache2",
259
259
  PlatformInfo.apache2_module_cflags)
260
- APACHE2_COMMON_LIBRARY = define_common_library_task("ext/apache2",
260
+ APACHE2_COMMON_LIBRARY = define_common_library_task("apache2", "ext/apache2",
261
261
  PlatformInfo.apache2_module_cflags,
262
262
  true, APACHE2_BOOST_OXT_LIBRARY)
263
263
 
@@ -314,8 +314,7 @@ end
314
314
  end
315
315
 
316
316
  task :clean => 'apache2:clean'
317
-
318
- # Remove generated files for the Apache 2 module
317
+ desc "Clean all compiled Apache 2 files"
319
318
  task 'apache2:clean' do
320
319
  files = [APACHE2_OBJECTS, %w(ext/apache2/mod_passenger.o
321
320
  ext/apache2/mod_passenger.so)]
@@ -327,8 +326,8 @@ end
327
326
 
328
327
  # NOTE: NGINX_BOOST_OXT_LIBRARY is a task name, while NGINX_COMMON_LIBRARY
329
328
  # is an array of task names.
330
- NGINX_BOOST_OXT_LIBRARY = define_libboost_oxt_task("ext/nginx")
331
- NGINX_COMMON_LIBRARY = define_common_library_task("ext/nginx")
329
+ NGINX_BOOST_OXT_LIBRARY = define_libboost_oxt_task("nginx", "ext/nginx")
330
+ NGINX_COMMON_LIBRARY = define_common_library_task("nginx", "ext/nginx")
332
331
 
333
332
  desc "Build Nginx helper server"
334
333
  task :nginx => ['ext/nginx/HelperServer', :native_support]
@@ -355,8 +354,7 @@ end
355
354
  end
356
355
 
357
356
  task :clean => 'nginx:clean'
358
-
359
- # Remove Nginx helper server
357
+ desc "Clean all compiled Nginx files"
360
358
  task 'nginx:clean' do
361
359
  sh("rm", "-rf", "ext/nginx/HelperServer")
362
360
  end
@@ -364,8 +362,8 @@ end
364
362
 
365
363
  ##### Unit tests
366
364
 
367
- TEST_BOOST_OXT_LIBRARY = define_libboost_oxt_task("test")
368
- TEST_COMMON_LIBRARY = define_common_library_task("test",
365
+ TEST_BOOST_OXT_LIBRARY = define_libboost_oxt_task("test", "test")
366
+ TEST_COMMON_LIBRARY = define_common_library_task("test", "test",
369
367
  nil, true, TEST_BOOST_OXT_LIBRARY)
370
368
 
371
369
  TEST_COMMON_CFLAGS = "-DTESTING_SPAWN_MANAGER -DTESTING_APPLICATION_POOL " <<
@@ -571,7 +569,9 @@ end
571
569
  end
572
570
  end
573
571
 
574
- task :clean do
572
+ task :clean => 'test:clean'
573
+ desc "Clean all compiled test files"
574
+ task 'test:clean' do
575
575
  sh("rm -rf test/oxt/oxt_test_main test/oxt/*.o test/CxxTests test/*.o")
576
576
  end
577
577
 
@@ -641,7 +641,7 @@ Rake::RDocTask.new(:clobber_rdoc => "rdoc:clobber", :rerdoc => "rdoc:force") do
641
641
  end
642
642
 
643
643
 
644
- ##### Gem
644
+ ##### Packaging
645
645
 
646
646
  spec = Gem::Specification.new do |s|
647
647
  s.platform = Gem::Platform::RUBY
@@ -735,9 +735,6 @@ Rake::Task['package:gem'].prerequisites.unshift(:doc)
735
735
  Rake::Task['package:force'].prerequisites.unshift(:doc)
736
736
  task :clobber => :'package:clean'
737
737
 
738
-
739
- ##### Misc
740
-
741
738
  desc "Create a fakeroot, useful for building native packages"
742
739
  task :fakeroot => [:apache2, :native_support, :doc] do
743
740
  require 'rbconfig'
@@ -834,3 +831,88 @@ task :sloccount do
834
831
  system "rm -rf #{tmpdir}"
835
832
  end
836
833
  end
834
+
835
+ desc "Convert the NEWS items for the latest release to HTML"
836
+ task :news_as_html do
837
+ # The text is in the following format:
838
+ #
839
+ # Release x.x.x
840
+ # -------------
841
+ #
842
+ # * Text.
843
+ # * More text.
844
+ # * A header.
845
+ # With yet more text.
846
+ #
847
+ # Release y.y.y
848
+ # -------------
849
+ # .....
850
+ require 'cgi'
851
+ contents = File.read("NEWS")
852
+
853
+ # We're only interested in the latest release, so extract the text for that.
854
+ contents =~ /\A(Release.*?)^(Release|Older releases)/m
855
+
856
+ # Now split the text into individual items.
857
+ items = $1.split(/^ \*/)
858
+ items.shift # Delete the 'Release x.x.x' header.
859
+
860
+ puts "<dl>"
861
+ items.each do |item|
862
+ item.strip!
863
+
864
+ # Does this item have a header? It does if it consists of multiple lines, and
865
+ # the next line is capitalized.
866
+ lines = item.split("\n")
867
+ if lines.size > 1 && lines[1].strip[0..0] == lines[1].strip[0..0].upcase
868
+ puts "<dt>#{lines[0]}</dt>"
869
+ lines.shift
870
+ item = lines.join("\n")
871
+ item.strip!
872
+ end
873
+
874
+ # Split into paragraphs. Empty lines are paragraph dividers.
875
+ paragraphs = item.split(/^ *$/m)
876
+
877
+ def format_paragraph(text)
878
+ # Get rid of newlines: convert them into spaces.
879
+ text.gsub!("\n", ' ')
880
+ while text.index(' ')
881
+ text.gsub!(' ', ' ')
882
+ end
883
+
884
+ # Auto-link to issue tracker.
885
+ text.gsub!(/(bug|issue) #(\d+)/i) do
886
+ url = "http://code.google.com/p/phusion-passenger/issues/detail?id=#{$2}"
887
+ %Q(<{a href="#{url}"}>#{$1} ##{$2}<{/a}>)
888
+ end
889
+
890
+ text.strip!
891
+ text = CGI.escapeHTML(text)
892
+ text.gsub!(%r(&lt;\{(.*?)\}&gt;(.*?)&lt;\{/(.*?)\}&gt;)) do
893
+ "<#{CGI.unescapeHTML $1}>#{$2}</#{CGI.unescapeHTML $3}>"
894
+ end
895
+ text
896
+ end
897
+
898
+ if paragraphs.size > 1
899
+ STDOUT.write("<dd>")
900
+ paragraphs.each do |paragraph|
901
+ paragraph.gsub!(/\A\n+/, '')
902
+ paragraph.gsub!(/\n+\Z/, '')
903
+
904
+ if (paragraph =~ /\A /)
905
+ # Looks like a code block.
906
+ paragraph.gsub!(/^ /m, '')
907
+ puts "<pre lang=\"ruby\">#{CGI.escapeHTML(paragraph)}</pre>"
908
+ else
909
+ puts "<p>#{format_paragraph(paragraph)}</p>"
910
+ end
911
+ end
912
+ STDOUT.write("</dd>\n")
913
+ else
914
+ puts "<dd>#{format_paragraph(item)}</dd>"
915
+ end
916
+ end
917
+ puts "</dl>"
918
+ end
@@ -36,7 +36,7 @@ include PlatformInfo
36
36
  class Installer < PhusionPassenger::AbstractInstaller
37
37
  include PhusionPassenger
38
38
 
39
- NGINX_VERSION = "0.6.37"
39
+ NGINX_VERSION = "0.7.61"
40
40
 
41
41
  def dependencies
42
42
  result = [
@@ -77,7 +77,11 @@ class Installer < PhusionPassenger::AbstractInstaller
77
77
  exit(1)
78
78
  end
79
79
  nginx_prefix = ask_for_nginx_install_prefix
80
- extra_nginx_configure_flags = nil
80
+ if @extra_configure_flags == "none"
81
+ extra_nginx_configure_flags = nil
82
+ else
83
+ extra_nginx_configure_flags = @extra_configure_flags
84
+ end
81
85
  else
82
86
  nginx_source_dir = ask_for_nginx_source_dir
83
87
  nginx_prefix = ask_for_nginx_install_prefix
@@ -392,7 +396,10 @@ private
392
396
  f.puts("#include <pcre.h>")
393
397
  end
394
398
  Dir.chdir('/tmp') do
395
- system("(gcc -c passenger-check.c) >/dev/null 2>/dev/null")
399
+ # Nginx checks for PCRE in multiple places...
400
+ system("(gcc -I/usr/local/include -I/usr/include/pcre " <<
401
+ "-I/usr/pkg/include -I/opt/local/include " <<
402
+ "-c passenger-check.c) >/dev/null 2>/dev/null")
396
403
  end
397
404
  ensure
398
405
  File.unlink('/tmp/passenger-check.c') rescue nil
@@ -75,7 +75,7 @@ else
75
75
  end
76
76
  if system("touch", enterprise_file)
77
77
  puts "Congratulations! Your Passenger Enterprise License has been activated!"
78
- puts "Please restart Apache to take full advantage of your Enterprise License."
78
+ puts "Please restart Apache or Nginx to take full advantage of your Enterprise License."
79
79
  else
80
80
  STDERR.puts "Could not write to the Passenger folder. Please run this tool as root."
81
81
  exit 1
@@ -808,6 +808,25 @@ For example:</p></div>
808
808
  DocumentRoot /webapps/mycook/public
809
809
  &lt;/VirtualHost&gt;</tt></pre>
810
810
  </div></div>
811
+ <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
812
+ following folders are readable and executable by Apache:</p></div>
813
+ <div class="ulist"><ul>
814
+ <li>
815
+ <p>
816
+ this <em>public</em> folder.
817
+ </p>
818
+ </li>
819
+ <li>
820
+ <p>
821
+ the application&#8217;s <em>config</em> folder.
822
+ </p>
823
+ </li>
824
+ <li>
825
+ <p>
826
+ all parent folders. That is, /webapps/mycook and /webapps must also be readable and executable by Apache.
827
+ </p>
828
+ </li>
829
+ </ul></div>
811
830
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
812
831
  <h3 id="deploying_rails_to_sub_uri">3.2. Deploying to a sub URI</h3>
813
832
  <div class="paragraph"><p>Suppose that you already have a virtual host:</p></div>
@@ -997,6 +1016,25 @@ For example:</p></div>
997
1016
  DocumentRoot /webapps/rackapp/public
998
1017
  &lt;/VirtualHost&gt;</tt></pre>
999
1018
  </div></div>
1019
+ <div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
1020
+ following folders are readable and executable by Apache:</p></div>
1021
+ <div class="ulist"><ul>
1022
+ <li>
1023
+ <p>
1024
+ this <em>public</em> folder.
1025
+ </p>
1026
+ </li>
1027
+ <li>
1028
+ <p>
1029
+ the application&#8217;s <em>config</em> folder.
1030
+ </p>
1031
+ </li>
1032
+ <li>
1033
+ <p>
1034
+ all parent folders. That is, /webapps/rackapp and /webapps must also be readable and executable by Apache.
1035
+ </p>
1036
+ </li>
1037
+ </ul></div>
1000
1038
  <div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
1001
1039
  <h3 id="deploying_rack_to_sub_uri">4.3. Deploying to a sub URI</h3>
1002
1040
  <div class="paragraph"><p>Suppose that you already have a virtual host:</p></div>
@@ -1328,83 +1366,7 @@ This configuration option allows one to specify which user Rails/Rack
1328
1366
  applications must run as, if user switching fails or is disabled.</p></div>
1329
1367
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
1330
1368
  The default value is <em>nobody</em>.</p></div>
1331
- <h3 id="PassengerHighPerformance">5.8. PassengerHighPerformance &lt;on|off&gt;</h3>
1332
- <div class="paragraph"><p>By default, Phusion Passenger is compatible with mod_rewrite and most other
1333
- Apache modules. However, a lot of effort is required in order to be compatible.
1334
- If you turn <em>PassengerHighPerformance</em> to <em>on</em>, then Phusion Passenger will be
1335
- a little faster, in return for reduced compatibility with other Apache modules.</p></div>
1336
- <div class="paragraph"><p>In places where <em>PassengerHighPerformance</em> is turned on, mod_rewrite rules will
1337
- likely not work. mod_autoindex (the module which displays a directory index)
1338
- will also not work. Other Apache modules may or may not work, depending on what
1339
- they exactly do. We recommend you to find out how other modules behave in high
1340
- performance mode via testing.</p></div>
1341
- <div class="paragraph"><p>This option is <strong>not</strong> an all-or-nothing global option: you can enable high
1342
- performance mode for certain virtual hosts or certain URLs only.
1343
- The <em>PassengerHighPerformance</em> option may occur in the following places:</p></div>
1344
- <div class="ulist"><ul>
1345
- <li>
1346
- <p>
1347
- In the global server configuration.
1348
- </p>
1349
- </li>
1350
- <li>
1351
- <p>
1352
- In a virtual host configuration block.
1353
- </p>
1354
- </li>
1355
- <li>
1356
- <p>
1357
- In a <tt>&lt;Directory&gt;</tt> or <tt>&lt;Location&gt;</tt> block.
1358
- </p>
1359
- </li>
1360
- <li>
1361
- <p>
1362
- In <em>.htaccess</em>.
1363
- </p>
1364
- </li>
1365
- </ul></div>
1366
- <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>off</em>,
1367
- so high performance mode is disabled by default, and you have to explicitly
1368
- enable it.</p></div>
1369
- <div class="paragraph"><div class="title">When to enable high performance mode?</div><p>If you do not use mod_rewrite or other Apache modules then it might make
1370
- sense to enable high performance mode.</p></div>
1371
- <div class="paragraph"><p>It&#8217;s likely that some of your applications depend on mod_rewrite or other
1372
- Apache modules, while some do not. In that case you can enable high performance
1373
- for only those applications that don&#8217;t use other Apache modules. For example:</p></div>
1374
- <div class="listingblock">
1375
- <div class="content">
1376
- <pre><tt>&lt;VirtualHost *:80&gt;
1377
- ServerName www.foo.com
1378
- DocumentRoot /apps/foo/public
1379
- .... mod_rewrite rules or options for other Apache modules here ...
1380
- &lt;/VirtualHost&gt;
1381
-
1382
- &lt;VirtualHost *:80&gt;
1383
- ServerName www.bar.com
1384
- DocumentRoot /apps/bar/public
1385
- PassengerHighPerformance on
1386
- &lt;/VirtualHost&gt;</tt></pre>
1387
- </div></div>
1388
- <div class="paragraph"><p>In the above example, high performance mode is only enabled for www.bar.com.
1389
- It is disabled for everything else.</p></div>
1390
- <div class="paragraph"><p>If your application generally depends on mod_rewrite or other Apache modules,
1391
- but a certain URL that&#8217;s accessed often doesn&#8217;t depend on those other modules,
1392
- then you can enable high performance mode for a certain URL only. For example:</p></div>
1393
- <div class="listingblock">
1394
- <div class="content">
1395
- <pre><tt>&lt;VirtualHost *:80&gt;
1396
- ServerName www.foo.com
1397
- DocumentRoot /apps/foo/public
1398
- .... mod_rewrite rules or options for other Apache modules here ...
1399
-
1400
- &lt;Location /chatroom/ajax_update_poll&gt;
1401
- PassengerHighPerformance on
1402
- &lt;/Location&gt;
1403
- &lt;/VirtualHost&gt;</tt></pre>
1404
- </div></div>
1405
- <div class="paragraph"><p>This enables high performance mode for
1406
- <a href="http://www.foo.com/chatroom/ajax_update_poll">http://www.foo.com/chatroom/ajax_update_poll</a> only.</p></div>
1407
- <h3 id="_passengerenabled_lt_on_off_gt">5.9. PassengerEnabled &lt;on|off&gt;</h3>
1369
+ <h3 id="_passengerenabled_lt_on_off_gt">5.8. PassengerEnabled &lt;on|off&gt;</h3>
1408
1370
  <div class="paragraph"><p>You can set this option to <em>off</em> to completely disable Phusion Passenger for
1409
1371
  a certain location. This is useful if, for example, you want to integrate a PHP
1410
1372
  application into the same virtual host as a Rails application.</p></div>
@@ -1448,7 +1410,7 @@ In <em>.htaccess</em>.
1448
1410
  </li>
1449
1411
  </ul></div>
1450
1412
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>on</em>.</p></div>
1451
- <h3 id="PassengerTempDir">5.10. PassengerTempDir &lt;directory&gt;</h3>
1413
+ <h3 id="PassengerTempDir">5.9. PassengerTempDir &lt;directory&gt;</h3>
1452
1414
  <div class="paragraph"><p>Specifies the directory that Phusion Passenger should use for storing temporary
1453
1415
  files. This includes things such as Unix socket files, buffered file uploads
1454
1416
  (see also <a href="#PassengerUploadBufferDir">PassengerUploadBufferDir</a>), etc.</p></div>
@@ -1471,7 +1433,7 @@ environment variable, like this:</p></div>
1471
1433
  sudo -E passenger-status
1472
1434
  # The -E option tells 'sudo' to preserve environment variables.</tt></pre>
1473
1435
  </div></div>
1474
- <h3 id="PassengerUploadBufferDir">5.11. PassengerUploadBufferDir &lt;directory&gt;</h3>
1436
+ <h3 id="PassengerUploadBufferDir">5.10. PassengerUploadBufferDir &lt;directory&gt;</h3>
1475
1437
  <div class="paragraph"><p>Phusion Passenger buffers large file uploads to disk in order prevent slow file
1476
1438
  uploads from blocking web applications. By default, a subdirectory in the
1477
1439
  system&#8217;s temporary files directory (or a subdirectory in the directory specified
@@ -1512,7 +1474,7 @@ In <em>.htaccess</em>, if <tt>AllowOverrides Options</tt> is enabled.
1512
1474
  </li>
1513
1475
  </ul></div>
1514
1476
  <div class="paragraph"><p>In each place, it may be specified at most once.</p></div>
1515
- <h3 id="_passengerrestartdir_lt_directory_gt">5.12. PassengerRestartDir &lt;directory&gt;</h3>
1477
+ <h3 id="_passengerrestartdir_lt_directory_gt">5.11. PassengerRestartDir &lt;directory&gt;</h3>
1516
1478
  <div class="paragraph"><p>As described in the deployment chapters of this document, Phusion Passenger
1517
1479
  checks the file <em>tmp/restart.txt</em> in the applications'
1518
1480
  <a href="#application_root">root directory</a> for restarting applications. Sometimes it
@@ -1580,8 +1542,8 @@ security flaw which allows an attacker to touch restart.txt, then that will
1580
1542
  allow the attacker to cause a Denial-of-Service.</p></div>
1581
1543
  <div class="paragraph"><p>You can prevent this from happening by pointing PassengerRestartDir to a
1582
1544
  directory that&#8217;s readable by Apache, but only writable by administrators.</p></div>
1583
- <h3 id="_resource_control_and_optimization_options">5.13. Resource control and optimization options</h3>
1584
- <h4 id="_passengermaxpoolsize_lt_integer_gt">5.13.1. PassengerMaxPoolSize &lt;integer&gt;</h4>
1545
+ <h3 id="_resource_control_and_optimization_options">5.12. Resource control and optimization options</h3>
1546
+ <h4 id="_passengermaxpoolsize_lt_integer_gt">5.12.1. PassengerMaxPoolSize &lt;integer&gt;</h4>
1585
1547
  <div class="paragraph"><p>The maximum number of Ruby on Rails or Rack application instances that may
1586
1548
  be simultaneously active. A larger number results in higher memory usage,
1587
1549
  but improved ability to handle concurrent HTTP clients.</p></div>
@@ -1606,7 +1568,7 @@ The default value is <em>6</em>.</p></div>
1606
1568
  by about 33%. And it&#8217;s not hard to install.</td>
1607
1569
  </tr></table>
1608
1570
  </div>
1609
- <h4 id="_passengermaxinstancesperapp_lt_integer_gt">5.13.2. PassengerMaxInstancesPerApp &lt;integer&gt;</h4>
1571
+ <h4 id="_passengermaxinstancesperapp_lt_integer_gt">5.12.2. PassengerMaxInstancesPerApp &lt;integer&gt;</h4>
1610
1572
  <div class="paragraph"><p>The maximum number of application instances that may be simultaneously active
1611
1573
  for a single application. This helps to make sure that a single application
1612
1574
  will not occupy all available slots in the application pool.</p></div>
@@ -1616,7 +1578,7 @@ may use, i.e. only the global limit of <a href="#PassengerMaxPoolSize">Passenger
1616
1578
  will be enforced.</p></div>
1617
1579
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
1618
1580
  The default value is <em>0</em>.</p></div>
1619
- <h4 id="PassengerPoolIdleTime">5.13.3. PassengerPoolIdleTime &lt;integer&gt;</h4>
1581
+ <h4 id="PassengerPoolIdleTime">5.12.3. PassengerPoolIdleTime &lt;integer&gt;</h4>
1620
1582
  <div class="paragraph"><p>The maximum number of seconds that an application instance may be idle. That is,
1621
1583
  if an application instance hasn&#8217;t received any traffic after the given number of
1622
1584
  seconds, then it will be shutdown in order to conserve memory.</p></div>
@@ -1636,7 +1598,7 @@ recommended if you&#8217;re on a non-shared host that&#8217;s only running a few
1636
1598
  applications, each which must be available at all times.</p></div>
1637
1599
  <div class="paragraph"><p>This option may only occur once, in the global server configuration.
1638
1600
  The default value is <em>300</em>.</p></div>
1639
- <h4 id="PassengerMaxRequests">5.13.4. PassengerMaxRequests &lt;integer&gt;</h4>
1601
+ <h4 id="PassengerMaxRequests">5.12.4. PassengerMaxRequests &lt;integer&gt;</h4>
1640
1602
  <div class="paragraph"><p>The maximum number of requests an application instance will process. After
1641
1603
  serving that many requests, the application instance will be shut down and
1642
1604
  Phusion Passenger will restart it. A value of 0 means that there is no maximum:
@@ -1682,7 +1644,7 @@ measure to avoid memory leaks.</p></div>
1682
1644
  </td>
1683
1645
  </tr></table>
1684
1646
  </div>
1685
- <h4 id="_passengerstatthrottlerate_lt_integer_gt">5.13.5. PassengerStatThrottleRate &lt;integer&gt;</h4>
1647
+ <h4 id="_passengerstatthrottlerate_lt_integer_gt">5.12.5. PassengerStatThrottleRate &lt;integer&gt;</h4>
1686
1648
  <div class="paragraph"><p>By default, Phusion Passenger performs several filesystem checks (or, in
1687
1649
  programmers jargon, <em>stat() calls</em>) each time a request is processed:</p></div>
1688
1650
  <div class="ulist"><ul>
@@ -1732,6 +1694,175 @@ In <em>.htaccess</em>, if <tt>AllowOverride Limits</tt> is on.
1732
1694
  </li>
1733
1695
  </ul></div>
1734
1696
  <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>0</em>.</p></div>
1697
+ <h4 id="PassengerHighPerformance">5.12.6. PassengerHighPerformance &lt;on|off&gt;</h4>
1698
+ <div class="paragraph"><p>By default, Phusion Passenger is compatible with mod_rewrite and most other
1699
+ Apache modules. However, a lot of effort is required in order to be compatible.
1700
+ If you turn <em>PassengerHighPerformance</em> to <em>on</em>, then Phusion Passenger will be
1701
+ a little faster, in return for reduced compatibility with other Apache modules.</p></div>
1702
+ <div class="paragraph"><p>In places where <em>PassengerHighPerformance</em> is turned on, mod_rewrite rules will
1703
+ likely not work. mod_autoindex (the module which displays a directory index)
1704
+ will also not work. Other Apache modules may or may not work, depending on what
1705
+ they exactly do. We recommend you to find out how other modules behave in high
1706
+ performance mode via testing.</p></div>
1707
+ <div class="paragraph"><p>This option is <strong>not</strong> an all-or-nothing global option: you can enable high
1708
+ performance mode for certain virtual hosts or certain URLs only.
1709
+ The <em>PassengerHighPerformance</em> option may occur in the following places:</p></div>
1710
+ <div class="ulist"><ul>
1711
+ <li>
1712
+ <p>
1713
+ In the global server configuration.
1714
+ </p>
1715
+ </li>
1716
+ <li>
1717
+ <p>
1718
+ In a virtual host configuration block.
1719
+ </p>
1720
+ </li>
1721
+ <li>
1722
+ <p>
1723
+ In a <tt>&lt;Directory&gt;</tt> or <tt>&lt;Location&gt;</tt> block.
1724
+ </p>
1725
+ </li>
1726
+ <li>
1727
+ <p>
1728
+ In <em>.htaccess</em>.
1729
+ </p>
1730
+ </li>
1731
+ </ul></div>
1732
+ <div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>off</em>,
1733
+ so high performance mode is disabled by default, and you have to explicitly
1734
+ enable it.</p></div>
1735
+ <div class="paragraph"><div class="title">When to enable high performance mode?</div><p>If you do not use mod_rewrite or other Apache modules then it might make
1736
+ sense to enable high performance mode.</p></div>
1737
+ <div class="paragraph"><p>It&#8217;s likely that some of your applications depend on mod_rewrite or other
1738
+ Apache modules, while some do not. In that case you can enable high performance
1739
+ for only those applications that don&#8217;t use other Apache modules. For example:</p></div>
1740
+ <div class="listingblock">
1741
+ <div class="content">
1742
+ <pre><tt>&lt;VirtualHost *:80&gt;
1743
+ ServerName www.foo.com
1744
+ DocumentRoot /apps/foo/public
1745
+ .... mod_rewrite rules or options for other Apache modules here ...
1746
+ &lt;/VirtualHost&gt;
1747
+
1748
+ &lt;VirtualHost *:80&gt;
1749
+ ServerName www.bar.com
1750
+ DocumentRoot /apps/bar/public
1751
+ PassengerHighPerformance on
1752
+ &lt;/VirtualHost&gt;</tt></pre>
1753
+ </div></div>
1754
+ <div class="paragraph"><p>In the above example, high performance mode is only enabled for www.bar.com.
1755
+ It is disabled for everything else.</p></div>
1756
+ <div class="paragraph"><p>If your application generally depends on mod_rewrite or other Apache modules,
1757
+ but a certain URL that&#8217;s accessed often doesn&#8217;t depend on those other modules,
1758
+ then you can enable high performance mode for a certain URL only. For example:</p></div>
1759
+ <div class="listingblock">
1760
+ <div class="content">
1761
+ <pre><tt>&lt;VirtualHost *:80&gt;
1762
+ ServerName www.foo.com
1763
+ DocumentRoot /apps/foo/public
1764
+ .... mod_rewrite rules or options for other Apache modules here ...
1765
+
1766
+ &lt;Location /chatroom/ajax_update_poll&gt;
1767
+ PassengerHighPerformance on
1768
+ &lt;/Location&gt;
1769
+ &lt;/VirtualHost&gt;</tt></pre>
1770
+ </div></div>
1771
+ <div class="paragraph"><p>This enables high performance mode for
1772
+ <a href="http://www.foo.com/chatroom/ajax_update_poll">http://www.foo.com/chatroom/ajax_update_poll</a> only.</p></div>
1773
+ <h3 id="_compatibility_options">5.13. Compatibility options</h3>
1774
+ <h4 id="PassengerResolveSymlinksInDocumentRoot">5.13.1. PassengerResolveSymlinksInDocumentRoot &lt;on|off&gt;</h4>
1775
+ <div class="paragraph"><p>Configures whether Phusion Passenger should resolve symlinks in the document root.
1776
+ 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>
1777
+ <div class="paragraph"><p>This option may occur in the following places:</p></div>
1778
+ <div class="ulist"><ul>
1779
+ <li>
1780
+ <p>
1781
+ In the global server configuration.
1782
+ </p>
1783
+ </li>
1784
+ <li>
1785
+ <p>
1786
+ In a virtual host configuration block.
1787
+ </p>
1788
+ </li>
1789
+ <li>
1790
+ <p>
1791
+ In a <tt>&lt;Directory&gt;</tt> or <tt>&lt;Location&gt;</tt> block.
1792
+ </p>
1793
+ </li>
1794
+ <li>
1795
+ <p>
1796
+ In <em>.htaccess</em>, if <tt>AllowOverride Options</tt> is on.
1797
+ </p>
1798
+ </li>
1799
+ </ul></div>
1800
+ <div class="paragraph"><p>In each place, it may be specified at most once. It is off by default.</p></div>
1801
+ <h4 id="_passengerallowencodedslashes_lt_on_off_gt">5.13.2. PassengerAllowEncodedSlashes &lt;on|off&gt;</h4>
1802
+ <div class="paragraph"><p>By default, Apache doesn&#8217;t support URLs with encoded slashes (%2f), e.g. URLs like
1803
+ this: <tt>/users/fujikura%2fyuu</tt>. If you access such an URL then Apache will return a
1804
+ 404 Not Found error. This can be solved by turning on PassengerAllowEncodedSlashes
1805
+ as well as Apache&#8217;s
1806
+ <a href="http://httpd.apache.org/docs/2.0/mod/core.html#allowencodedslashes">AllowEncodedSlashes</a>.</p></div>
1807
+ <div class="paragraph"><p>Is it important that you turn on both AllowEncodedSlashes <strong>and</strong> PassengerAllowEncodedSlashes,
1808
+ otherwise this feature will not work properly.</p></div>
1809
+ <div class="paragraph"><p>PassengerAllowEncodedSlashes may occur in the following places:</p></div>
1810
+ <div class="ulist"><ul>
1811
+ <li>
1812
+ <p>
1813
+ In the global server configuration.
1814
+ </p>
1815
+ </li>
1816
+ <li>
1817
+ <p>
1818
+ In a virtual host configuration block.
1819
+ </p>
1820
+ </li>
1821
+ <li>
1822
+ <p>
1823
+ In a <tt>&lt;Directory&gt;</tt> or <tt>&lt;Location&gt;</tt> block.
1824
+ </p>
1825
+ </li>
1826
+ <li>
1827
+ <p>
1828
+ In <em>.htaccess</em>, if <tt>AllowOverride Options</tt> is on.
1829
+ </p>
1830
+ </li>
1831
+ </ul></div>
1832
+ <div class="paragraph"><p>In each place, it may be specified at most once. It is off by default.</p></div>
1833
+ <div class="paragraph"><p>Please note however that turning on support for encoded slashes will break support for
1834
+ mod_rewrite passthrough rules. Because of bugs/limitations in Apache, Phusion Passenger
1835
+ can support either encoded slashes or mod_rewrite passthrough rules, but not both at the
1836
+ same time. Luckily this option can be specified anywhere, so you can enable it only for
1837
+ virtual hosts or URLs that need it:</p></div>
1838
+ <div class="listingblock">
1839
+ <div class="content">
1840
+ <pre><tt>&lt;VirtualHost *:80&gt;
1841
+ ServerName www.example.com
1842
+ DocumentRoot /webapps/example/public
1843
+ AllowEncodedSlashes on
1844
+ RewriteEngine on
1845
+
1846
+ # Check for maintenance file and redirect all requests
1847
+ RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
1848
+ RewriteCond %{SCRIPT_FILENAME} !maintenance.html
1849
+ RewriteRule ^.*$ /system/maintenance.html [L]
1850
+
1851
+ # Make /about an alias for /info/about.
1852
+ RewriteRule ^/about$ /info/about [PT,L]
1853
+
1854
+ &lt;Location ~ "^/users/"&gt;
1855
+ # In a location block so that it doesn't interfere with the
1856
+ # above /about mod_rewrite rule.
1857
+ PassengerAllowEncodedSlashes on
1858
+ &lt;/Location&gt;
1859
+ &lt;/VirtualHost&gt;</tt></pre>
1860
+ </div></div>
1861
+ <div class="paragraph"><p>With this, <a href="http://www.example.com/users/fujikura%2fyuu">http://www.example.com/users/fujikura%2fyuu</a> will work properly, and
1862
+ accessing <a href="http://www.example.com/about">http://www.example.com/about</a> will properly display the result of
1863
+ <a href="http://www.example.com/info/about">http://www.example.com/info/about</a>. Notice that PassengerAllowEncodedSlashes only
1864
+ interferes with passthrough rules, not with any other mod_rewrite rules. The rules for
1865
+ displaying maintenance.html will work fine even URLs starting with "/users".</p></div>
1735
1866
  <h3 id="_ruby_on_rails_specific_options">5.14. Ruby on Rails-specific options</h3>
1736
1867
  <h4 id="_railsautodetect_lt_on_off_gt">5.14.1. RailsAutoDetect &lt;on|off&gt;</h4>
1737
1868
  <div class="paragraph"><p>Whether Phusion Passenger should automatically detect whether a virtual host&#8217;s
@@ -2926,7 +3057,7 @@ If <em>foo/bar.html</em> doesn&#8217;t exist either, then Phusion Passenger will
2926
3057
  application uses a non-standard page cache directory, i.e. if it doesn&#8217;t cache to
2927
3058
  the <em>public</em> directory. In that case you&#8217;ll need to use mod_rewrite to serve such
2928
3059
  page cache files.</p></div>
2929
- <h3 id="_how_phusion_passenger_detects_whether_a_virtual_host_is_a_web_application">9.3. How Phusion Passenger detects whether a virtual host is a web application</h3>
3060
+ <h3 id="application_detection">9.3. How Phusion Passenger detects whether a virtual host is a web application</h3>
2930
3061
  <div class="paragraph"><p>After you&#8217;ve read the deployment instructions you might wonder how Phusion Passenger
2931
3062
  knows that the DocumentRoot points to a web application that Phusion Passenger is
2932
3063
  able to serve, and how it knows what kind of web application it is (e.g. Rails or Rack).</p></div>
@@ -2953,8 +3084,9 @@ Append the text "/config/environment.rb" to the result, and check whether the re
2953
3084
  </ol></div>
2954
3085
  <div class="paragraph"><p>So suppose that your document root is <em>/webapps/foo/public</em>. Phusion Passenger will check
2955
3086
  whether the file <em>/webapps/foo/config/environment.rb</em> exists.</p></div>
2956
- <div class="paragraph"><p>Note that Phusion Passenger does <strong>not</strong> resolve any symlinks in the document root path since
2957
- version 2.2.0&#8201;&#8212;&#8201;in contrast to versions earlier than 2.2.0, which does resolve symlinks.
3087
+ <div class="paragraph"><p>Note that Phusion Passenger does <strong>not</strong> resolve any symlinks in the document root path by
3088
+ default since version 2.2.0&#8201;&#8212;&#8201;in contrast to versions earlier than 2.2.0, which do resolve
3089
+ symlinks.
2958
3090
  So for example, suppose that your DocumentRoot points to <em>/home/www/example.com</em>, which in
2959
3091
  turn is a symlink to <em>/webapps/example.com/public</em>. In versions earlier than 2.2.0, Phusion
2960
3092
  Passenger will check whether <em>/webapps/example.com/config/environment.rb</em> exists because it
@@ -2962,8 +3094,11 @@ resolves all symlinks. Phusion Passenger 2.2.0 and later however will check for
2962
3094
  <em>/home/www/config/environment.rb</em>. This file of course doesn&#8217;t exist, and as a result Phusion
2963
3095
  Passenger will not activate itself for this virtual host, and you&#8217;ll most likely see an Apache
2964
3096
  mod_dirindex directory listing.</p></div>
2965
- <div class="paragraph"><p>If you&#8217;re running into this problem, you can explicitly tell Phusion Passenger what the
2966
- correct application root is through the <a href="#PassengerAppRoot">PassengerAppRoot</a> configuration directive.</p></div>
3097
+ <div class="paragraph"><p>If you need the old symlink-resolving behavior for whatever reason, then you can turn on
3098
+ <a href="#PassengerResolveSymlinksInDocumentRoot">PassengerResolveSymlinksInDocumentRoot</a>.</p></div>
3099
+ <div class="paragraph"><p>Another way to solve this situation is to explicitly tell Phusion Passenger what the
3100
+ correct application root is through the <a href="#PassengerAppRoot">PassengerAppRoot</a> configuration
3101
+ directive.</p></div>
2967
3102
  <div class="paragraph"><p>Autodetection of Rack applications happens through the same mechanism, exception that
2968
3103
  Phusion Passenger will look for <em>config.ru</em> instead of <em>config/environment.rb</em>.</p></div>
2969
3104
  </div>
@@ -3347,7 +3482,7 @@ has no effect.</p></div>
3347
3482
  </div>
3348
3483
  <div id="footer">
3349
3484
  <div id="footer-text">
3350
- Last updated 2009-06-16 23:49:41 CEST
3485
+ Last updated 2009-08-31 15:39:27 CEST
3351
3486
  </div>
3352
3487
  </div>
3353
3488
  </body>