passenger 2.2.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (216) hide show
  1. data/Rakefile +66 -79
  2. data/bin/passenger-install-nginx-module +1 -1
  3. data/bin/passenger-memory-stats +1 -1
  4. data/bin/passenger-spawn-server +8 -2
  5. data/doc/Users guide Apache.html +33 -49
  6. data/doc/Users guide Apache.txt +28 -27
  7. data/doc/Users guide Nginx.html +9 -19
  8. data/doc/Users guide Nginx.txt +8 -20
  9. data/doc/cxxapi/Bucket_8h-source.html +1 -1
  10. data/doc/cxxapi/Configuration_8h-source.html +297 -300
  11. data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
  12. data/doc/cxxapi/Hooks_8h-source.html +1 -1
  13. data/doc/cxxapi/annotated.html +1 -1
  14. data/doc/cxxapi/classHooks-members.html +1 -1
  15. data/doc/cxxapi/classHooks.html +1 -1
  16. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
  17. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
  18. data/doc/cxxapi/classes.html +1 -1
  19. data/doc/cxxapi/definitions_8h-source.html +1 -1
  20. data/doc/cxxapi/files.html +1 -1
  21. data/doc/cxxapi/functions.html +1 -1
  22. data/doc/cxxapi/functions_func.html +1 -1
  23. data/doc/cxxapi/graph_legend.html +1 -1
  24. data/doc/cxxapi/group__Configuration.html +1 -23
  25. data/doc/cxxapi/group__Core.html +1 -1
  26. data/doc/cxxapi/group__Hooks.html +1 -1
  27. data/doc/cxxapi/group__Support.html +1 -1
  28. data/doc/cxxapi/main.html +1 -1
  29. data/doc/cxxapi/modules.html +1 -1
  30. data/doc/users_guide_snippets/rackup_specifications.txt +4 -2
  31. data/ext/apache2/Configuration.h +0 -3
  32. data/ext/apache2/Hooks.cpp +5 -3
  33. data/ext/common/ApplicationPoolServer.h +1 -0
  34. data/ext/common/ApplicationPoolServerExecutable.cpp +5 -2
  35. data/ext/common/SpawnManager.h +1 -0
  36. data/ext/common/Utils.cpp +22 -23
  37. data/ext/common/Utils.h +32 -21
  38. data/ext/common/Version.h +31 -0
  39. data/ext/nginx/ContentHandler.c +61 -8
  40. data/ext/nginx/HelperServer.cpp +3 -0
  41. data/ext/nginx/HttpStatusExtractor.h +185 -0
  42. data/ext/nginx/StaticContentHandler.c +18 -3
  43. data/ext/nginx/config +2 -1
  44. data/ext/nginx/ngx_http_passenger_module.c +21 -15
  45. data/ext/oxt/backtrace.cpp +4 -2
  46. data/ext/oxt/spin_lock.hpp +3 -3
  47. data/lib/phusion_passenger/abstract_request_handler.rb +5 -3
  48. data/lib/phusion_passenger/admin_tools/control_process.rb +6 -1
  49. data/lib/phusion_passenger/constants.rb +2 -2
  50. data/lib/phusion_passenger/rack/application_spawner.rb +2 -1
  51. data/lib/phusion_passenger/rack/request_handler.rb +45 -35
  52. data/lib/phusion_passenger/templates/nginx/config_snippets.txt.erb +1 -1
  53. data/lib/phusion_passenger/utils.rb +13 -3
  54. data/misc/rake/cplusplus.rb +7 -0
  55. data/test/ApplicationPoolServer_ApplicationPoolTest.cpp +2 -0
  56. data/test/ApplicationPoolTest.cpp +39 -62
  57. data/test/CxxTestMain.cpp +6 -6
  58. data/test/HttpStatusExtractorTest.cpp +17 -0
  59. data/test/StandardApplicationPoolTest.cpp +2 -0
  60. data/test/UtilsTest.cpp +17 -28
  61. data/test/ruby/abstract_request_handler_spec.rb +3 -7
  62. data/test/ruby/utils_spec.rb +18 -13
  63. data/test/ruby/wsgi/application_spawner_spec.rb +5 -9
  64. data/test/stub/railsapp/app/controllers/{bar_controller_1.rb → bar_controller.rb} +0 -0
  65. data/test/stub/railsapp/app/controllers/bar_controller_1.txt +5 -0
  66. data/test/stub/railsapp/app/controllers/{bar_controller_2.rb → bar_controller_2.txt} +0 -0
  67. data/test/support/Support.h +20 -0
  68. data/test/support/config.rb +13 -0
  69. data/vendor/README +4 -3
  70. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/COPYING +1 -1
  71. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/KNOWN-ISSUES +0 -0
  72. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/README +54 -7
  73. data/vendor/rack-1.0.0-git/Rakefile +164 -0
  74. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack.rb +7 -3
  75. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/adapter/camping.rb +0 -0
  76. data/vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb +37 -0
  77. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/abstract/request.rb +0 -0
  78. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/basic.rb +0 -0
  79. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/md5.rb +1 -1
  80. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/nonce.rb +0 -0
  81. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/params.rb +0 -0
  82. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/auth/digest/request.rb +2 -2
  83. data/vendor/rack-1.0.0-git/lib/rack/auth/openid.rb +480 -0
  84. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/builder.rb +1 -5
  85. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/cascade.rb +0 -0
  86. data/vendor/rack-1.0.0-git/lib/rack/chunked.rb +49 -0
  87. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/commonlogger.rb +0 -0
  88. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/conditionalget.rb +4 -0
  89. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/content_length.rb +7 -3
  90. data/vendor/rack-1.0.0-git/lib/rack/content_type.rb +23 -0
  91. data/vendor/rack-1.0.0-git/lib/rack/deflater.rb +96 -0
  92. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/directory.rb +5 -2
  93. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/file.rb +4 -1
  94. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler.rb +22 -1
  95. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/cgi.rb +7 -3
  96. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/evented_mongrel.rb +0 -0
  97. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/fastcgi.rb +26 -24
  98. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/lsws.rb +7 -4
  99. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/mongrel.rb +5 -3
  100. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/scgi.rb +5 -3
  101. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/swiftiplied_mongrel.rb +0 -0
  102. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/thin.rb +3 -0
  103. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/handler/webrick.rb +11 -5
  104. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/head.rb +0 -0
  105. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/lint.rb +138 -66
  106. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/lobster.rb +0 -0
  107. data/vendor/rack-1.0.0-git/lib/rack/lock.rb +16 -0
  108. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/methodoverride.rb +0 -0
  109. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/mime.rb +4 -4
  110. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/mock.rb +42 -5
  111. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/recursive.rb +0 -0
  112. data/vendor/rack-1.0.0-git/lib/rack/reloader.rb +106 -0
  113. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/request.rb +46 -10
  114. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/response.rb +15 -3
  115. data/vendor/rack-1.0.0-git/lib/rack/rewindable_input.rb +98 -0
  116. data/vendor/rack-1.0.0-git/lib/rack/session/abstract/id.rb +142 -0
  117. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/session/cookie.rb +2 -0
  118. data/vendor/rack-1.0.0-git/lib/rack/session/memcache.rb +109 -0
  119. data/vendor/rack-1.0.0-git/lib/rack/session/pool.rb +100 -0
  120. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/showexceptions.rb +2 -1
  121. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/showstatus.rb +1 -1
  122. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/static.rb +0 -0
  123. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/urlmap.rb +12 -5
  124. data/vendor/{rack-0.9.1 → rack-1.0.0-git}/lib/rack/utils.rb +212 -65
  125. metadata +71 -170
  126. data/doc/rdoc/classes/ConditionVariable.html +0 -194
  127. data/doc/rdoc/classes/Exception.html +0 -120
  128. data/doc/rdoc/classes/GC.html +0 -113
  129. data/doc/rdoc/classes/IO.html +0 -169
  130. data/doc/rdoc/classes/PhusionPassenger.html +0 -238
  131. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -153
  132. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -506
  133. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -692
  134. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
  135. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
  136. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
  137. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
  138. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -598
  139. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -140
  140. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +0 -264
  141. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess/Instance.html +0 -138
  142. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -154
  143. data/doc/rdoc/classes/PhusionPassenger/Application.html +0 -283
  144. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
  145. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
  146. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -175
  147. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
  148. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
  149. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -489
  150. data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +0 -350
  151. data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
  152. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -185
  153. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -184
  154. data/doc/rdoc/classes/PhusionPassenger/Railz.html +0 -95
  155. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +0 -419
  156. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner/Error.html +0 -98
  157. data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +0 -200
  158. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +0 -443
  159. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner/Error.html +0 -98
  160. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +0 -154
  161. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -402
  162. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
  163. data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -694
  164. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
  165. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
  166. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -188
  167. data/doc/rdoc/classes/PlatformInfo.html +0 -831
  168. data/doc/rdoc/classes/RakeExtensions.html +0 -197
  169. data/doc/rdoc/classes/Signal.html +0 -134
  170. data/doc/rdoc/created.rid +0 -1
  171. data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -240
  172. data/doc/rdoc/files/README.html +0 -157
  173. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +0 -92
  174. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -129
  175. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -131
  176. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
  177. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -130
  178. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +0 -129
  179. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
  180. data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +0 -127
  181. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
  182. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
  183. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -134
  184. data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +0 -122
  185. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
  186. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -126
  187. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -122
  188. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
  189. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -127
  190. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -133
  191. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -126
  192. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +0 -143
  193. data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +0 -126
  194. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +0 -145
  195. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +0 -127
  196. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
  197. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -161
  198. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -175
  199. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -129
  200. data/doc/rdoc/files/misc/rake/extensions_rb.html +0 -130
  201. data/doc/rdoc/fr_class_index.html +0 -90
  202. data/doc/rdoc/fr_file_index.html +0 -76
  203. data/doc/rdoc/fr_method_index.html +0 -195
  204. data/doc/rdoc/index.html +0 -26
  205. data/doc/rdoc/rdoc-style.css +0 -187
  206. data/vendor/rack-0.9.1/AUTHORS +0 -8
  207. data/vendor/rack-0.9.1/ChangeLog +0 -1423
  208. data/vendor/rack-0.9.1/Rakefile +0 -188
  209. data/vendor/rack-0.9.1/SPEC +0 -129
  210. data/vendor/rack-0.9.1/lib/rack/auth/abstract/handler.rb +0 -28
  211. data/vendor/rack-0.9.1/lib/rack/auth/openid.rb +0 -438
  212. data/vendor/rack-0.9.1/lib/rack/deflater.rb +0 -87
  213. data/vendor/rack-0.9.1/lib/rack/reloader.rb +0 -64
  214. data/vendor/rack-0.9.1/lib/rack/session/abstract/id.rb +0 -153
  215. data/vendor/rack-0.9.1/lib/rack/session/memcache.rb +0 -97
  216. data/vendor/rack-0.9.1/lib/rack/session/pool.rb +0 -73
