passenger 2.1.3 → 2.2.0

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 (398) hide show
  1. data/DEVELOPERS.TXT +2 -0
  2. data/INSTALL +3 -1
  3. data/LICENSE +19 -355
  4. data/NEWS +3 -0
  5. data/README +11 -4
  6. data/Rakefile +435 -236
  7. data/bin/passenger-config +20 -14
  8. data/bin/passenger-install-apache2-module +67 -201
  9. data/bin/passenger-install-nginx-module +477 -0
  10. data/bin/passenger-make-enterprisey +17 -12
  11. data/bin/passenger-memory-stats +33 -23
  12. data/bin/passenger-spawn-server +17 -12
  13. data/bin/passenger-status +18 -13
  14. data/bin/passenger-stress-test +17 -12
  15. data/doc/{Users guide.html → Users guide Apache.html } +79 -61
  16. data/doc/{Users guide.txt → Users guide Apache.txt } +43 -939
  17. data/doc/Users guide Nginx.html +2276 -0
  18. data/doc/Users guide Nginx.txt +776 -0
  19. data/doc/cxxapi/ApplicationPoolServer_8h-source.html +9 -4
  20. data/doc/cxxapi/ApplicationPool_8h-source.html +9 -4
  21. data/doc/cxxapi/Application_8h-source.html +26 -21
  22. data/doc/cxxapi/Bucket_8h-source.html +54 -44
  23. data/doc/cxxapi/CachedFileStat_8h-source.html +9 -4
  24. data/doc/cxxapi/Configuration_8h-source.html +357 -339
  25. data/doc/cxxapi/DirectoryMapper_8h-source.html +294 -280
  26. data/doc/cxxapi/DummySpawnManager_8h-source.html +9 -4
  27. data/doc/cxxapi/Exceptions_8h-source.html +9 -4
  28. data/doc/cxxapi/FileChecker_8h-source.html +9 -4
  29. data/doc/cxxapi/Hooks_8h-source.html +50 -40
  30. data/doc/cxxapi/Logging_8h-source.html +9 -4
  31. data/doc/cxxapi/MessageChannel_8h-source.html +20 -15
  32. data/doc/cxxapi/PoolOptions_8h-source.html +10 -5
  33. data/doc/cxxapi/SpawnManager_8h-source.html +9 -4
  34. data/doc/cxxapi/StandardApplicationPool_8h-source.html +10 -5
  35. data/doc/cxxapi/SystemTime_8h-source.html +9 -4
  36. data/doc/cxxapi/Utils_8h-source.html +242 -214
  37. data/doc/cxxapi/annotated.html +4 -28
  38. data/doc/cxxapi/classClient-members.html +4 -4
  39. data/doc/cxxapi/classClient.html +14 -11
  40. data/doc/cxxapi/classHooks-members.html +4 -5
  41. data/doc/cxxapi/classHooks.html +26 -24
  42. data/doc/cxxapi/classPassenger_1_1Application-members.html +4 -4
  43. data/doc/cxxapi/classPassenger_1_1Application.html +40 -37
  44. data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +4 -4
  45. data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +95 -92
  46. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +4 -4
  47. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +26 -23
  48. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.map +1 -1
  49. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.md5 +1 -1
  50. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
  51. data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +17 -17
  52. data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +139 -136
  53. data/doc/cxxapi/classPassenger_1_1BufferedUpload-members.html +4 -4
  54. data/doc/cxxapi/classPassenger_1_1BufferedUpload.html +13 -10
  55. data/doc/cxxapi/classPassenger_1_1BusyException-members.html +4 -4
  56. data/doc/cxxapi/classPassenger_1_1BusyException.html +11 -8
  57. data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +4 -4
  58. data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +11 -8
  59. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +4 -5
  60. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +45 -43
  61. data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +4 -4
  62. data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +13 -10
  63. data/doc/cxxapi/classPassenger_1_1FileChecker-members.html +4 -4
  64. data/doc/cxxapi/classPassenger_1_1FileChecker.html +22 -19
  65. data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +4 -4
  66. data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +12 -9
  67. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +1 -1
  68. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +1 -1
  69. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
  70. data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +4 -4
  71. data/doc/cxxapi/classPassenger_1_1FileSystemException.html +14 -11
  72. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +1 -1
  73. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +1 -1
  74. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
  75. data/doc/cxxapi/classPassenger_1_1IOException-members.html +4 -4
  76. data/doc/cxxapi/classPassenger_1_1IOException.html +12 -9
  77. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +1 -1
  78. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +1 -1
  79. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
  80. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +4 -4
  81. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +228 -225
  82. data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +4 -4
  83. data/doc/cxxapi/classPassenger_1_1RuntimeException.html +11 -8
  84. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +4 -4
  85. data/doc/cxxapi/classPassenger_1_1SpawnException.html +14 -11
  86. data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +4 -4
  87. data/doc/cxxapi/classPassenger_1_1SpawnManager.html +50 -47
  88. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +4 -4
  89. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +73 -70
  90. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.map +1 -1
  91. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.md5 +1 -1
  92. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
  93. data/doc/cxxapi/classPassenger_1_1SystemException-members.html +4 -4
  94. data/doc/cxxapi/classPassenger_1_1SystemException.html +17 -14
  95. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +1 -1
  96. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +1 -1
  97. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
  98. data/doc/cxxapi/classPassenger_1_1SystemTime-members.html +4 -4
  99. data/doc/cxxapi/classPassenger_1_1SystemTime.html +14 -11
  100. data/doc/cxxapi/classes.html +35 -0
  101. data/doc/cxxapi/definitions_8h-source.html +9 -4
  102. data/doc/cxxapi/doxygen.css +311 -303
  103. data/doc/cxxapi/files.html +9 -18
  104. data/doc/cxxapi/functions.html +5 -224
  105. data/doc/cxxapi/functions_func.html +5 -185
  106. data/doc/cxxapi/functions_type.html +4 -4
  107. data/doc/cxxapi/functions_vars.html +4 -4
  108. data/doc/cxxapi/graph_legend.dot +19 -19
  109. data/doc/cxxapi/graph_legend.html +5 -5
  110. data/doc/cxxapi/graph_legend.png +0 -0
  111. data/doc/cxxapi/group__Configuration.html +11 -13
  112. data/doc/cxxapi/group__Configuration.png +0 -0
  113. data/doc/cxxapi/group__Core.html +10 -12
  114. data/doc/cxxapi/group__Core.png +0 -0
  115. data/doc/cxxapi/group__Exceptions.html +5 -7
  116. data/doc/cxxapi/group__Hooks.html +5 -7
  117. data/doc/cxxapi/group__Hooks.png +0 -0
  118. data/doc/cxxapi/group__Support.html +5 -624
  119. data/doc/cxxapi/hierarchy.html +6 -6
  120. data/doc/cxxapi/inherit__graph__0.map +1 -1
  121. data/doc/cxxapi/inherit__graph__0.md5 +1 -1
  122. data/doc/cxxapi/inherit__graph__0.png +0 -0
  123. data/doc/cxxapi/inherit__graph__1.map +1 -1
  124. data/doc/cxxapi/inherit__graph__1.md5 +1 -1
  125. data/doc/cxxapi/inherit__graph__1.png +0 -0
  126. data/doc/cxxapi/inherit__graph__10.map +1 -1
  127. data/doc/cxxapi/inherit__graph__10.md5 +1 -1
  128. data/doc/cxxapi/inherit__graph__10.png +0 -0
  129. data/doc/cxxapi/inherit__graph__11.map +1 -1
  130. data/doc/cxxapi/inherit__graph__11.md5 +1 -1
  131. data/doc/cxxapi/inherit__graph__11.png +0 -0
  132. data/doc/cxxapi/inherit__graph__12.map +1 -1
  133. data/doc/cxxapi/inherit__graph__12.md5 +1 -1
  134. data/doc/cxxapi/inherit__graph__12.png +0 -0
  135. data/doc/cxxapi/inherit__graph__13.map +1 -2
  136. data/doc/cxxapi/inherit__graph__13.md5 +1 -1
  137. data/doc/cxxapi/inherit__graph__13.png +0 -0
  138. data/doc/cxxapi/inherit__graph__14.map +2 -1
  139. data/doc/cxxapi/inherit__graph__14.md5 +1 -1
  140. data/doc/cxxapi/inherit__graph__14.png +0 -0
  141. data/doc/cxxapi/inherit__graph__15.map +1 -1
  142. data/doc/cxxapi/inherit__graph__15.md5 +1 -1
  143. data/doc/cxxapi/inherit__graph__15.png +0 -0
  144. data/doc/cxxapi/inherit__graph__16.map +1 -1
  145. data/doc/cxxapi/inherit__graph__16.md5 +1 -1
  146. data/doc/cxxapi/inherit__graph__16.png +0 -0
  147. data/doc/cxxapi/inherit__graph__17.map +1 -1
  148. data/doc/cxxapi/inherit__graph__17.md5 +1 -1
  149. data/doc/cxxapi/inherit__graph__17.png +0 -0
  150. data/doc/cxxapi/inherit__graph__18.map +1 -1
  151. data/doc/cxxapi/inherit__graph__18.md5 +1 -1
  152. data/doc/cxxapi/inherit__graph__18.png +0 -0
  153. data/doc/cxxapi/inherit__graph__19.map +1 -1
  154. data/doc/cxxapi/inherit__graph__19.md5 +1 -1
  155. data/doc/cxxapi/inherit__graph__19.png +0 -0
  156. data/doc/cxxapi/inherit__graph__2.map +1 -1
  157. data/doc/cxxapi/inherit__graph__2.md5 +1 -1
  158. data/doc/cxxapi/inherit__graph__2.png +0 -0
  159. data/doc/cxxapi/inherit__graph__20.map +2 -2
  160. data/doc/cxxapi/inherit__graph__20.md5 +1 -1
  161. data/doc/cxxapi/inherit__graph__20.png +0 -0
  162. data/doc/cxxapi/inherit__graph__21.map +1 -1
  163. data/doc/cxxapi/inherit__graph__21.md5 +1 -1
  164. data/doc/cxxapi/inherit__graph__21.png +0 -0
  165. data/doc/cxxapi/inherit__graph__3.map +1 -1
  166. data/doc/cxxapi/inherit__graph__3.md5 +1 -1
  167. data/doc/cxxapi/inherit__graph__3.png +0 -0
  168. data/doc/cxxapi/inherit__graph__4.map +1 -1
  169. data/doc/cxxapi/inherit__graph__4.md5 +1 -1
  170. data/doc/cxxapi/inherit__graph__4.png +0 -0
  171. data/doc/cxxapi/inherit__graph__5.map +1 -2
  172. data/doc/cxxapi/inherit__graph__5.md5 +1 -1
  173. data/doc/cxxapi/inherit__graph__5.png +0 -0
  174. data/doc/cxxapi/inherit__graph__6.map +2 -1
  175. data/doc/cxxapi/inherit__graph__6.md5 +1 -1
  176. data/doc/cxxapi/inherit__graph__6.png +0 -0
  177. data/doc/cxxapi/inherit__graph__7.map +1 -1
  178. data/doc/cxxapi/inherit__graph__7.md5 +1 -1
  179. data/doc/cxxapi/inherit__graph__7.png +0 -0
  180. data/doc/cxxapi/inherit__graph__8.map +1 -1
  181. data/doc/cxxapi/inherit__graph__8.md5 +1 -1
  182. data/doc/cxxapi/inherit__graph__8.png +0 -0
  183. data/doc/cxxapi/inherit__graph__9.map +1 -1
  184. data/doc/cxxapi/inherit__graph__9.md5 +1 -1
  185. data/doc/cxxapi/inherit__graph__9.png +0 -0
  186. data/doc/cxxapi/inherits.html +41 -41
  187. data/doc/cxxapi/main.html +4 -4
  188. data/doc/cxxapi/modules.html +4 -5
  189. data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +4 -4
  190. data/doc/cxxapi/structPassenger_1_1AnythingToString.html +13 -10
  191. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +5 -5
  192. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +16 -13
  193. data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +4 -4
  194. data/doc/cxxapi/structPassenger_1_1PoolOptions.html +63 -60
  195. data/doc/cxxapi/tabs.css +5 -2
  196. data/doc/cxxapi/tree.html +7 -81
  197. data/doc/rdoc/classes/ConditionVariable.html +59 -59
  198. data/doc/rdoc/classes/Exception.html +11 -11
  199. data/doc/rdoc/classes/GC.html +4 -4
  200. data/doc/rdoc/classes/IO.html +14 -14
  201. data/doc/rdoc/classes/PhusionPassenger.html +75 -20
  202. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +153 -0
  203. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +125 -130
  204. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +236 -236
  205. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +213 -213
  206. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +28 -28
  207. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +91 -75
  208. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +10 -10
  209. data/doc/rdoc/classes/PhusionPassenger/Application.html +64 -64
  210. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +34 -34
  211. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +13 -13
  212. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +30 -30
  213. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +10 -10
  214. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +136 -136
  215. data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +24 -24
  216. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +42 -42
  217. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +55 -53
  218. data/doc/rdoc/classes/PhusionPassenger/Railz.html +1 -1
  219. data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +25 -30
  220. data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +23 -23
  221. data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +116 -117
  222. data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +22 -22
  223. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +118 -124
  224. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +10 -10
  225. data/doc/rdoc/classes/PhusionPassenger/Utils.html +354 -354
  226. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +9 -9
  227. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +37 -37
  228. data/doc/rdoc/classes/PlatformInfo.html +282 -261
  229. data/doc/rdoc/classes/RakeExtensions.html +7 -7
  230. data/doc/rdoc/classes/Signal.html +26 -26
  231. data/doc/rdoc/created.rid +1 -1
  232. data/doc/rdoc/files/DEVELOPERS_TXT.html +6 -1
  233. data/doc/rdoc/files/README.html +15 -6
  234. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
  235. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +129 -0
  236. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +20 -13
  237. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +19 -13
  238. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +19 -13
  239. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +31 -1
  240. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +31 -1
  241. data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +19 -13
  242. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +19 -13
  243. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +21 -12
  244. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +19 -13
  245. data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +19 -13
  246. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +19 -13
  247. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +19 -13
  248. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +19 -13
  249. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +122 -0
  250. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +19 -13
  251. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +22 -12
  252. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +21 -12
  253. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +19 -13
  254. data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +1 -1
  255. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +19 -13
  256. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +21 -12
  257. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +19 -13
  258. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +19 -13
  259. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +27 -21
  260. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +21 -12
  261. data/doc/rdoc/files/misc/rake/extensions_rb.html +21 -12
  262. data/doc/rdoc/fr_class_index.html +1 -0
  263. data/doc/rdoc/fr_file_index.html +2 -0
  264. data/doc/rdoc/fr_method_index.html +116 -112
  265. data/doc/users_guide_snippets/analysis_and_system_maintenance_tools.txt +144 -0
  266. data/doc/users_guide_snippets/appendix_a_about.txt +13 -0
  267. data/doc/users_guide_snippets/appendix_b_terminology.txt +63 -0
  268. data/doc/users_guide_snippets/appendix_c_spawning_methods.txt +304 -0
  269. data/doc/users_guide_snippets/global_queueing_explained.txt +78 -0
  270. data/doc/users_guide_snippets/rackup_specifications.txt +75 -0
  271. data/doc/users_guide_snippets/rails_spawn_method.txt +48 -0
  272. data/doc/users_guide_snippets/tips.txt +173 -0
  273. data/ext/apache2/Bucket.cpp +17 -12
  274. data/ext/apache2/Bucket.h +17 -12
  275. data/ext/apache2/Configuration.cpp +17 -12
  276. data/ext/apache2/Configuration.h +27 -14
  277. data/ext/apache2/DirectoryMapper.h +21 -12
  278. data/ext/apache2/Hooks.cpp +67 -21
  279. data/ext/apache2/Hooks.h +17 -12
  280. data/ext/apache2/mod_passenger.c +17 -12
  281. data/ext/{apache2 → common}/Application.h +19 -14
  282. data/ext/{apache2 → common}/ApplicationPool.h +17 -12
  283. data/ext/{apache2 → common}/ApplicationPoolServer.h +18 -72
  284. data/ext/{apache2 → common}/ApplicationPoolServerExecutable.cpp +45 -104
  285. data/ext/common/ApplicationPoolStatusReporter.h +212 -0
  286. data/ext/{apache2 → common}/CachedFileStat.cpp +17 -12
  287. data/ext/{apache2 → common}/CachedFileStat.h +17 -12
  288. data/ext/{apache2 → common}/DummySpawnManager.h +17 -12
  289. data/ext/{apache2 → common}/Exceptions.h +17 -12
  290. data/ext/{apache2 → common}/FileChecker.h +17 -12
  291. data/ext/common/Logging.cpp +65 -0
  292. data/ext/{apache2 → common}/Logging.h +17 -12
  293. data/ext/{apache2 → common}/MessageChannel.h +17 -12
  294. data/ext/{apache2 → common}/PoolOptions.h +17 -12
  295. data/ext/{apache2 → common}/SpawnManager.h +17 -12
  296. data/ext/{apache2 → common}/StandardApplicationPool.h +17 -12
  297. data/ext/common/StaticString.h +147 -0
  298. data/ext/common/SystemTime.cpp +33 -0
  299. data/ext/{apache2 → common}/SystemTime.h +17 -12
  300. data/ext/{apache2 → common}/Utils.cpp +69 -12
  301. data/ext/{apache2 → common}/Utils.h +41 -12
  302. data/ext/nginx/Configuration.c +1091 -0
  303. data/ext/nginx/Configuration.h +71 -0
  304. data/ext/nginx/ContentHandler.c +1154 -0
  305. data/ext/nginx/ContentHandler.h +64 -0
  306. data/ext/nginx/HelperServer.cpp +857 -0
  307. data/ext/nginx/HttpStatusExtractor.h +161 -0
  308. data/ext/nginx/ScgiRequestParser.h +317 -0
  309. data/ext/nginx/StaticContentHandler.c +222 -0
  310. data/ext/nginx/StaticContentHandler.h +37 -0
  311. data/ext/nginx/config +41 -0
  312. data/ext/nginx/ngx_http_passenger_module.c +572 -0
  313. data/ext/nginx/ngx_http_passenger_module.h +72 -0
  314. data/ext/oxt/backtrace.cpp +8 -1
  315. data/ext/oxt/system_calls.cpp +40 -0
  316. data/ext/oxt/system_calls.hpp +14 -7
  317. data/ext/phusion_passenger/extconf.rb +17 -12
  318. data/ext/phusion_passenger/native_support.c +19 -12
  319. data/lib/phusion_passenger/abstract_installer.rb +196 -0
  320. data/lib/phusion_passenger/abstract_request_handler.rb +19 -24
  321. data/lib/phusion_passenger/abstract_server.rb +17 -12
  322. data/lib/phusion_passenger/abstract_server_collection.rb +17 -12
  323. data/lib/phusion_passenger/admin_tools.rb +23 -0
  324. data/lib/phusion_passenger/admin_tools/control_process.rb +39 -13
  325. data/lib/phusion_passenger/application.rb +17 -12
  326. data/lib/phusion_passenger/console_text_template.rb +17 -12
  327. data/lib/phusion_passenger/constants.rb +22 -11
  328. data/lib/phusion_passenger/dependencies.rb +47 -12
  329. data/lib/phusion_passenger/events.rb +17 -12
  330. data/lib/phusion_passenger/exceptions.rb +17 -12
  331. data/lib/phusion_passenger/html_template.rb +17 -12
  332. data/lib/phusion_passenger/message_channel.rb +17 -12
  333. data/lib/phusion_passenger/packaging.rb +39 -0
  334. data/lib/phusion_passenger/platform_info.rb +48 -22
  335. data/lib/phusion_passenger/rack/application_spawner.rb +22 -11
  336. data/lib/phusion_passenger/rack/request_handler.rb +21 -12
  337. data/lib/phusion_passenger/railz/application_spawner.rb +23 -23
  338. data/lib/phusion_passenger/railz/framework_spawner.rb +18 -14
  339. data/lib/phusion_passenger/railz/request_handler.rb +18 -11
  340. data/lib/phusion_passenger/simple_benchmarking.rb +17 -12
  341. data/lib/phusion_passenger/spawn_manager.rb +17 -20
  342. data/lib/phusion_passenger/templates/{apache_must_be_compiled_with_compatible_mpm.txt.erb → apache2/apache_must_be_compiled_with_compatible_mpm.txt.erb} +0 -0
  343. data/lib/phusion_passenger/templates/{apache2_config_snippets.txt.erb → apache2/config_snippets.txt.erb} +0 -0
  344. data/lib/phusion_passenger/templates/{deployment_example.txt.erb → apache2/deployment_example.txt.erb} +0 -0
  345. data/lib/phusion_passenger/templates/{no_write_permission_to_passenger_root.txt.erb → apache2/no_write_permission_to_passenger_root.txt.erb} +0 -0
  346. data/lib/phusion_passenger/templates/{possible_solutions_for_compilation_and_installation_problems.txt.erb → apache2/possible_solutions_for_compilation_and_installation_problems.txt.erb} +0 -0
  347. data/lib/phusion_passenger/templates/{run_installer_as_root.txt.erb → apache2/run_installer_as_root.txt.erb} +0 -0
  348. data/lib/phusion_passenger/templates/{welcome.txt.erb → apache2/welcome.txt.erb} +0 -0
  349. data/lib/phusion_passenger/templates/nginx/ask_for_extra_configure_flags.txt.erb +8 -0
  350. data/lib/phusion_passenger/templates/nginx/cannot_write_to_dir.txt.erb +11 -0
  351. data/lib/phusion_passenger/templates/nginx/config_snippets.txt.erb +17 -0
  352. data/lib/phusion_passenger/templates/nginx/config_snippets_inserted.txt.erb +20 -0
  353. data/lib/phusion_passenger/templates/nginx/confirm_extra_configure_flags.txt.erb +5 -0
  354. data/lib/phusion_passenger/templates/nginx/deployment_example.txt.erb +22 -0
  355. data/lib/phusion_passenger/templates/nginx/pcre_could_not_be_downloaded.txt.erb +11 -0
  356. data/lib/phusion_passenger/templates/nginx/pcre_could_not_be_extracted.txt.erb +11 -0
  357. data/lib/phusion_passenger/templates/nginx/possible_solutions_for_compilation_and_installation_problems.txt.erb +11 -0
  358. data/lib/phusion_passenger/templates/nginx/possible_solutions_for_download_and_extraction_problems.txt.erb +20 -0
  359. data/lib/phusion_passenger/templates/nginx/query_download_and_install.txt.erb +21 -0
  360. data/lib/phusion_passenger/templates/nginx/run_installer_as_root.txt.erb +8 -0
  361. data/lib/phusion_passenger/templates/nginx/welcome.txt.erb +15 -0
  362. data/lib/phusion_passenger/utils.rb +20 -15
  363. data/lib/phusion_passenger/wsgi/application_spawner.rb +18 -11
  364. data/lib/phusion_passenger/wsgi/request_handler.py +23 -0
  365. data/misc/copy_boost_headers.rb +23 -0
  366. data/misc/find_owner_pipe_leaks.rb +18 -11
  367. data/misc/rake/cplusplus.rb +18 -11
  368. data/misc/rake/extensions.rb +21 -14
  369. data/misc/render_error_pages.rb +18 -11
  370. data/test/ApplicationPoolServerTest.cpp +1 -3
  371. data/test/ApplicationPoolServer_ApplicationPoolTest.cpp +1 -1
  372. data/test/CxxTestMain.cpp +19 -3
  373. data/test/HttpStatusExtractorTest.cpp +181 -0
  374. data/test/ScgiRequestParserTest.cpp +337 -0
  375. data/test/StaticStringTest.cpp +51 -0
  376. data/test/UtilsTest.cpp +32 -0
  377. data/test/config.yml.example +5 -0
  378. data/test/{integration_tests.rb → integration_tests/apache2_tests.rb} +7 -299
  379. data/test/integration_tests/hello_world_rack_spec.rb +36 -0
  380. data/test/integration_tests/hello_world_wsgi_spec.rb +41 -0
  381. data/test/integration_tests/mycook_spec.rb +192 -0
  382. data/test/integration_tests/nginx_tests.rb +98 -0
  383. data/test/ruby/rack/application_spawner_spec.rb +40 -0
  384. data/test/stub/nginx/koi-utf +109 -0
  385. data/test/stub/nginx/koi-win +103 -0
  386. data/test/stub/nginx/mime.types +70 -0
  387. data/test/stub/nginx/nginx.conf.erb +57 -0
  388. data/test/stub/nginx/win-utf +126 -0
  389. data/test/stub/rails_apps/mycook/app/controllers/uploads_controller.rb +4 -0
  390. data/test/stub/rails_apps/mycook/config/routes.rb +1 -1
  391. data/test/stub/wsgi/passenger_wsgi.pyc +0 -0
  392. data/test/support/Support.h +40 -0
  393. data/test/support/nginx_controller.rb +98 -0
  394. data/test/support/test_helper.rb +79 -0
  395. metadata +1091 -1028
  396. data/benchmark/DummyRequestHandler.cpp +0 -101
  397. data/ext/apache2/Logging.cpp +0 -60
  398. data/ext/apache2/SystemTime.cpp +0 -28
data/DEVELOPERS.TXT CHANGED
@@ -8,6 +8,8 @@ The tests need the following software installed:
8
8
  * Ruby on Rails 2.0.1 (*exactly* 2.0.1)
9
9
  * rspec >= 1.1.2
10
10
  * mime-types >= 1.15
11
+ * daemon_controller (only for running the Nginx integration test). Install
12
+ with: gem install FooBarWidget-daemon_controller -s http://gems.github.com
11
13
 
12
14
  The following software is optional:
13
15
 
data/INSTALL CHANGED
@@ -1,4 +1,6 @@
1
1
  Please read the file README for installation instructions.
2
2
 
3
3
  If you're having trouble installing Phusion Passenger, please
4
- read the file 'doc/Users guide.html'.
4
+ read the file 'doc/Users guide Apache.html' or 'doc/Users guide Nginx.html',
5
+ depending on whether you want to install Phusion Passenger for Apache or for
6
+ Nginx.
data/LICENSE CHANGED
@@ -1,355 +1,19 @@
1
- Phusion Passenger is licensed under the GNU General Public License (GPL)
2
- version 2, and *only* version 2 (i.e. not version 3 or any later versions).
3
-
4
- In addition to the GNU General Public License v2 licensing terms, we explicitly
5
- grant you the permission to run any application on top of Phusion Passenger,
6
- regardless of the application's own licensing terms. The application will not
7
- be bound to the terms of the GPL in any way. That is, the GPL only applies to
8
- Phusion Passenger itself, and not to applications that are run through Phusion
9
- Passenger.
10
-
11
- We also explicitly allow Apache to load the Phusion Passenger Apache module,
12
- without Apache or any other loaded modules needing to be released under the
13
- terms of the GPL.
14
-
15
- ----------------------------------------------------------------------
16
-
17
- GNU GENERAL PUBLIC LICENSE
18
- Version 2, June 1991
19
-
20
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
21
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
- Everyone is permitted to copy and distribute verbatim copies
23
- of this license document, but changing it is not allowed.
24
-
25
- Preamble
26
-
27
- The licenses for most software are designed to take away your
28
- freedom to share and change it. By contrast, the GNU General Public
29
- License is intended to guarantee your freedom to share and change free
30
- software--to make sure the software is free for all its users. This
31
- General Public License applies to most of the Free Software
32
- Foundation's software and to any other program whose authors commit to
33
- using it. (Some other Free Software Foundation software is covered by
34
- the GNU Lesser General Public License instead.) You can apply it to
35
- your programs, too.
36
-
37
- When we speak of free software, we are referring to freedom, not
38
- price. Our General Public Licenses are designed to make sure that you
39
- have the freedom to distribute copies of free software (and charge for
40
- this service if you wish), that you receive source code or can get it
41
- if you want it, that you can change the software or use pieces of it
42
- in new free programs; and that you know you can do these things.
43
-
44
- To protect your rights, we need to make restrictions that forbid
45
- anyone to deny you these rights or to ask you to surrender the rights.
46
- These restrictions translate to certain responsibilities for you if you
47
- distribute copies of the software, or if you modify it.
48
-
49
- For example, if you distribute copies of such a program, whether
50
- gratis or for a fee, you must give the recipients all the rights that
51
- you have. You must make sure that they, too, receive or can get the
52
- source code. And you must show them these terms so they know their
53
- rights.
54
-
55
- We protect your rights with two steps: (1) copyright the software, and
56
- (2) offer you this license which gives you legal permission to copy,
57
- distribute and/or modify the software.
58
-
59
- Also, for each author's protection and ours, we want to make certain
60
- that everyone understands that there is no warranty for this free
61
- software. If the software is modified by someone else and passed on, we
62
- want its recipients to know that what they have is not the original, so
63
- that any problems introduced by others will not reflect on the original
64
- authors' reputations.
65
-
66
- Finally, any free program is threatened constantly by software
67
- patents. We wish to avoid the danger that redistributors of a free
68
- program will individually obtain patent licenses, in effect making the
69
- program proprietary. To prevent this, we have made it clear that any
70
- patent must be licensed for everyone's free use or not licensed at all.
71
-
72
- The precise terms and conditions for copying, distribution and
73
- modification follow.
74
-
75
- GNU GENERAL PUBLIC LICENSE
76
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
77
-
78
- 0. This License applies to any program or other work which contains
79
- a notice placed by the copyright holder saying it may be distributed
80
- under the terms of this General Public License. The "Program", below,
81
- refers to any such program or work, and a "work based on the Program"
82
- means either the Program or any derivative work under copyright law:
83
- that is to say, a work containing the Program or a portion of it,
84
- either verbatim or with modifications and/or translated into another
85
- language. (Hereinafter, translation is included without limitation in
86
- the term "modification".) Each licensee is addressed as "you".
87
-
88
- Activities other than copying, distribution and modification are not
89
- covered by this License; they are outside its scope. The act of
90
- running the Program is not restricted, and the output from the Program
91
- is covered only if its contents constitute a work based on the
92
- Program (independent of having been made by running the Program).
93
- Whether that is true depends on what the Program does.
94
-
95
- 1. You may copy and distribute verbatim copies of the Program's
96
- source code as you receive it, in any medium, provided that you
97
- conspicuously and appropriately publish on each copy an appropriate
98
- copyright notice and disclaimer of warranty; keep intact all the
99
- notices that refer to this License and to the absence of any warranty;
100
- and give any other recipients of the Program a copy of this License
101
- along with the Program.
102
-
103
- You may charge a fee for the physical act of transferring a copy, and
104
- you may at your option offer warranty protection in exchange for a fee.
105
-
106
- 2. You may modify your copy or copies of the Program or any portion
107
- of it, thus forming a work based on the Program, and copy and
108
- distribute such modifications or work under the terms of Section 1
109
- above, provided that you also meet all of these conditions:
110
-
111
- a) You must cause the modified files to carry prominent notices
112
- stating that you changed the files and the date of any change.
113
-
114
- b) You must cause any work that you distribute or publish, that in
115
- whole or in part contains or is derived from the Program or any
116
- part thereof, to be licensed as a whole at no charge to all third
117
- parties under the terms of this License.
118
-
119
- c) If the modified program normally reads commands interactively
120
- when run, you must cause it, when started running for such
121
- interactive use in the most ordinary way, to print or display an
122
- announcement including an appropriate copyright notice and a
123
- notice that there is no warranty (or else, saying that you provide
124
- a warranty) and that users may redistribute the program under
125
- these conditions, and telling the user how to view a copy of this
126
- License. (Exception: if the Program itself is interactive but
127
- does not normally print such an announcement, your work based on
128
- the Program is not required to print an announcement.)
129
-
130
- These requirements apply to the modified work as a whole. If
131
- identifiable sections of that work are not derived from the Program,
132
- and can be reasonably considered independent and separate works in
133
- themselves, then this License, and its terms, do not apply to those
134
- sections when you distribute them as separate works. But when you
135
- distribute the same sections as part of a whole which is a work based
136
- on the Program, the distribution of the whole must be on the terms of
137
- this License, whose permissions for other licensees extend to the
138
- entire whole, and thus to each and every part regardless of who wrote it.
139
-
140
- Thus, it is not the intent of this section to claim rights or contest
141
- your rights to work written entirely by you; rather, the intent is to
142
- exercise the right to control the distribution of derivative or
143
- collective works based on the Program.
144
-
145
- In addition, mere aggregation of another work not based on the Program
146
- with the Program (or with a work based on the Program) on a volume of
147
- a storage or distribution medium does not bring the other work under
148
- the scope of this License.
149
-
150
- 3. You may copy and distribute the Program (or a work based on it,
151
- under Section 2) in object code or executable form under the terms of
152
- Sections 1 and 2 above provided that you also do one of the following:
153
-
154
- a) Accompany it with the complete corresponding machine-readable
155
- source code, which must be distributed under the terms of Sections
156
- 1 and 2 above on a medium customarily used for software interchange; or,
157
-
158
- b) Accompany it with a written offer, valid for at least three
159
- years, to give any third party, for a charge no more than your
160
- cost of physically performing source distribution, a complete
161
- machine-readable copy of the corresponding source code, to be
162
- distributed under the terms of Sections 1 and 2 above on a medium
163
- customarily used for software interchange; or,
164
-
165
- c) Accompany it with the information you received as to the offer
166
- to distribute corresponding source code. (This alternative is
167
- allowed only for noncommercial distribution and only if you
168
- received the program in object code or executable form with such
169
- an offer, in accord with Subsection b above.)
170
-
171
- The source code for a work means the preferred form of the work for
172
- making modifications to it. For an executable work, complete source
173
- code means all the source code for all modules it contains, plus any
174
- associated interface definition files, plus the scripts used to
175
- control compilation and installation of the executable. However, as a
176
- special exception, the source code distributed need not include
177
- anything that is normally distributed (in either source or binary
178
- form) with the major components (compiler, kernel, and so on) of the
179
- operating system on which the executable runs, unless that component
180
- itself accompanies the executable.
181
-
182
- If distribution of executable or object code is made by offering
183
- access to copy from a designated place, then offering equivalent
184
- access to copy the source code from the same place counts as
185
- distribution of the source code, even though third parties are not
186
- compelled to copy the source along with the object code.
187
-
188
- 4. You may not copy, modify, sublicense, or distribute the Program
189
- except as expressly provided under this License. Any attempt
190
- otherwise to copy, modify, sublicense or distribute the Program is
191
- void, and will automatically terminate your rights under this License.
192
- However, parties who have received copies, or rights, from you under
193
- this License will not have their licenses terminated so long as such
194
- parties remain in full compliance.
195
-
196
- 5. You are not required to accept this License, since you have not
197
- signed it. However, nothing else grants you permission to modify or
198
- distribute the Program or its derivative works. These actions are
199
- prohibited by law if you do not accept this License. Therefore, by
200
- modifying or distributing the Program (or any work based on the
201
- Program), you indicate your acceptance of this License to do so, and
202
- all its terms and conditions for copying, distributing or modifying
203
- the Program or works based on it.
204
-
205
- 6. Each time you redistribute the Program (or any work based on the
206
- Program), the recipient automatically receives a license from the
207
- original licensor to copy, distribute or modify the Program subject to
208
- these terms and conditions. You may not impose any further
209
- restrictions on the recipients' exercise of the rights granted herein.
210
- You are not responsible for enforcing compliance by third parties to
211
- this License.
212
-
213
- 7. If, as a consequence of a court judgment or allegation of patent
214
- infringement or for any other reason (not limited to patent issues),
215
- conditions are imposed on you (whether by court order, agreement or
216
- otherwise) that contradict the conditions of this License, they do not
217
- excuse you from the conditions of this License. If you cannot
218
- distribute so as to satisfy simultaneously your obligations under this
219
- License and any other pertinent obligations, then as a consequence you
220
- may not distribute the Program at all. For example, if a patent
221
- license would not permit royalty-free redistribution of the Program by
222
- all those who receive copies directly or indirectly through you, then
223
- the only way you could satisfy both it and this License would be to
224
- refrain entirely from distribution of the Program.
225
-
226
- If any portion of this section is held invalid or unenforceable under
227
- any particular circumstance, the balance of the section is intended to
228
- apply and the section as a whole is intended to apply in other
229
- circumstances.
230
-
231
- It is not the purpose of this section to induce you to infringe any
232
- patents or other property right claims or to contest validity of any
233
- such claims; this section has the sole purpose of protecting the
234
- integrity of the free software distribution system, which is
235
- implemented by public license practices. Many people have made
236
- generous contributions to the wide range of software distributed
237
- through that system in reliance on consistent application of that
238
- system; it is up to the author/donor to decide if he or she is willing
239
- to distribute software through any other system and a licensee cannot
240
- impose that choice.
241
-
242
- This section is intended to make thoroughly clear what is believed to
243
- be a consequence of the rest of this License.
244
-
245
- 8. If the distribution and/or use of the Program is restricted in
246
- certain countries either by patents or by copyrighted interfaces, the
247
- original copyright holder who places the Program under this License
248
- may add an explicit geographical distribution limitation excluding
249
- those countries, so that distribution is permitted only in or among
250
- countries not thus excluded. In such case, this License incorporates
251
- the limitation as if written in the body of this License.
252
-
253
- 9. The Free Software Foundation may publish revised and/or new versions
254
- of the General Public License from time to time. Such new versions will
255
- be similar in spirit to the present version, but may differ in detail to
256
- address new problems or concerns.
257
-
258
- Each version is given a distinguishing version number. If the Program
259
- specifies a version number of this License which applies to it and "any
260
- later version", you have the option of following the terms and conditions
261
- either of that version or of any later version published by the Free
262
- Software Foundation. If the Program does not specify a version number of
263
- this License, you may choose any version ever published by the Free Software
264
- Foundation.
265
-
266
- 10. If you wish to incorporate parts of the Program into other free
267
- programs whose distribution conditions are different, write to the author
268
- to ask for permission. For software which is copyrighted by the Free
269
- Software Foundation, write to the Free Software Foundation; we sometimes
270
- make exceptions for this. Our decision will be guided by the two goals
271
- of preserving the free status of all derivatives of our free software and
272
- of promoting the sharing and reuse of software generally.
273
-
274
- NO WARRANTY
275
-
276
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
277
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
278
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
279
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
280
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
281
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
282
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
283
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
284
- REPAIR OR CORRECTION.
285
-
286
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
287
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
288
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
289
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
290
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
291
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
292
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
293
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
294
- POSSIBILITY OF SUCH DAMAGES.
295
-
296
- END OF TERMS AND CONDITIONS
297
-
298
- How to Apply These Terms to Your New Programs
299
-
300
- If you develop a new program, and you want it to be of the greatest
301
- possible use to the public, the best way to achieve this is to make it
302
- free software which everyone can redistribute and change under these terms.
303
-
304
- To do so, attach the following notices to the program. It is safest
305
- to attach them to the start of each source file to most effectively
306
- convey the exclusion of warranty; and each file should have at least
307
- the "copyright" line and a pointer to where the full notice is found.
308
-
309
- <one line to give the program's name and a brief idea of what it does.>
310
- Copyright (C) <year> <name of author>
311
-
312
- This program is free software; you can redistribute it and/or modify
313
- it under the terms of the GNU General Public License as published by
314
- the Free Software Foundation; either version 2 of the License.
315
-
316
- This program is distributed in the hope that it will be useful,
317
- but WITHOUT ANY WARRANTY; without even the implied warranty of
318
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
319
- GNU General Public License for more details.
320
-
321
- You should have received a copy of the GNU General Public License along
322
- with this program; if not, write to the Free Software Foundation, Inc.,
323
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
324
-
325
- Also add information on how to contact you by electronic and paper mail.
326
-
327
- If the program is interactive, make it output a short notice like this
328
- when it starts in an interactive mode:
329
-
330
- Gnomovision version 69, Copyright (C) year name of author
331
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
332
- This is free software, and you are welcome to redistribute it
333
- under certain conditions; type `show c' for details.
334
-
335
- The hypothetical commands `show w' and `show c' should show the appropriate
336
- parts of the General Public License. Of course, the commands you use may
337
- be called something other than `show w' and `show c'; they could even be
338
- mouse-clicks or menu items--whatever suits your program.
339
-
340
- You should also get your employer (if you work as a programmer) or your
341
- school, if any, to sign a "copyright disclaimer" for the program, if
342
- necessary. Here is a sample; alter the names:
343
-
344
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
345
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
346
-
347
- <signature of Ty Coon>, 1 April 1989
348
- Ty Coon, President of Vice
349
-
350
- This General Public License does not permit incorporating your program into
351
- proprietary programs. If your program is a subroutine library, you may
352
- consider it more useful to permit linking proprietary applications with the
353
- library. If this is what you want to do, use the GNU Lesser General
354
- Public License instead of this License.
355
-
1
+ Copyright (c) 2008, 2009 Phusion
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/NEWS CHANGED
@@ -0,0 +1,3 @@
1
+ - Passenger no longer resolves symlink anymore, so that it works properly
2
+ with Capistrano deployments.
3
+ - Chuncked transfer encoding support for uploads (Apache only).
data/README CHANGED
@@ -7,17 +7,24 @@ to http://www.modrails.com/ for general information.
7
7
 