data/Rakefile CHANGED
@@ -73,21 +73,22 @@ task :clobber
73
73
 
74
74
  ##### Ruby C extension
75
75
 
76
- subdir 'ext/phusion_passenger' do
77
- task :native_support => ["native_support.#{LIBEXT}"]
78
-
79
- file 'Makefile' => 'extconf.rb' do
80
- sh "#{RUBY} extconf.rb"
81
- end
82
-
83
- file "native_support.#{LIBEXT}" => ['Makefile', 'native_support.c'] do
84
- sh "make"
85
- end
86
-
87
- task :clean do
88
- sh "make clean" if File.exist?('Makefile')
89
- sh "rm -f Makefile"
90
- end
76
+ task :native_support => "ext/phusion_passenger/native_support.#{LIBEXT}"
77
+
78
+ file 'ext/phusion_passenger/Makefile' => 'ext/phusion_passenger/extconf.rb' do
79
+ sh "cd ext/phusion_passenger && #{RUBY} extconf.rb"
80
+ end
81
+
82
+ file "ext/phusion_passenger/native_support.#{LIBEXT}" => [
83
+ 'ext/phusion_passenger/Makefile',
84
+ 'ext/phusion_passenger/native_support.c'
85
+ ] do
86
+ sh "cd ext/phusion_passenger && make"
87
+ end
88
+
89
+ task :clean do
90
+ sh "cd ext/phusion_passenger && make clean" if File.exist?('ext/phusion_passenger/Makefile')
91
+ sh "rm -f ext/phusion_passenger/Makefile"
91
92
  end