8
8
  === Regular installation
9
9
 
10
- Run the following script as root:
10
+ You can install either Phusion Passenger for Apache or for Nginx. Run either of
11
+ the following programs as root:
11
12
 
12
13
  ./bin/passenger-install-apache2-module
13
14
 
15
+ -OR-
16
+
17
+ ./bin/passenger-install-nginx-module
18
+
14
19
  That's it. :)
15
20
 
16
- For troubleshooting, configuration and tips, please read the Users Guide:
21
+ For troubleshooting, configuration and tips, please read the corresponding
22
+ Users Guide:
17
23
 
18
- doc/Users guide.html
24
+ doc/Users guide Apache.html
25
+ doc/Users guide Nginx.html
19
26
 
20
- This file is included in the source tarball, and may also be viewed online on
27
+ These files are included in the source tarball, and may also be viewed online on
21
28
  our website.
22
29
 
23
30
  === Installing via a gem
data/Rakefile CHANGED
@@ -19,34 +19,39 @@
19
19
  $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib")
20
20
  $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/misc")
21
21
  require 'rubygems'
22
+ require 'pathname'
22
23
  require 'rake/rdoctask'
23
24
  require 'rake/gempackagetask'
24
25
  require 'rake/extensions'
25
26
  require 'rake/cplusplus'
26
27
  require 'phusion_passenger/platform_info'
28
+ require 'phusion_passenger/constants'
27
29
 
28
30
  verbose true
29
31
 
30
32
  ##### Configuration
31
33
 
32
- # Don't forget to edit Configuration.h too
33
- PACKAGE_VERSION = "2.1.3"
34
+ PACKAGE_VERSION = PhusionPassenger::VERSION_STRING
34
35
  OPTIMIZE = ["yes", "on", "true"].include?(ENV['OPTIMIZE'])
35
36
 
36
- PlatformInfo.apxs2.nil? and raise "Could not find 'apxs' or 'apxs2'."
37
- PlatformInfo.apache2ctl.nil? and raise "Could not find 'apachectl' or 'apache2ctl'."
38
- PlatformInfo.httpd.nil? and raise "Could not find the Apache web server binary."
37
+ include PlatformInfo
39
38
 
40
39
  CXX = "g++"
41
40
  LIBEXT = PlatformInfo.library_extension
42
- # _GLIBCPP__PTHREADS is for fixing Boost compilation on OpenBSD.
43
41
  if OPTIMIZE
44
42
  OPTIMIZATION_FLAGS = "#{PlatformInfo.debugging_cflags} -O2 -DBOOST_DISABLE_ASSERTS"