92
93
 
93
94
 
@@ -95,51 +96,47 @@ end
95
96
 
96
97
  def define_libboost_oxt_task(output_dir, extra_compiler_flags = nil)
97
98
  output_file = "#{output_dir}/libboost_oxt.a"
98
- objects_output_dir = "#{output_dir}/libboost_oxt"
99
- objects_output_path = Pathname.new(objects_output_dir).expand_path
100
- ext_path = Pathname.new("ext").expand_path
101
-
102
- file(output_file =>
103
- Dir['ext/boost/src/*.cpp'] +
104
- Dir['ext/boost/src/pthread/*.cpp'] +
105
- Dir['ext/oxt/*.cpp'] +
106
- Dir['ext/oxt/*.hpp'] +
107
- Dir['ext/oxt/detail/*.hpp']
108
- ) do
109
- sh "mkdir -p #{objects_output_dir}/boost #{objects_output_dir}/oxt"
99
+ output_dir_base = "#{output_dir}/libboost_oxt"
100
+ flags = "-Iext #{extra_compiler_flags} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
101
+
102
+ # Define compilation targets for .cpp files in ext/boost/src/pthread.
103
+ boost_object_files = []
104
+ Dir['ext/boost/src/pthread/*.cpp'].each do |source_file|
105
+ object_name = File.basename(source_file.sub(/\.cpp$/, '.o'))
106
+ boost_output_dir = "#{output_dir_base}/boost"
107
+ object_file = "#{boost_output_dir}/#{object_name}"
108
+ boost_object_files << object_file
110
109
 
111
- Dir.chdir("#{objects_output_dir}/boost") do
112
- puts "### In #{objects_output_dir}/boost:"
113
- current_dir = Pathname.new(".").expand_path
114
- ext_dir = ext_path.relative_path_from(current_dir)
115
- flags = "-I#{ext_dir} #{extra_compiler_flags} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
116
-
117
- # Compling "pthread/*.cpp" doesn't work on some systems,
118
- # so we compile each cpp file invidually instead.
119
- Dir["#{ext_dir}/boost/src/pthread/*.cpp"].each do |file|
120
- compile_cxx(file, flags)
121
- end
122
- puts
110
+ file object_file => source_file do
111
+ sh "mkdir -p #{boost_output_dir}" if !File.directory?(boost_output_dir)
112
+ compile_cxx(source_file, "#{flags} -o #{object_file}")
123
113
  end