45
43
  else
46
44
  OPTIMIZATION_FLAGS = "#{PlatformInfo.debugging_cflags} -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS"
47
45
  end
48
- CXXFLAGS = "-Wall #{OPTIMIZATION_FLAGS}"
49
- EXTRA_LDFLAGS = ""
46
+
47
+ # Extra compiler flags that should always be passed to the C/C++ compiler.
48
+ # Should be included last in the command string.
49
+ EXTRA_CXXFLAGS = "-Wall #{OPTIMIZATION_FLAGS}"
50
+
51
+ # Extra linker flags that should always be passed to the linker.
52
+ # Should be included last in the command string.
53
+ EXTRA_LDFLAGS = ""
54
+
50
55
 
51
56
  #### Default tasks
52
57
 
@@ -54,9 +59,9 @@ desc "Build everything"
54
59
  task :default => [
55
60
  :native_support,
56
61
  :apache2,
62
+ :nginx,
57
63
  'test/oxt/oxt_test_main',
58
- 'test/Apache2ModuleTests',
59
- 'benchmark/DummyRequestHandler'
64
+ 'test/CxxTests'
60
65
  ]
61
66
 
62
67
  desc "Remove compiled files"
@@ -86,294 +91,484 @@ subdir 'ext/phusion_passenger' do
86
91
  end
87
92
 
88
93
 
89
- ##### boost::thread and OXT static library
90
-
91
- file 'ext/libboost_oxt.a' =>
92
- Dir['ext/boost/src/*.cpp'] +
93
- Dir['ext/boost/src/pthread/*.cpp'] +
94
- Dir['ext/oxt/*.cpp'] +
95
- Dir['ext/oxt/*.hpp'] +
96
- Dir['ext/oxt/detail/*.hpp'] do
97
- Dir.chdir('ext/boost/src') do
98
- puts "### In ext/boost/src:"
99
- flags = "-I../.. #{CXXFLAGS} #{PlatformInfo.apache2_module_cflags}"
100
- compile_cxx "*.cpp", flags
101
- # NOTE: 'compile_cxx "pthread/*.cpp", flags' doesn't work on some systems,
102
- # so we do this instead.
103
- Dir['pthread/*.cpp'].each do |file|
104
- compile_cxx file, flags
94
+ ##### Boost and OXT static library
95
+
96
+ def define_libboost_oxt_task(output_dir, extra_compiler_flags = nil)
97
+ 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"
110
+
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
105
123
  end
106
- end
107
- Dir.chdir('ext/oxt') do
108
- puts "### In ext/oxt:"
109
- Dir['*.cpp'].each do |file|
110
- compile_cxx file, "-I.. #{CXXFLAGS} #{PlatformInfo.apache2_module_cflags}"
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
111
134
  end
135
+
136
+ create_static_library(output_file,
137
+ "#{objects_output_dir}/boost/*.o " <<
138
+ "#{objects_output_dir}/oxt/*.o")
112
139
  end
113
- create_static_library "ext/libboost_oxt.a", "ext/boost/src/*.o ext/oxt/*.o"
114
- end
115
-
116
- task :clean do
117
- sh "rm -f ext/libboost_oxt.a ext/boost/src/*.o ext/oxt/*.o"
140
+
141
+ task :clean do
142
+ sh "rm -rf #{output_file} #{objects_output_dir}"
143
+ end
144
+
145
+ return output_file
118
146
  end
119
147
 
120
148
 
121
- ##### Apache module
122
-
123
- class APACHE2
124
- CXXFLAGS = "-I.. #{CXXFLAGS} #{PlatformInfo.apache2_module_cflags}"
125
- OBJECTS = {
126
- 'Configuration.o' => %w(Configuration.cpp Configuration.h),
127
- 'Bucket.o' => %w(Bucket.cpp Bucket.h),
128
- 'Hooks.o' => %w(Hooks.cpp Hooks.h
129
- Configuration.h ApplicationPool.h ApplicationPoolServer.h
130
- SpawnManager.h Exceptions.h Application.h MessageChannel.h
131
- PoolOptions.h Utils.h DirectoryMapper.h FileChecker.h),
132
- 'Utils.o' => %w(Utils.cpp Utils.h),
133
- 'Logging.o' => %w(Logging.cpp Logging.h),
134
- 'SystemTime.o' => %w(SystemTime.cpp SystemTime.h),
135
- 'CachedFileStat.o' => %w(CachedFileStat.cpp CachedFileStat.h)
136
- }
149
+ ##### Static library for Passenger source files that are shared between
150
+ ##### the Apache module and the Nginx helper server.
151
+
152
+ def define_common_library_task(output_dir, extra_compiler_flags = nil,
153
+ with_application_pool_server_exe = false,
154
+ boost_oxt_library = nil,
155
+ extra_compiler_flags_for_server_exe = nil,
156
+ extra_linker_flags = nil)
157
+ static_library = "#{output_dir}/libpassenger_common.a"
158
+ 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
+ targets = [static_library]
162
+
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}"
174
+
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
188
+ end
189
+
190
+ create_static_library(static_library, "#{objects_output_dir}/*.o")
191
+ end
192
+
193
+ if with_application_pool_server_exe
194
+ exe_file = "#{output_dir}/ApplicationPoolServerExecutable"
195
+ targets << exe_file
196
+
197
+ file(exe_file => [
198
+ 'ext/common/ApplicationPoolServerExecutable.cpp',
199
+ 'ext/common/ApplicationPool.h',
200
+ 'ext/common/Application.h',
201
+ 'ext/common/StandardApplicationPool.h',
202
+ 'ext/common/MessageChannel.h',
203
+ 'ext/common/SpawnManager.h',
204
+ 'ext/common/PoolOptions.h',
205
+ 'ext/common/FileChecker.h',
206
+ 'ext/common/SystemTime.h',
207
+ 'ext/common/CachedFileStat.h',
208
+ boost_oxt_library,
209
+ static_library
210
+ ]) do
211
+ create_executable(exe_file,
212
+ "ext/common/ApplicationPoolServerExecutable.cpp",
213
+ "-Iext -Iext/common " <<
214
+ "#{extra_compiler_flags_for_server_exe} " <<
215
+ "#{extra_compiler_flags} " <<
216
+ "#{PlatformInfo.portability_cflags} " <<
217
+ "#{EXTRA_CXXFLAGS} " <<
218
+ "#{static_library} " <<
219
+ "#{boost_oxt_library} " <<
220
+ "#{extra_linker_flags} " <<
221
+ "#{PlatformInfo.portability_ldflags} " <<
222
+ EXTRA_LDFLAGS
223
+ )
224
+ end
225
+ end
226
+
227
+ task :clean do
228
+ sh "rm -rf #{targets.join(' ')} #{objects_output_dir}"
229
+ end
230
+
231
+ return targets
137
232
  end
138
233
 
139
- subdir 'ext/apache2' do
140
- apxs_objects = APACHE2::OBJECTS.keys.join(',')
141
234
 
142
- desc "Build mod_passenger Apache 2 module"
143
- task :apache2 => ['mod_passenger.so', 'ApplicationPoolServerExecutable', :native_support]
144
-
145
- file 'mod_passenger.so' => [
146
- '../libboost_oxt.a',
147
- 'mod_passenger.o'
148
- ] + APACHE2::OBJECTS.keys do
235
+ ##### Apache 2 module
236
+
237
+ APACHE2_CXXFLAGS = "-Iext -Iext/common #{PlatformInfo.apache2_module_cflags} " <<
238
+ "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
239
+ APACHE2_INPUT_FILES = {
240
+ 'ext/apache2/Configuration.o' => %w(
241
+ ext/apache2/Configuration.cpp
242
+ ext/apache2/Configuration.h),
243
+ 'ext/apache2/Bucket.o' => %w(
244
+ ext/apache2/Bucket.cpp
245
+ ext/apache2/Bucket.h),
246
+ 'ext/apache2/Hooks.o' => %w(
247
+ ext/apache2/Hooks.cpp
248
+ ext/apache2/Hooks.h
249
+ ext/apache2/Configuration.h
250
+ ext/apache2/Bucket.h
251
+ ext/apache2/DirectoryMapper.h
252
+ ext/common/ApplicationPool.h
253
+ ext/common/ApplicationPoolServer.h
254
+ ext/common/SpawnManager.h
255
+ ext/common/Exceptions.h
256
+ ext/common/Application.h
257
+ ext/common/MessageChannel.h
258
+ ext/common/PoolOptions.h
259
+ ext/common/Utils.h)
260
+ }
261
+ APACHE2_OBJECTS = APACHE2_INPUT_FILES.keys
262
+
263
+ # NOTE: APACHE2_BOOST_OXT_LIBRARY is a task name, while APACHE2_COMMON_LIBRARY
264
+ # is an array of task names.
265
+ APACHE2_BOOST_OXT_LIBRARY = define_libboost_oxt_task("ext/apache2",
266
+ PlatformInfo.apache2_module_cflags)
267
+ APACHE2_COMMON_LIBRARY = define_common_library_task("ext/apache2",
268
+ PlatformInfo.apache2_module_cflags,
269
+ true, APACHE2_BOOST_OXT_LIBRARY, nil,
270
+ PlatformInfo.apache2_module_ldflags)
271
+
272
+
273
+ desc "Build Apache 2 module"
274
+ task :apache2 => ['ext/apache2/mod_passenger.so', :native_support]
275
+
276
+ mod_passenger_dependencies = [APACHE2_COMMON_LIBRARY,
277
+ APACHE2_BOOST_OXT_LIBRARY,
278
+ 'ext/apache2/mod_passenger.o',
279
+ APACHE2_OBJECTS].flatten
280
+ file 'ext/apache2/mod_passenger.so' => mod_passenger_dependencies do
281
+ PlatformInfo.apxs2.nil? and raise "Could not find 'apxs' or 'apxs2'."
282
+ PlatformInfo.apache2ctl.nil? and raise "Could not find 'apachectl' or 'apache2ctl'."
283
+ PlatformInfo.httpd.nil? and raise "Could not find the Apache web server binary."
284
+
149
285
  # apxs totally sucks. We couldn't get it working correctly
150
286
  # on MacOS X (it had various problems with building universal
151
287
  # binaries), so we decided to ditch it and build/install the
152
288
  # Apache module ourselves.
153
289
  #
154
290
  # Oh, and libtool sucks too. Do we even need it anymore in 2008?
155
- linkflags = "../libboost_oxt.a "
156
- linkflags << "#{PlatformInfo.apache2_module_cflags} "
157
- linkflags << "#{PlatformInfo.apache2_module_ldflags} #{EXTRA_LDFLAGS} -lstdc++"
158
- create_shared_library 'mod_passenger.so',
159
- APACHE2::OBJECTS.keys.join(' ') << ' mod_passenger.o',
160
- linkflags
161
- end
162
-
163
- file 'ApplicationPoolServerExecutable' => [
164
- '../libboost_oxt.a',
165
- 'ApplicationPoolServerExecutable.cpp',
166
- 'ApplicationPool.h',
167
- 'Application.h',
168
- 'StandardApplicationPool.h',
169
- 'FileChecker.h',
170
- 'MessageChannel.h',
171
- 'SpawnManager.h',
172
- 'PoolOptions.h',
173
- 'Utils.o',
174
- 'Logging.o',
175
- 'SystemTime.o',
176
- 'CachedFileStat.o'
177
- ] do
178
- create_executable "ApplicationPoolServerExecutable",
179
- 'ApplicationPoolServerExecutable.cpp Utils.o Logging.o ' <<
180
- 'SystemTime.o CachedFileStat.o',
181
- "-I.. #{CXXFLAGS} #{PlatformInfo.portability_cflags} " <<
182
- "../libboost_oxt.a " <<
183
- "#{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}"
184
- end
185
-
186
- file 'mod_passenger.o' => ['mod_passenger.c'] do
187
- compile_c 'mod_passenger.c', APACHE2::CXXFLAGS
188
- end
189
-
190
- APACHE2::OBJECTS.each_pair do |target, sources|
191
- file target => sources do
192
- compile_cxx sources[0], APACHE2::CXXFLAGS
291
+
292
+ sources = APACHE2_OBJECTS.join(' ')
293
+ sources << ' ext/apache2/mod_passenger.o'
294
+
295
+ linkflags =
296
+ "#{PlatformInfo.apache2_module_cflags} " <<
297
+ "#{PlatformInfo.portability_cflags} " <<
298
+ "#{EXTRA_CXXFLAGS} " <<
299
+ "#{APACHE2_COMMON_LIBRARY[0]} " <<
300
+ "#{APACHE2_BOOST_OXT_LIBRARY} " <<
301
+ "#{PlatformInfo.apache2_module_ldflags} " <<
302
+ "#{PlatformInfo.portability_ldflags} " <<
303
+ "#{EXTRA_LDFLAGS} "
304
+
305
+ create_shared_library('ext/apache2/mod_passenger.so',
306
+ sources, linkflags)
307
+ end
308
+
309
+ file 'ext/apache2/mod_passenger.o' => ['ext/apache2/mod_passenger.c'] do
310
+ compile_c('ext/apache2/mod_passenger.c',
311
+ APACHE2_CXXFLAGS +
312
+ " -o ext/apache2/mod_passenger.o")
313
+ end
314
+
315
+ APACHE2_INPUT_FILES.each_pair do |target, sources|
316
+ file(target => sources) do
317
+ object_basename = File.basename(target)
318
+ compile_cxx(sources[0],
319
+ APACHE2_CXXFLAGS +
320
+ " -o ext/apache2/#{object_basename}")
193
321
  end
194
322
  end
195
-
196
- task :clean => :'apache2:clean'
197
-
198
- desc "Remove generated files for mod_passenger Apache 2 module"
323
+
324
+ task :clean => 'apache2:clean'
325
+
326
+ # Remove generated files for the Apache 2 module
199
327
  task 'apache2:clean' do
200
- files = [APACHE2::OBJECTS.keys, %w(mod_passenger.o mod_passenger.so
201
- ApplicationPoolServerExecutable)]
328
+ files = [APACHE2_OBJECTS, %w(ext/apache2/mod_passenger.o
329
+ ext/apache2/mod_passenger.so)]
202
330
  sh("rm", "-rf", *files.flatten)
203
331
  end
204
- end
332
+
333
+
334
+ ##### Nginx helper server
335
+
336
+ # NOTE: NGINX_BOOST_OXT_LIBRARY is a task name, while NGINX_COMMON_LIBRARY
337
+ # is an array of task names.
338
+ NGINX_BOOST_OXT_LIBRARY = define_libboost_oxt_task("ext/nginx")
339
+ NGINX_COMMON_LIBRARY = define_common_library_task("ext/nginx")
340
+
341
+ desc "Build Nginx helper server"
342
+ task :nginx => ['ext/nginx/HelperServer', :native_support]
343
+
344
+ helper_server_dependencies = [
345
+ NGINX_BOOST_OXT_LIBRARY,
346
+ NGINX_COMMON_LIBRARY[0],
347
+ 'ext/nginx/HelperServer.cpp',
348
+ 'ext/nginx/ScgiRequestParser.h',
349
+ 'ext/nginx/HttpStatusExtractor.h',
350
+ 'ext/common/StaticString.h',
351
+ 'ext/common/StandardApplicationPool.h'
352
+ ]
353
+ file 'ext/nginx/HelperServer' => helper_server_dependencies do
354
+ create_executable "ext/nginx/HelperServer",
355
+ 'ext/nginx/HelperServer.cpp',
356
+ "-Iext -Iext/common " <<
357
+ "#{PlatformInfo.portability_cflags} " <<
358
+ "#{EXTRA_CXXFLAGS} " <<
359
+ "#{NGINX_COMMON_LIBRARY[0]} " <<
360
+ "#{NGINX_BOOST_OXT_LIBRARY} " <<
361
+ "#{PlatformInfo.portability_ldflags} " <<
362
+ "#{EXTRA_LDFLAGS}"
363
+ end
364
+
365
+ task :clean => 'nginx:clean'
366
+
367
+ # Remove Nginx helper server
368
+ task 'nginx:clean' do
369
+ sh("rm", "-rf", "ext/nginx/HelperServer")
370
+ end
205
371
 
206
372
 
207
373
  ##### Unit tests
208
374
 