114
+ end
115
+
116
+ # Define compilation targets for .cpp files in ext/oxt.
117
+ oxt_object_files = []
118
+ oxt_dependency_files = Dir["ext/oxt/*.hpp"] + Dir["ext/oxt/detail/*.hpp"]
119
+ Dir['ext/oxt/*.cpp'].each do |source_file|
120
+ object_name = File.basename(source_file.sub(/\.cpp$/, '.o'))
121
+ oxt_output_dir = "#{output_dir_base}/oxt"
122
+ object_file = "#{oxt_output_dir}/#{object_name}"
123
+ oxt_object_files << object_file
124
124
 
125
- Dir.chdir("#{objects_output_dir}/oxt") do
126
- puts "### In #{objects_output_dir}/oxt:"
127
- current_dir = Pathname.new(".").expand_path
128
- ext_dir = ext_path.relative_path_from(current_dir)
129
- flags = "-I#{ext_dir} #{extra_compiler_flags} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
130
- Dir["#{ext_dir}/oxt/*.cpp"].each do |file|
131
- compile_cxx(file, flags)
132
- end
133
- puts
125
+ file object_file => [source_file, *oxt_dependency_files] do
126
+ sh "mkdir -p #{oxt_output_dir}" if !File.directory?(oxt_output_dir)
127
+ compile_cxx(source_file, "#{flags} -o #{object_file}")
134
128
  end
135
-
129
+ end
130
+
131
+ file(output_file => boost_object_files + oxt_object_files) do
132
+ sh "mkdir -p #{output_dir_base}/boost #{output_dir_base}/oxt"
136
133
  create_static_library(output_file,
137
- "#{objects_output_dir}/boost/*.o " <<
138
- "#{objects_output_dir}/oxt/*.o")
134
+ "#{output_dir_base}/boost/*.o " <<
135
+ "#{output_dir_base}/oxt/*.o")
139
136
  end
140
137
 
141
138
  task :clean do
142
- sh "rm -rf #{output_file} #{objects_output_dir}"
139
+ sh "rm -rf #{output_file} #{output_dir_base}"
143
140
  end
144
141
 
145
142
  return output_file
@@ -156,37 +153,26 @@ def define_common_library_task(output_dir, extra_compiler_flags = nil,
156
153
  extra_linker_flags = nil)
157
154
  static_library = "#{output_dir}/libpassenger_common.a"
158
155
  objects_output_dir = "#{output_dir}/libpassenger_common"
159
- objects_output_path = Pathname.new(objects_output_dir).expand_path
160
- ext_path = Pathname.new("ext").expand_path
161
156
  targets = [static_library]
162
157
 
163
- file(static_library => [
164
- 'ext/common/Utils.h',
165
- 'ext/common/Utils.cpp',
166
- 'ext/common/Logging.h',
167
- 'ext/common/Logging.cpp',
168
- 'ext/common/SystemTime.h',
169
- 'ext/common/SystemTime.cpp',
170
- 'ext/common/CachedFileStat.h',
171
- 'ext/common/CachedFileStat.cpp'
172
- ]) do
173
- sh "mkdir -p #{objects_output_dir}"
158
+ # Define compilation targets for the object files in libpassenger_common.
159
+ flags = "-Iext -Iext/common #{extra_compiler_flags} "
160
+ flags << "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
161
+ common_object_files = []
162
+ ['Utils.cpp', 'Logging.cpp', 'SystemTime.cpp', 'CachedFileStat.cpp'].each do |source_file|
163
+ object_name = source_file.sub(/\.cpp$/, '.o')
164
+ object_file = "#{objects_output_dir}/#{object_name}"
165
+ header_file = source_file.sub(/\.cpp$/, '.h')
166
+ common_object_files << object_file
174
167
 
175
- Dir.chdir(objects_output_dir) do
176
- puts "### In #{objects_output_dir}:"
177
- current_dir = Pathname.new(".").expand_path
178
- ext_dir = ext_path.relative_path_from(current_dir)
179
- flags = "-I#{ext_dir} -I#{ext_dir}/common #{extra_compiler_flags} "
180
- flags << "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
181
-
182
- compile_cxx("#{ext_dir}/common/Utils.cpp", flags)
183
- compile_cxx("#{ext_dir}/common/Logging.cpp", flags)
184
- compile_cxx("#{ext_dir}/common/SystemTime.cpp", flags)
185
- compile_cxx("#{ext_dir}/common/CachedFileStat.cpp", flags)
186
-
187
- puts
168
+ file object_file => ["ext/common/#{source_file}", "ext/common/#{header_file}"] do
169
+ sh "mkdir -p #{objects_output_dir}" if !File.directory?(objects_output_dir)
170
+ compile_cxx("ext/common/#{source_file}", "#{flags} -o #{object_file}")
188
171
  end