209
- class TEST
210
- CXXFLAGS = "#{::CXXFLAGS} -DTESTING_SPAWN_MANAGER -DTESTING_APPLICATION_POOL #{PlatformInfo.portability_cflags}"
211
-
212
- AP2_FLAGS = "-I../ext/apache2 -I../ext -Isupport #{PlatformInfo.apr_flags} #{PlatformInfo.apu_flags}"
213
- AP2_OBJECTS = {
214
- 'CxxTestMain.o' => %w(CxxTestMain.cpp),
215
- 'MessageChannelTest.o' => %w(MessageChannelTest.cpp
216
- ../ext/apache2/MessageChannel.h),
217
- 'SpawnManagerTest.o' => %w(SpawnManagerTest.cpp
218
- ../ext/apache2/SpawnManager.h
219
- ../ext/apache2/PoolOptions.h
220
- ../ext/apache2/Application.h
221
- ../ext/apache2/MessageChannel.h),
222
- 'ApplicationPoolServerTest.o' => %w(ApplicationPoolServerTest.cpp
223
- ../ext/apache2/ApplicationPoolServer.h
224
- ../ext/apache2/PoolOptions.h
225
- ../ext/apache2/MessageChannel.h),
226
- 'ApplicationPoolServer_ApplicationPoolTest.o' => %w(ApplicationPoolServer_ApplicationPoolTest.cpp
227
- ApplicationPoolTest.cpp
228
- ../ext/apache2/ApplicationPoolServer.h
229
- ../ext/apache2/ApplicationPool.h
230
- ../ext/apache2/SpawnManager.h
231
- ../ext/apache2/PoolOptions.h
232
- ../ext/apache2/Application.h
233
- ../ext/apache2/MessageChannel.h),
234
- 'StandardApplicationPoolTest.o' => %w(StandardApplicationPoolTest.cpp
235
- ApplicationPoolTest.cpp
236
- ../ext/apache2/ApplicationPool.h
237
- ../ext/apache2/StandardApplicationPool.h
238
- ../ext/apache2/SpawnManager.h
239
- ../ext/apache2/PoolOptions.h
240
- ../ext/apache2/Application.h
241
- ../ext/apache2/FileChecker.h),
242
- 'PoolOptionsTest.o' => %w(PoolOptionsTest.cpp ../ext/apache2/PoolOptions.h),
243
- 'FileCheckerTest.o' => %w(FileCheckerTest.cpp
244
- ../ext/apache2/FileChecker.h
245
- ../ext/apache2/CachedFileStat.h),
246
- 'SystemTimeTest.o' => %w(SystemTimeTest.cpp
247
- ../ext/apache2/SystemTime.h
248
- ../ext/apache2/SystemTime.cpp),
249
- 'CachedFileStatTest.o' => %w(CachedFileStatTest.cpp
250
- ../ext/apache2/CachedFileStat.h
251
- ../ext/apache2/CachedFileStat.cpp),
252
- 'UtilsTest.o' => %w(UtilsTest.cpp ../ext/apache2/Utils.h)
253
- }
375
+ TEST_BOOST_OXT_LIBRARY = define_libboost_oxt_task("test")
376
+ TEST_COMMON_LIBRARY = define_common_library_task("test",
377
+ nil, true, TEST_BOOST_OXT_LIBRARY)
378
+
379
+ TEST_COMMON_CFLAGS = "-DTESTING_SPAWN_MANAGER -DTESTING_APPLICATION_POOL " <<
380
+ "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
254
381
 
255
- OXT_FLAGS = "-I../../ext -I../support"
256
- OXT_OBJECTS = {
382
+ TEST_OXT_CFLAGS = "-I../../ext -I../support #{TEST_COMMON_CFLAGS}"
383
+ TEST_OXT_LDFLAGS = "#{TEST_BOOST_OXT_LIBRARY} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}"
384
+ TEST_OXT_OBJECTS = {
257
385
  'oxt_test_main.o' => %w(oxt_test_main.cpp),
258
386
  'backtrace_test.o' => %w(backtrace_test.cpp),
259
387
  'syscall_interruption_test.o' => %w(syscall_interruption_test.cpp)
260
388
  }
261
- end
389
+
390
+ TEST_CXX_CFLAGS = "-Iext -Iext/common -Iext/nginx -Itest/support " <<
391
+ "#{PlatformInfo.apr_flags} #{PlatformInfo.apu_flags} #{TEST_COMMON_CFLAGS}"
392
+ TEST_CXX_LDFLAGS = "#{PlatformInfo.apr_libs} #{PlatformInfo.apu_libs} " <<
393
+ "#{TEST_COMMON_LIBRARY[0]} #{TEST_BOOST_OXT_LIBRARY} " <<
394
+ "#{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}"
395
+ TEST_CXX_OBJECTS = {
396
+ 'test/CxxTestMain.o' => %w(
397
+ test/CxxTestMain.cpp),
398
+ 'test/MessageChannelTest.o' => %w(
399
+ test/MessageChannelTest.cpp
400
+ ext/common/MessageChannel.h),
401
+ 'test/SpawnManagerTest.o' => %w(
402
+ test/SpawnManagerTest.cpp
403
+ ext/common/SpawnManager.h
404
+ ext/common/PoolOptions.h
405
+ ext/common/Application.h
406
+ ext/common/MessageChannel.h),
407
+ 'test/ApplicationPoolServerTest.o' => %w(
408
+ test/ApplicationPoolServerTest.cpp
409
+ ext/common/ApplicationPoolServer.h
410
+ ext/common/PoolOptions.h
411
+ ext/common/MessageChannel.h),
412
+ 'test/ApplicationPoolServer_ApplicationPoolTest.o' => %w(
413
+ test/ApplicationPoolServer_ApplicationPoolTest.cpp
414
+ test/ApplicationPoolTest.cpp
415
+ ext/common/ApplicationPoolServer.h
416
+ ext/common/ApplicationPool.h
417
+ ext/common/SpawnManager.h
418
+ ext/common/PoolOptions.h
419
+ ext/common/Application.h
420
+ ext/common/MessageChannel.h),
421
+ 'test/StandardApplicationPoolTest.o' => %w(
422
+ test/StandardApplicationPoolTest.cpp
423
+ test/ApplicationPoolTest.cpp
424
+ ext/common/ApplicationPool.h
425
+ ext/common/StandardApplicationPool.h
426
+ ext/common/SpawnManager.h
427
+ ext/common/PoolOptions.h
428
+ ext/common/FileChecker.h
429
+ ext/common/Application.h),
430
+ 'test/PoolOptionsTest.o' => %w(
431
+ test/PoolOptionsTest.cpp
432
+ ext/common/PoolOptions.h),
433
+ 'test/StaticString.o' => %w(
434
+ test/StaticStringTest.cpp
435
+ ext/common/StaticString.h),
436
+ 'test/ScgiRequestParserTest.o' => %w(
437
+ test/ScgiRequestParserTest.cpp
438
+ ext/nginx/ScgiRequestParser.h
439
+ ext/common/StaticString.h),
440
+ 'test/HttpStatusExtractorTest.o' => %w(
441
+ test/HttpStatusExtractorTest.cpp
442
+ ext/nginx/HttpStatusExtractor.h),
443
+ 'test/FileCheckerTest.o' => %w(
444
+ test/FileCheckerTest.cpp
445
+ ext/common/FileChecker.h
446
+ ext/common/CachedFileStat.h),
447
+ 'test/SystemTimeTest.o' => %w(
448
+ test/SystemTimeTest.cpp
449
+ ext/common/SystemTime.h
450
+ ext/common/SystemTime.cpp),
451
+ 'test/CachedFileStatTest.o' => %w(
452
+ test/CachedFileStatTest.cpp
453
+ ext/common/CachedFileStat.h
454
+ ext/common/CachedFileStat.cpp),
455
+ 'test/UtilsTest.o' => %w(
456
+ test/UtilsTest.cpp
457
+ ext/common/Utils.h)
458
+ }
262
459
 
263
- subdir 'test' do
264
- desc "Run all unit tests (but not integration tests)"
265
- task :test => [:'test:oxt', :'test:apache2', :'test:ruby', :'test:integration']
460
+ desc "Run all unit tests and integration tests"
461
+ task :test => ['test:oxt', 'test:cxx', 'test:ruby', 'test:integration']
266
462
 
267
463
  desc "Run unit tests for the OXT library"
268
- task 'test:oxt' => 'oxt/oxt_test_main' do
269
- sh "./oxt/oxt_test_main"
464
+ task 'test:oxt' => 'test/oxt/oxt_test_main' do
465
+ sh "cd test && ./oxt/oxt_test_main"
270
466
  end
271
467
 
272
- desc "Run unit tests for the Apache 2 module"
273
- task 'test:apache2' => [
274
- 'Apache2ModuleTests',
275
- '../ext/apache2/ApplicationPoolServerExecutable',
276
- :native_support
277
- ] do
278
- sh "./Apache2ModuleTests"
279
- end
280
-
281
- desc "Run unit tests for the Apache 2 module in Valgrind"
282
- task 'test:valgrind' => [
283
- 'Apache2ModuleTests',
284
- '../ext/apache2/ApplicationPoolServerExecutable',
285
- :native_support
286
- ] do
287
- sh "valgrind #{ENV['ARGS']} ./Apache2ModuleTests"
468
+ desc "Run unit tests for the Apache 2 and Nginx C++ components"
469
+ task 'test:cxx' => ['test/CxxTests', :native_support] do
470
+ sh "cd test && ./CxxTests"
288
471
  end
289
472
 
290
473
  desc "Run unit tests for the Ruby libraries"
291
- task 'test:ruby' => [:native_support] do
474
+ task 'test:ruby' => :native_support do
292
475
  if PlatformInfo.rspec.nil?
293
476
  abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo::RUBY}'. Please install it."
294
477
  else
295
- ruby "#{PlatformInfo.rspec} -c -f s ruby/*.rb ruby/*/*.rb"
478
+ Dir.chdir("test") do
479
+ ruby "#{PlatformInfo.rspec} -c -f s ruby/*.rb ruby/*/*.rb"
480
+ end
296
481
  end
297
482
  end
298
483
 
299
- task 'test:rcov' => [:native_support] do
484
+ desc "Run coverage tests for the Ruby libraries"
485
+ task 'test:rcov' => :native_support do
300
486
  if PlatformInfo.rspec.nil?
301
487
  abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo::RUBY}'. Please install it."
302
488
  else
303
- sh "rcov", "--exclude",
304
- "lib\/spec,\/spec$,_spec\.rb$,support\/,platform_info,integration_tests",
305
- PlatformInfo.rspec, "--", "-c", "-f", "s",
306
- *Dir["ruby/*.rb", "ruby/*/*.rb", "integration_tests.rb"]
489
+ Dir.chdir("test") do
490
+ sh "rcov", "--exclude",
491
+ "lib\/spec,\/spec$,_spec\.rb$,support\/,platform_info,integration_tests",
492
+ PlatformInfo.rspec, "--", "-c", "-f", "s",
493
+ *Dir["ruby/*.rb", "ruby/*/*.rb", "integration_tests.rb"]
494
+ end
307
495
  end
308
496
  end
309
497
 
310
- desc "Run integration tests"
311
- task 'test:integration' => [:apache2, :native_support] do
498
+ desc "Run all integration tests"
499
+ task 'test:integration' => ['test:integration:apache2', 'test:integration:nginx'] do
500
+ end
501
+
502
+ desc "Run Apache 2 integration tests"
503
+ task 'test:integration:apache2' => [:apache2, :native_support] do
312
504
  if PlatformInfo.rspec.nil?