189
-
172
+ end
173
+
174
+ file(static_library => common_object_files) do
175
+ sh "mkdir -p #{objects_output_dir}"
190
176
  create_static_library(static_library, "#{objects_output_dir}/*.o")
191
177
  end
192
178
 
@@ -256,6 +242,7 @@ end
256
242
  ext/common/Application.h
257
243
  ext/common/MessageChannel.h
258
244
  ext/common/PoolOptions.h
245
+ ext/common/Version.h
259
246
  ext/common/Utils.h)
260
247
  }
261
248
  APACHE2_OBJECTS = APACHE2_INPUT_FILES.keys
@@ -84,7 +84,7 @@ class Installer < PhusionPassenger::AbstractInstaller
84
84
  nginx_config_already_exists_before_installing = nginx_config_exists?(nginx_prefix)
85
85
  compile_passenger_support_files || exit(1)
86
86
  if install_nginx(nginx_source_dir, nginx_prefix, extra_nginx_configure_flags)
87
- if nginx_config_already_exists_before_installing
87
+ if nginx_config_already_exists_before_installing || !locate_nginx_config_file(nginx_prefix)
88
88
  show_passenger_config_snippets(nginx_prefix)
89
89
  else
90
90
  insert_passenger_config_snippets(nginx_prefix)
@@ -219,7 +219,7 @@ class MemoryStats
219
219
  if threads_known
220
220
  p.pid, p.ppid, p.threads, p.vm_size, p.rss, p.name = line.split(/ +/, 6)
221
221
  else
222
- p.pid, p.ppid, p.vm_size, p.rss, p.name = line.split(/ +/, 6)
222
+ p.pid, p.ppid, p.vm_size, p.rss, p.name = line.split(/ +/, 5)
223
223
  p.threads = "?"
224
224
  end
225
225
  p.name.sub!(/\Aruby: /, '')
@@ -42,15 +42,21 @@ begin
42
42
  # we exit without loading the rest of Passenger. If Apache doesn't close
43
43
  # the connection within 4 seconds then we continue with loading Passenger,
44
44
  # so that loading doesn't happen during the first spawn.
45
- if select([input], nil, nil, 4) && input.eof?
45
+ begin
46
+ if select([input], nil, nil, 4) && input.eof?
47
+ exit
48
+ end
49
+ rescue Interrupt
46
50
  exit
47
51
  end
48
52
 
49
- require 'phusion_passenger/spawn_manager'
50
53
  require 'phusion_passenger/utils'
51
54
  if defined?(PhusionPassenger::NativeSupport)
52
55
  PhusionPassenger::NativeSupport.disable_stdio_buffering
53
56
  end
57
+ PhusionPassenger::Utils.passenger_tmpdir = ARGV[0]
58
+
59
+ require 'phusion_passenger/spawn_manager'
54
60
  spawn_manager = PhusionPassenger::SpawnManager.new
55
61
  spawn_manager.start_synchronously(input)
56
62
  spawn_manager.cleanup
@@ -544,7 +544,7 @@ if it doesn&#8217;t.</p></div>
544
544
  <div class="sectionbody">
545
545
  <h3 id="_generic_installation_instructions">2.1. Generic installation instructions</h3>
546
546
  <h4 id="install_passenger">2.1.1. Overview of download and installation methods</h4>
547
- <div class="paragraph"><p>There are two ways to install Phusion Passenger:</p></div>
547
+ <div class="paragraph"><p>There are three ways to install Phusion Passenger:</p></div>
548
548
  <div class="olist arabic"><ol class="arabic">
549
549
  <li>
550
550
  <p>
@@ -555,20 +555,21 @@ By installing the Phusion Passenger gem, as instructed on the
555
555
  </li>
556
556
  <li>
557
557
  <p>
558
- By downloading a native Linux package (e.g. Debian package) from the
559
- Phusion Passenger website.
558
+ By downloading the source tarball from the Phusion Passenger website
559
+ (<em>passenger-x.x.x.tar.gz</em>).
560
560
  </p>
561
561
  </li>
562
562
  <li>
563
563
  <p>
564
- By downloading the source tarball from the Phusion Passenger website
565
- (<em>passenger-x.x.x.tar.gz</em>).
564
+ By downloading a native Linux package (e.g. Debian package) from the
565
+ Phusion Passenger website.
566
566
  </p>
567
567
  </li>
568
568
  </ol></div>
569
569
  <div class="paragraph"><p>In our opinion, installing the gem or the native package is easiest.</p></div>
570
570
  <div class="paragraph"><p>Phusion Passenger provides an easy-to-use installer for installing the Phusion