313
505
  abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo::RUBY}'. Please install it."
314
506
  else
315
- ruby "#{PlatformInfo.rspec} -c -f s integration_tests.rb"
507
+ Dir.chdir("test") do
508
+ ruby "#{PlatformInfo.rspec} -c -f s integration_tests/apache2_tests.rb"
509
+ end
316
510
  end
317
511
  end
318
512
 
319
- file 'oxt/oxt_test_main' => TEST::OXT_OBJECTS.keys.map{ |x| "oxt/#{x}" } +
320
- ['../ext/libboost_oxt.a'] do
321
- Dir.chdir('oxt') do
322
- objects = TEST::OXT_OBJECTS.keys.join(' ')
323
- create_executable "oxt_test_main", objects,
324
- "../../ext/libboost_oxt.a " <<
325
- "#{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}"
513
+ desc "Run Nginx integration tests"
514
+ task 'test:integration:nginx' => :nginx do
515
+ if PlatformInfo.rspec.nil?
516
+ abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo::RUBY}'. Please install it."
517
+ else
518
+ Dir.chdir("test") do
519
+ ruby "#{PlatformInfo.rspec} -c -f s integration_tests/nginx_tests.rb"
520
+ end
326
521
  end
327
522
  end
328
523
 
329
- TEST::OXT_OBJECTS.each_pair do |target, sources|
330
- file "oxt/#{target}" => sources.map{ |x| "oxt/#{x}" } do
331
- Dir.chdir('oxt') do
524
+ oxt_test_main_dependencies = TEST_OXT_OBJECTS.keys.map do |object|
525
+ "test/oxt/#{object}"
526
+ end
527
+ oxt_test_main_dependencies << TEST_BOOST_OXT_LIBRARY
528
+ file 'test/oxt/oxt_test_main' => oxt_test_main_dependencies do
529
+ objects = TEST_OXT_OBJECTS.keys.map{ |x| "test/oxt/#{x}" }.join(' ')
530
+ create_executable("test/oxt/oxt_test_main", objects, TEST_OXT_LDFLAGS)
531
+ end
532
+
533
+ TEST_OXT_OBJECTS.each_pair do |target, sources|
534
+ file "test/oxt/#{target}" => sources.map{ |x| "test/oxt/#{x}" } do
535
+ Dir.chdir('test/oxt') do
332
536
  puts "### In test/oxt:"
333
- compile_cxx sources[0], "#{TEST::OXT_FLAGS} #{TEST::CXXFLAGS}"
537
+ compile_cxx sources[0], TEST_OXT_CFLAGS
334
538
  end
335
539
  end
336
540
  end
337
541
 
338
- file 'Apache2ModuleTests' => TEST::AP2_OBJECTS.keys +
339
- ['../ext/libboost_oxt.a',
340
- '../ext/apache2/Utils.o',
341
- '../ext/apache2/Logging.o',
342
- '../ext/apache2/SystemTime.o',
343
- '../ext/apache2/CachedFileStat.o'] do
344
- objects = TEST::AP2_OBJECTS.keys.join(' ') <<
345
- " ../ext/apache2/Utils.o" <<
346
- " ../ext/apache2/Logging.o" <<
347
- " ../ext/apache2/SystemTime.o " <<
348
- " ../ext/apache2/CachedFileStat.o"
349
- create_executable "Apache2ModuleTests", objects,
350
- "#{PlatformInfo.apache2_module_ldflags} #{EXTRA_LDFLAGS} " <<
351
- "../ext/libboost_oxt.a " <<
352
- "-lpthread"
353
- end
354
-
355
- TEST::AP2_OBJECTS.each_pair do |target, sources|
356
- file target => sources do
357
- compile_cxx sources[0], "#{TEST::AP2_FLAGS} #{TEST::CXXFLAGS}"
542
+ cxx_tests_dependencies = [TEST_CXX_OBJECTS.keys,
543
+ TEST_BOOST_OXT_LIBRARY, TEST_COMMON_LIBRARY]
544
+ file 'test/CxxTests' => cxx_tests_dependencies.flatten do
545
+ objects = TEST_CXX_OBJECTS.keys.join(' ')
546
+ create_executable("test/CxxTests", objects, TEST_CXX_LDFLAGS)
547
+ end
548
+
549
+ TEST_CXX_OBJECTS.each_pair do |target, sources|
550
+ file(target => sources) do
551
+ compile_cxx sources[0], "-o #{target} #{TEST_CXX_CFLAGS}"
358
552
  end
359
553
  end
360
554
 
361
- desc "Run the restart integration test infinitely, and abort if/when it fails"
555
+ desc "Run the 'restart' integration test infinitely, and abort if/when it fails"
362
556
  task 'test:restart' => [:apache2, :native_support] do
363
- color_code_start = "\e[33m\e[44m\e[1m"
364
- color_code_end = "\e[0m"
365
- i = 1
366
- while true do
367
- puts "#{color_code_start}Test run #{i} (press Ctrl-C multiple times to abort)#{color_code_end}"
368
- sh "spec -c -f s integration_tests.rb -e 'mod_passenger running in Apache 2 : MyCook(tm) beta running on root URI should support restarting via restart.txt'"
369
- i += 1
557
+ Dir.chdir("test") do
558
+ color_code_start = "\e[33m\e[44m\e[1m"
559
+ color_code_end = "\e[0m"
560
+ i = 1
561
+ while true do
562
+ puts "#{color_code_start}Test run #{i} (press Ctrl-C multiple times to abort)#{color_code_end}"
563
+ sh "spec -c -f s integration_tests/apache2.rb -e 'mod_passenger running in Apache 2 : MyCook(tm) beta running on root URI should support restarting via restart.txt'"
564
+ i += 1
565
+ end
370
566
  end
371
567
  end
372
568
 
373
569
  task :clean do
374
- sh "rm -f oxt/oxt_test_main oxt/*.o Apache2ModuleTests *.o"
570
+ sh("rm -rf test/oxt/oxt_test_main test/oxt/*.o test/CxxTests test/*.o")
375
571
  end
376
- end
377
572
 
378
573
 
379
574
  ##### Documentation
@@ -381,7 +576,8 @@ end
381
576
  subdir 'doc' do
382
577
  ASCIIDOC = 'asciidoc'
383
578
  ASCIIDOC_FLAGS = "-a toc -a numbered -a toclevels=3 -a icons"
384
- ASCII_DOCS = ['Security of user switching support', 'Users guide',
579
+ ASCII_DOCS = ['Security of user switching support',
580
+ 'Users guide Apache', 'Users guide Nginx',
385
581
  'Architectural overview']
386
582
 
387
583
  DOXYGEN = 'doxygen'
@@ -466,13 +662,16 @@ spec = Gem::Specification.new do |s|
466
662
  'lib/**/*.rb',
467
663
  'lib/**/*.py',
468
664
  'lib/phusion_passenger/templates/*',
665
+ 'lib/phusion_passenger/templates/apache2/*',
666
+ 'lib/phusion_passenger/templates/nginx/*',
469
667
  'bin/*',
470
668
  'doc/*',
471
669
 
472
670
  # If you're running 'rake package' for the first time, then these
473
671
  # files don't exist yet, and so won't be matched by the above glob.
474
672
  # So we add these filenames manually.
475
- 'doc/Users guide.html',
673
+ 'doc/Users guide Apache.html',
674
+ 'doc/Users guide Nginx.html',
476
675
  'doc/Security of user switching support.html',
477
676
 
478
677
  'doc/*/*',
@@ -482,7 +681,10 @@ spec = Gem::Specification.new do |s|
482
681
  'doc/*/*/*/*/*/*',
483
682
  'man/*',
484
683
  'debian/*',
684
+ 'ext/common/*.{cpp,c,h}',
485
685
  'ext/apache2/*.{cpp,h,c,TXT}',
686
+ 'ext/nginx/*.{c,cpp,h}',
687
+ 'ext/nginx/config',
486
688
  'ext/boost/*.{hpp,TXT}',
487
689
  'ext/boost/**/*.{hpp,cpp,pl,inl,ipp}',
488
690
  'ext/oxt/*.hpp',
@@ -498,6 +700,7 @@ spec = Gem::Specification.new do |s|
498
700
  'test/oxt/*.cpp',
499
701
  'test/ruby/*',
500
702
  'test/ruby/*/*',
703
+ 'test/integration_tests/*',
501
704
  'test/stub/*',
502
705
  'test/stub/*/*',
503
706
  'test/stub/*/*/*',
@@ -511,6 +714,7 @@ spec = Gem::Specification.new do |s|
511
714
  s.executables = [
512
715
  'passenger-spawn-server',
513
716
  'passenger-install-apache2-module',
717
+ 'passenger-install-nginx-module',
514
718
  'passenger-config',
515
719
  'passenger-memory-stats',
516
720
  'passenger-make-enterprisey',
@@ -559,9 +763,6 @@ task :fakeroot => [:apache2, :native_support, :doc] do
559
763
  sh "mkdir -p #{libdir}"
560
764
  sh "cp -R lib/phusion_passenger #{libdir}/"
561
765
 
562
- sh "mkdir -p #{fakeroot}/etc"
563
- sh "echo -n '#{PACKAGE_VERSION}' > #{fakeroot}/etc/passenger_version.txt"
564
-
565
766
  sh "mkdir -p #{extdir}/phusion_passenger"
566
767
  sh "cp -R ext/phusion_passenger/*.#{LIBEXT} #{extdir}/phusion_passenger/"
567
768
 
@@ -623,18 +824,16 @@ task :sloccount do
623
824
  end
624
825
  sh "sloccount", *Dir[
625
826
  "#{tmpdir}/*",
626
- "lib/phusion_passenger/*",
827
+ "lib/phusion_passenger",
627
828
  "lib/rake/{cplusplus,extensions}.rb",
628
829
  "ext/apache2",
830
+ "ext/nginx",
629
831
  "ext/oxt",
630
832
  "ext/phusion_passenger/*.c",
631
- "test/*.{cpp,rb}",
632
- "test/support/*.rb",
633
- "test/stub/*.rb",
833
+ "test/**/*.{cpp,rb}",
634
834
  "benchmark/*.{cpp,rb}"
635
835
  ]
636
836
  ensure
637
837
  system "rm -rf #{tmpdir}"
638
838
  end
639
839
  end
640
-