571
- Passenger Apache module (<em>mod_passenger</em>).</p></div>
571
+ Passenger Apache module, in case you choose to install via the gem or the
572
+ source tarball.</p></div>
572
573
  <div class="admonitionblock">
573
574
  <table><tr>
574
575
  <td class="icon">
@@ -579,16 +580,12 @@ as <em>root</em>. If the installer fails because of permission errors, it will t
579
580
  you.</td>
580
581
  </tr></table>
581
582
  </div>
582
- <h4 id="specifying_correct_apache_install">2.1.2. Specifying the correct Apache installation</h4>
583
- <div class="admonitionblock">
584
- <table><tr>
585
- <td class="icon">
586
- <img src="./images/icons/note.png" alt="Note" />
587
- </td>
588
- <td class="content">You can skip this section if you&#8217;ve installed Phusion Passenger via a
589
- native Linux package, because no compilation is necessary.</td>
590
- </tr></table>
591
- </div>
583
+ <h4 id="_preparation">2.1.2. Preparation</h4>
584
+ <div class="paragraph"><p>If you want to install Phusion Passenger via the gem or the source tarball,
585
+ then some preparation might be required. You can skip this subsection if
586
+ you&#8217;re installing Phusion Passenger via a native Linux package, because no
587
+ compilation is necessary.</p></div>
588
+ <h5 id="specifying_correct_apache_install">Specifying the correct Apache installation</h5>
592
589
  <div class="paragraph"><p>If your system has multiple Apache installations (this is likely the case on
593
590
  MacOS X), then you will need to tell the Phusion Passenger installer which one
594
591
  to use. If you only have one Apache installation (the case on most Linux
@@ -612,16 +609,7 @@ environment variable. Suppose that you want to use the Apache installation in
612
609
  be located in the <tt>sbin</tt> folder instead of the <tt>bin</tt> folder.</td>
613
610
  </tr></table>
614
611
  </div>
615
- <h4 id="specifying_ruby_installation">2.1.3. Specifying the correct Ruby installation</h4>
616
- <div class="admonitionblock">
617
- <table><tr>
618
- <td class="icon">
619
- <img src="./images/icons/note.png" alt="Note" />
620
- </td>
621
- <td class="content">You can skip this section if you&#8217;ve installed Phusion Passenger via a
622
- native Linux package, because no compilation is necessary.</td>
623
- </tr></table>
624
- </div>
612
+ <h5 id="specifying_ruby_installation">Specifying the correct Ruby installation</h5>
625
613
  <div class="paragraph"><p>If your system has multiple Ruby installations&#8201;&#8212;&#8201;which is likely the case on
626
614
  MacOS X, or if you&#8217;ve also installed
627
615
  <a href="http://www.rubyenterpriseedition.com">Ruby Enterprise Edition</a>&#8201;&#8212;&#8201;then you
@@ -649,7 +637,7 @@ following Ruby installations:</p></div>
649
637
  <div class="content">
650
638
  <pre><tt>export PATH=/opt/myruby/bin:$PATH</tt></pre>
651
639
  </div></div>
652
- <h4 id="_installing_via_the_gem">2.1.4. Installing via the gem</h4>
640
+ <h4 id="_installing_via_the_gem">2.1.3. Installing via the gem</h4>
653
641
  <div class="paragraph"><p>Please install the gem and then run the Phusion Passenger installer, by typing the
654
642
  following commands:</p></div>
655
643
  <div class="listingblock">
@@ -658,17 +646,7 @@ following commands:</p></div>
658
646
  passenger-install-apache2-module</tt></pre>
659
647
  </div></div>
660
648
  <div class="paragraph"><p>Please follow the instructions given by the installer.</p></div>
661
- <h4 id="_installing_via_a_native_linux_package">2.1.5. Installing via a native Linux package</h4>
662
- <div class="paragraph"><p>John Leach from Brightbox has kindly provided an Ubuntu Hardy package for Phusion Passenger. The package is available from the <a href="http://apt.brightbox.net">Brightbox repository</a>.</p></div>
663
- <div class="paragraph"><p>Please install the native Linux package, e.g.:</p></div>
664
- <div class="listingblock">
665
- <div class="content">
666
- <pre><tt>sudo sh -c 'echo "deb http://apt.brightbox.net hardy main" &gt; /etc/apt/sources.list.d/brightbox.list'
667
- sudo sh -c 'wget -q -O - http://apt.brightbox.net/release.asc | apt-key add -'
668
- sudo apt-get update
669
- sudo apt-get install libapache2-mod-passenger</tt></pre>
670
- </div></div>
671
- <h4 id="_installing_via_the_source_tarball">2.1.6. Installing via the source tarball</h4>
649
+ <h4 id="_installing_via_the_source_tarball">2.1.4. Installing via the source tarball</h4>
672
650
  <div class="paragraph"><p>Extract the tarball to whatever location you prefer. <strong>The Phusion Passenger files
673
651
  are to reside in that location permanently.</strong> For example, if you would like
674
652
  Phusion Passenger to reside in <tt>/opt/passenger-x.x.x</tt>:</p></div>
@@ -692,6 +670,16 @@ tar xzvf ~/YourDownloadsFolder/passenger-x.x.x.tar.gz</tt></pre>
692
670
  installation. Furthermore, the <em>passenger-x.x.x</em> folder must be accessible by Apache.</td>
693
671
  </tr></table>
694
672
  </div>
673
+ <h4 id="_installing_via_a_native_linux_package">2.1.5. Installing via a native Linux package</h4>
674
+ <div class="paragraph"><p>John Leach from Brightbox has kindly provided an Ubuntu Hardy package for Phusion Passenger. The package is available from the <a href="http://apt.brightbox.net">Brightbox repository</a>.</p></div>
675
+ <div class="paragraph"><p>Please install the native Linux package, e.g.:</p></div>
676
+ <div class="listingblock">
677
+ <div class="content">
678
+ <pre><tt>sudo sh -c 'echo "deb http://apt.brightbox.net hardy main" &gt; /etc/apt/sources.list.d/brightbox.list'
679
+ sudo sh -c 'wget -q -O - http://apt.brightbox.net/release.asc | apt-key add -'
680
+ sudo apt-get update
681
+ sudo apt-get install libapache2-mod-passenger</tt></pre>
682
+ </div></div>
695
683
  <h3 id="_operating_system_specific_instructions_and_information">2.2. Operating system-specific instructions and information</h3>
696
684
  <h4 id="_macos_x">2.2.1. MacOS X</h4>
697
685
  <div class="paragraph"><p>Ben Ruebenstein has written an excellent
@@ -700,14 +688,8 @@ on installing Phusion Passenger on OS X</a>.</p></div>
700
688
  <h4 id="_ubuntu_linux">2.2.2. Ubuntu Linux</h4>
701
689
  <div class="paragraph"><p>Ben Hughes has written an <a href="http://www.railsgarden.com/2008/04/12/configurating-passenger-mod_rails-on-slicehost-with-ubuntu-710/">article on installing Phusion Passenger on Ubuntu</a>.</p></div>
702
690
  <h4 id="_opensolaris">2.2.3. OpenSolaris</h4>
703
- <div class="olist upperalpha"><ol class="upperalpha">
704
- <li>
705
- <p>
706
- Aaron Farr has written a <a href="http://cubiclemuses.com/cm/articles/2009/04/09/rails-passenger-open-solaris-ec2/">guide</a>
707
- about setting up Ruby on Rails and Phusion Passenger on OpenSolaris and EC2.
708
- </p>
709
- </li>
710
- </ol></div>
691
+ <div class="paragraph"><p>J Aaron Farr has written a <a href="http://cubiclemuses.com/cm/articles/2009/04/09/rails-passenger-open-solaris-ec2/">guide</a>
692
+ about setting up Ruby on Rails and Phusion Passenger on OpenSolaris and EC2.</p></div>
711
693
  </div>
712
694
  <h2 id="_deploying_a_ruby_on_rails_application">3. Deploying a Ruby on Rails application</h2>
713
695
  <div class="sectionbody">
@@ -1049,9 +1031,11 @@ run Merb::Rack::Application.new</tt></pre>
1049
1031
  <h4 id="_ramaze">4.5.5. Ramaze</h4>
1050
1032
  <div class="listingblock">
1051
1033
  <div class="content">
1052
- <pre><tt>require "start"
1034
+ <pre><tt>require "rubygems"
1035
+ require "ramaze"
1053
1036
  Ramaze.trait[:essentials].delete Ramaze::Adapter
1054
- Ramaze.start :force =&gt; true
1037
+ require "start"
1038
+ Ramaze.start!
1055
1039
  run Ramaze::Adapter::Base</tt></pre>
1056
1040
  </div></div>
1057
1041
  <h4 id="_sinatra">4.5.6. Sinatra</h4>
@@ -3138,7 +3122,7 @@ has no effect.</p></div>
3138
3122
  </div>
3139
3123
  <div id="footer">
3140
3124
  <div id="footer-text">
3141
- Last updated 2009-04-16 19:42:11 CEST
3125
+ Last updated 2009-04-25 13:39:21 CEST
3142
3126
  </div>
3143
3127
  </div>
3144
3128
  </body>
@@ -54,30 +54,34 @@ if it doesn't.
54
54
  [[install_passenger]]
55
55
  ==== Overview of download and installation methods ====
56
56
 
57
- There are two ways to install Phusion Passenger:
57
+ There are three ways to install Phusion Passenger:
58
58
 
59
59
  1. By installing the Phusion Passenger gem, as instructed on the
60
60
  link:http://www.modrails.com/install.html[``Install'' page on the Phusion
61
61
  Passenger website].
62
- 2. By downloading a native Linux package (e.g. Debian package) from the
63
- Phusion Passenger website.
64
- 3. By downloading the source tarball from the Phusion Passenger website
62
+ 2. By downloading the source tarball from the Phusion Passenger website
65
63
  ('passenger-x.x.x.tar.gz').
64
+ 3. By downloading a native Linux package (e.g. Debian package) from the
65
+ Phusion Passenger website.
66
66
 
67
67
  In our opinion, installing the gem or the native package is easiest.
68
68
 
69
69
  Phusion Passenger provides an easy-to-use installer for installing the Phusion
70
- Passenger Apache module ('mod_passenger').
70
+ Passenger Apache module, in case you choose to install via the gem or the
71
+ source tarball.
71
72
 
72
73
  TIP: You might have to run the installation commands in the following sections
73
74
  as 'root'. If the installer fails because of permission errors, it will tell
74
75
  you.
75
76
 
76
- [[specifying_correct_apache_install]]
77
- ==== Specifying the correct Apache installation ====
77
+ ==== Preparation
78
+ If you want to install Phusion Passenger via the gem or the source tarball,
79
+ then some preparation might be required. You can skip this subsection if
80
+ you're installing Phusion Passenger via a native Linux package, because no
81
+ compilation is necessary.
78
82
 
79
- NOTE: You can skip this section if you've installed Phusion Passenger via a
80
- native Linux package, because no compilation is necessary.
83
+ [[specifying_correct_apache_install]]
84
+ ===== Specifying the correct Apache installation =====
81
85
 
82
86
  If your system has multiple Apache installations (this is likely the case on
83
87
  MacOS X), then you will need to tell the Phusion Passenger installer which one
@@ -98,10 +102,7 @@ NOTE: On some systems, the `apxs` program might be called `apxs2`, and it might
98
102
  be located in the `sbin` folder instead of the `bin` folder.
99
103
 
100
104
  [[specifying_ruby_installation]]
101
- ==== Specifying the correct Ruby installation ====
102
-
103
- NOTE: You can skip this section if you've installed Phusion Passenger via a
104
- native Linux package, because no compilation is necessary.
105
+ ===== Specifying the correct Ruby installation =====
105
106
 
106
107
  If your system has multiple Ruby installations -- which is likely the case on
107
108
  MacOS X, or if you've also installed
@@ -136,19 +137,6 @@ passenger-install-apache2-module
136
137
  Please follow the instructions given by the installer.
137
138
 
138
139
 
139
- ==== Installing via a native Linux package ====
140
-
141
- John Leach from Brightbox has kindly provided an Ubuntu Hardy package for Phusion Passenger. The package is available from the link:http://apt.brightbox.net[Brightbox repository].
142
-
143
- Please install the native Linux package, e.g.:
144
- ------------------------------------------------------
145
- sudo sh -c 'echo "deb http://apt.brightbox.net hardy main" > /etc/apt/sources.list.d/brightbox.list'
146
- sudo sh -c 'wget -q -O - http://apt.brightbox.net/release.asc | apt-key add -'
147
- sudo apt-get update
148
- sudo apt-get install libapache2-mod-passenger
149
- ------------------------------------------------------
150
-
151
-
152
140
  ==== Installing via the source tarball ====
153
141
 
154
142
  Extract the tarball to whatever location you prefer. *The Phusion Passenger files
@@ -169,6 +157,19 @@ IMPORTANT: Please do not remove the 'passenger-x.x.x' folder after
169
157
  installation. Furthermore, the 'passenger-x.x.x' folder must be accessible by Apache.
170
158
 
171
159
 
160
+ ==== Installing via a native Linux package ====
161
+
162
+ John Leach from Brightbox has kindly provided an Ubuntu Hardy package for Phusion Passenger. The package is available from the link:http://apt.brightbox.net[Brightbox repository].
163
+
164
+ Please install the native Linux package, e.g.:
165
+ ------------------------------------------------------
166
+ sudo sh -c 'echo "deb http://apt.brightbox.net hardy main" > /etc/apt/sources.list.d/brightbox.list'
167
+ sudo sh -c 'wget -q -O - http://apt.brightbox.net/release.asc | apt-key add -'
168
+ sudo apt-get update
169
+ sudo apt-get install libapache2-mod-passenger
170
+ ------------------------------------------------------
171
+
172
+
172
173
  === Operating system-specific instructions and information ===
173
174
 
174
175
  ==== MacOS X ====
@@ -183,7 +184,7 @@ Ben Hughes has written an link:http://www.railsgarden.com/2008/04/12/configurati
183
184
 
184
185
  ==== OpenSolaris ====
185
186
 
186
- J. Aaron Farr has written a link:http://cubiclemuses.com/cm/articles/2009/04/09/rails-passenger-open-solaris-ec2/[guide]
187
+ J Aaron Farr has written a link:http://cubiclemuses.com/cm/articles/2009/04/09/rails-passenger-open-solaris-ec2/[guide]
187
188
  about setting up Ruby on Rails and Phusion Passenger on OpenSolaris and EC2.
188
189
 
189
190