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.
- data/DEVELOPERS.TXT +2 -0
- data/INSTALL +3 -1
- data/LICENSE +19 -355
- data/NEWS +3 -0
- data/README +11 -4
- data/Rakefile +435 -236
- data/bin/passenger-config +20 -14
- data/bin/passenger-install-apache2-module +67 -201
- data/bin/passenger-install-nginx-module +477 -0
- data/bin/passenger-make-enterprisey +17 -12
- data/bin/passenger-memory-stats +33 -23
- data/bin/passenger-spawn-server +17 -12
- data/bin/passenger-status +18 -13
- data/bin/passenger-stress-test +17 -12
- data/doc/{Users guide.html → Users guide Apache.html } +79 -61
- data/doc/{Users guide.txt → Users guide Apache.txt } +43 -939
- data/doc/Users guide Nginx.html +2276 -0
- data/doc/Users guide Nginx.txt +776 -0
- data/doc/cxxapi/ApplicationPoolServer_8h-source.html +9 -4
- data/doc/cxxapi/ApplicationPool_8h-source.html +9 -4
- data/doc/cxxapi/Application_8h-source.html +26 -21
- data/doc/cxxapi/Bucket_8h-source.html +54 -44
- data/doc/cxxapi/CachedFileStat_8h-source.html +9 -4
- data/doc/cxxapi/Configuration_8h-source.html +357 -339
- data/doc/cxxapi/DirectoryMapper_8h-source.html +294 -280
- data/doc/cxxapi/DummySpawnManager_8h-source.html +9 -4
- data/doc/cxxapi/Exceptions_8h-source.html +9 -4
- data/doc/cxxapi/FileChecker_8h-source.html +9 -4
- data/doc/cxxapi/Hooks_8h-source.html +50 -40
- data/doc/cxxapi/Logging_8h-source.html +9 -4
- data/doc/cxxapi/MessageChannel_8h-source.html +20 -15
- data/doc/cxxapi/PoolOptions_8h-source.html +10 -5
- data/doc/cxxapi/SpawnManager_8h-source.html +9 -4
- data/doc/cxxapi/StandardApplicationPool_8h-source.html +10 -5
- data/doc/cxxapi/SystemTime_8h-source.html +9 -4
- data/doc/cxxapi/Utils_8h-source.html +242 -214
- data/doc/cxxapi/annotated.html +4 -28
- data/doc/cxxapi/classClient-members.html +4 -4
- data/doc/cxxapi/classClient.html +14 -11
- data/doc/cxxapi/classHooks-members.html +4 -5
- data/doc/cxxapi/classHooks.html +26 -24
- data/doc/cxxapi/classPassenger_1_1Application-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1Application.html +40 -37
- data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +95 -92
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +26 -23
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +17 -17
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +139 -136
- data/doc/cxxapi/classPassenger_1_1BufferedUpload-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1BufferedUpload.html +13 -10
- data/doc/cxxapi/classPassenger_1_1BusyException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1BusyException.html +11 -8
- data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +11 -8
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +4 -5
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +45 -43
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +13 -10
- data/doc/cxxapi/classPassenger_1_1FileChecker-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1FileChecker.html +22 -19
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +12 -9
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1FileSystemException.html +14 -11
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1IOException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1IOException.html +12 -9
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +228 -225
- data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1RuntimeException.html +11 -8
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +14 -11
- data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1SpawnManager.html +50 -47
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +73 -70
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SystemException-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1SystemException.html +17 -14
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SystemTime-members.html +4 -4
- data/doc/cxxapi/classPassenger_1_1SystemTime.html +14 -11
- data/doc/cxxapi/classes.html +35 -0
- data/doc/cxxapi/definitions_8h-source.html +9 -4
- data/doc/cxxapi/doxygen.css +311 -303
- data/doc/cxxapi/files.html +9 -18
- data/doc/cxxapi/functions.html +5 -224
- data/doc/cxxapi/functions_func.html +5 -185
- data/doc/cxxapi/functions_type.html +4 -4
- data/doc/cxxapi/functions_vars.html +4 -4
- data/doc/cxxapi/graph_legend.dot +19 -19
- data/doc/cxxapi/graph_legend.html +5 -5
- data/doc/cxxapi/graph_legend.png +0 -0
- data/doc/cxxapi/group__Configuration.html +11 -13
- data/doc/cxxapi/group__Configuration.png +0 -0
- data/doc/cxxapi/group__Core.html +10 -12
- data/doc/cxxapi/group__Core.png +0 -0
- data/doc/cxxapi/group__Exceptions.html +5 -7
- data/doc/cxxapi/group__Hooks.html +5 -7
- data/doc/cxxapi/group__Hooks.png +0 -0
- data/doc/cxxapi/group__Support.html +5 -624
- data/doc/cxxapi/hierarchy.html +6 -6
- data/doc/cxxapi/inherit__graph__0.map +1 -1
- data/doc/cxxapi/inherit__graph__0.md5 +1 -1
- data/doc/cxxapi/inherit__graph__0.png +0 -0
- data/doc/cxxapi/inherit__graph__1.map +1 -1
- data/doc/cxxapi/inherit__graph__1.md5 +1 -1
- data/doc/cxxapi/inherit__graph__1.png +0 -0
- data/doc/cxxapi/inherit__graph__10.map +1 -1
- data/doc/cxxapi/inherit__graph__10.md5 +1 -1
- data/doc/cxxapi/inherit__graph__10.png +0 -0
- data/doc/cxxapi/inherit__graph__11.map +1 -1
- data/doc/cxxapi/inherit__graph__11.md5 +1 -1
- data/doc/cxxapi/inherit__graph__11.png +0 -0
- data/doc/cxxapi/inherit__graph__12.map +1 -1
- data/doc/cxxapi/inherit__graph__12.md5 +1 -1
- data/doc/cxxapi/inherit__graph__12.png +0 -0
- data/doc/cxxapi/inherit__graph__13.map +1 -2
- data/doc/cxxapi/inherit__graph__13.md5 +1 -1
- data/doc/cxxapi/inherit__graph__13.png +0 -0
- data/doc/cxxapi/inherit__graph__14.map +2 -1
- data/doc/cxxapi/inherit__graph__14.md5 +1 -1
- data/doc/cxxapi/inherit__graph__14.png +0 -0
- data/doc/cxxapi/inherit__graph__15.map +1 -1
- data/doc/cxxapi/inherit__graph__15.md5 +1 -1
- data/doc/cxxapi/inherit__graph__15.png +0 -0
- data/doc/cxxapi/inherit__graph__16.map +1 -1
- data/doc/cxxapi/inherit__graph__16.md5 +1 -1
- data/doc/cxxapi/inherit__graph__16.png +0 -0
- data/doc/cxxapi/inherit__graph__17.map +1 -1
- data/doc/cxxapi/inherit__graph__17.md5 +1 -1
- data/doc/cxxapi/inherit__graph__17.png +0 -0
- data/doc/cxxapi/inherit__graph__18.map +1 -1
- data/doc/cxxapi/inherit__graph__18.md5 +1 -1
- data/doc/cxxapi/inherit__graph__18.png +0 -0
- data/doc/cxxapi/inherit__graph__19.map +1 -1
- data/doc/cxxapi/inherit__graph__19.md5 +1 -1
- data/doc/cxxapi/inherit__graph__19.png +0 -0
- data/doc/cxxapi/inherit__graph__2.map +1 -1
- data/doc/cxxapi/inherit__graph__2.md5 +1 -1
- data/doc/cxxapi/inherit__graph__2.png +0 -0
- data/doc/cxxapi/inherit__graph__20.map +2 -2
- data/doc/cxxapi/inherit__graph__20.md5 +1 -1
- data/doc/cxxapi/inherit__graph__20.png +0 -0
- data/doc/cxxapi/inherit__graph__21.map +1 -1
- data/doc/cxxapi/inherit__graph__21.md5 +1 -1
- data/doc/cxxapi/inherit__graph__21.png +0 -0
- data/doc/cxxapi/inherit__graph__3.map +1 -1
- data/doc/cxxapi/inherit__graph__3.md5 +1 -1
- data/doc/cxxapi/inherit__graph__3.png +0 -0
- data/doc/cxxapi/inherit__graph__4.map +1 -1
- data/doc/cxxapi/inherit__graph__4.md5 +1 -1
- data/doc/cxxapi/inherit__graph__4.png +0 -0
- data/doc/cxxapi/inherit__graph__5.map +1 -2
- data/doc/cxxapi/inherit__graph__5.md5 +1 -1
- data/doc/cxxapi/inherit__graph__5.png +0 -0
- data/doc/cxxapi/inherit__graph__6.map +2 -1
- data/doc/cxxapi/inherit__graph__6.md5 +1 -1
- data/doc/cxxapi/inherit__graph__6.png +0 -0
- data/doc/cxxapi/inherit__graph__7.map +1 -1
- data/doc/cxxapi/inherit__graph__7.md5 +1 -1
- data/doc/cxxapi/inherit__graph__7.png +0 -0
- data/doc/cxxapi/inherit__graph__8.map +1 -1
- data/doc/cxxapi/inherit__graph__8.md5 +1 -1
- data/doc/cxxapi/inherit__graph__8.png +0 -0
- data/doc/cxxapi/inherit__graph__9.map +1 -1
- data/doc/cxxapi/inherit__graph__9.md5 +1 -1
- data/doc/cxxapi/inherit__graph__9.png +0 -0
- data/doc/cxxapi/inherits.html +41 -41
- data/doc/cxxapi/main.html +4 -4
- data/doc/cxxapi/modules.html +4 -5
- data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +4 -4
- data/doc/cxxapi/structPassenger_1_1AnythingToString.html +13 -10
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +5 -5
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +16 -13
- data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +4 -4
- data/doc/cxxapi/structPassenger_1_1PoolOptions.html +63 -60
- data/doc/cxxapi/tabs.css +5 -2
- data/doc/cxxapi/tree.html +7 -81
- data/doc/rdoc/classes/ConditionVariable.html +59 -59
- data/doc/rdoc/classes/Exception.html +11 -11
- data/doc/rdoc/classes/GC.html +4 -4
- data/doc/rdoc/classes/IO.html +14 -14
- data/doc/rdoc/classes/PhusionPassenger.html +75 -20
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +153 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +125 -130
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +236 -236
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +213 -213
- data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +28 -28
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +91 -75
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +10 -10
- data/doc/rdoc/classes/PhusionPassenger/Application.html +64 -64
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +34 -34
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +13 -13
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +30 -30
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +10 -10
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +136 -136
- data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +24 -24
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +42 -42
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +55 -53
- data/doc/rdoc/classes/PhusionPassenger/Railz.html +1 -1
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +25 -30
- data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +23 -23
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +116 -117
- data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +22 -22
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +118 -124
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +10 -10
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +354 -354
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +9 -9
- data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +37 -37
- data/doc/rdoc/classes/PlatformInfo.html +282 -261
- data/doc/rdoc/classes/RakeExtensions.html +7 -7
- data/doc/rdoc/classes/Signal.html +26 -26
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +6 -1
- data/doc/rdoc/files/README.html +15 -6
- data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +129 -0
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +20 -13
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +31 -1
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +31 -1
- data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +21 -12
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +22 -12
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +21 -12
- data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +1 -1
- data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +21 -12
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +19 -13
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +27 -21
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +21 -12
- data/doc/rdoc/files/misc/rake/extensions_rb.html +21 -12
- data/doc/rdoc/fr_class_index.html +1 -0
- data/doc/rdoc/fr_file_index.html +2 -0
- data/doc/rdoc/fr_method_index.html +116 -112
- data/doc/users_guide_snippets/analysis_and_system_maintenance_tools.txt +144 -0
- data/doc/users_guide_snippets/appendix_a_about.txt +13 -0
- data/doc/users_guide_snippets/appendix_b_terminology.txt +63 -0
- data/doc/users_guide_snippets/appendix_c_spawning_methods.txt +304 -0
- data/doc/users_guide_snippets/global_queueing_explained.txt +78 -0
- data/doc/users_guide_snippets/rackup_specifications.txt +75 -0
- data/doc/users_guide_snippets/rails_spawn_method.txt +48 -0
- data/doc/users_guide_snippets/tips.txt +173 -0
- data/ext/apache2/Bucket.cpp +17 -12
- data/ext/apache2/Bucket.h +17 -12
- data/ext/apache2/Configuration.cpp +17 -12
- data/ext/apache2/Configuration.h +27 -14
- data/ext/apache2/DirectoryMapper.h +21 -12
- data/ext/apache2/Hooks.cpp +67 -21
- data/ext/apache2/Hooks.h +17 -12
- data/ext/apache2/mod_passenger.c +17 -12
- data/ext/{apache2 → common}/Application.h +19 -14
- data/ext/{apache2 → common}/ApplicationPool.h +17 -12
- data/ext/{apache2 → common}/ApplicationPoolServer.h +18 -72
- data/ext/{apache2 → common}/ApplicationPoolServerExecutable.cpp +45 -104
- data/ext/common/ApplicationPoolStatusReporter.h +212 -0
- data/ext/{apache2 → common}/CachedFileStat.cpp +17 -12
- data/ext/{apache2 → common}/CachedFileStat.h +17 -12
- data/ext/{apache2 → common}/DummySpawnManager.h +17 -12
- data/ext/{apache2 → common}/Exceptions.h +17 -12
- data/ext/{apache2 → common}/FileChecker.h +17 -12
- data/ext/common/Logging.cpp +65 -0
- data/ext/{apache2 → common}/Logging.h +17 -12
- data/ext/{apache2 → common}/MessageChannel.h +17 -12
- data/ext/{apache2 → common}/PoolOptions.h +17 -12
- data/ext/{apache2 → common}/SpawnManager.h +17 -12
- data/ext/{apache2 → common}/StandardApplicationPool.h +17 -12
- data/ext/common/StaticString.h +147 -0
- data/ext/common/SystemTime.cpp +33 -0
- data/ext/{apache2 → common}/SystemTime.h +17 -12
- data/ext/{apache2 → common}/Utils.cpp +69 -12
- data/ext/{apache2 → common}/Utils.h +41 -12
- data/ext/nginx/Configuration.c +1091 -0
- data/ext/nginx/Configuration.h +71 -0
- data/ext/nginx/ContentHandler.c +1154 -0
- data/ext/nginx/ContentHandler.h +64 -0
- data/ext/nginx/HelperServer.cpp +857 -0
- data/ext/nginx/HttpStatusExtractor.h +161 -0
- data/ext/nginx/ScgiRequestParser.h +317 -0
- data/ext/nginx/StaticContentHandler.c +222 -0
- data/ext/nginx/StaticContentHandler.h +37 -0
- data/ext/nginx/config +41 -0
- data/ext/nginx/ngx_http_passenger_module.c +572 -0
- data/ext/nginx/ngx_http_passenger_module.h +72 -0
- data/ext/oxt/backtrace.cpp +8 -1
- data/ext/oxt/system_calls.cpp +40 -0
- data/ext/oxt/system_calls.hpp +14 -7
- data/ext/phusion_passenger/extconf.rb +17 -12
- data/ext/phusion_passenger/native_support.c +19 -12
- data/lib/phusion_passenger/abstract_installer.rb +196 -0
- data/lib/phusion_passenger/abstract_request_handler.rb +19 -24
- data/lib/phusion_passenger/abstract_server.rb +17 -12
- data/lib/phusion_passenger/abstract_server_collection.rb +17 -12
- data/lib/phusion_passenger/admin_tools.rb +23 -0
- data/lib/phusion_passenger/admin_tools/control_process.rb +39 -13
- data/lib/phusion_passenger/application.rb +17 -12
- data/lib/phusion_passenger/console_text_template.rb +17 -12
- data/lib/phusion_passenger/constants.rb +22 -11
- data/lib/phusion_passenger/dependencies.rb +47 -12
- data/lib/phusion_passenger/events.rb +17 -12
- data/lib/phusion_passenger/exceptions.rb +17 -12
- data/lib/phusion_passenger/html_template.rb +17 -12
- data/lib/phusion_passenger/message_channel.rb +17 -12
- data/lib/phusion_passenger/packaging.rb +39 -0
- data/lib/phusion_passenger/platform_info.rb +48 -22
- data/lib/phusion_passenger/rack/application_spawner.rb +22 -11
- data/lib/phusion_passenger/rack/request_handler.rb +21 -12
- data/lib/phusion_passenger/railz/application_spawner.rb +23 -23
- data/lib/phusion_passenger/railz/framework_spawner.rb +18 -14
- data/lib/phusion_passenger/railz/request_handler.rb +18 -11
- data/lib/phusion_passenger/simple_benchmarking.rb +17 -12
- data/lib/phusion_passenger/spawn_manager.rb +17 -20
- 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
- data/lib/phusion_passenger/templates/{apache2_config_snippets.txt.erb → apache2/config_snippets.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/{deployment_example.txt.erb → apache2/deployment_example.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/{no_write_permission_to_passenger_root.txt.erb → apache2/no_write_permission_to_passenger_root.txt.erb} +0 -0
- 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
- data/lib/phusion_passenger/templates/{run_installer_as_root.txt.erb → apache2/run_installer_as_root.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/{welcome.txt.erb → apache2/welcome.txt.erb} +0 -0
- data/lib/phusion_passenger/templates/nginx/ask_for_extra_configure_flags.txt.erb +8 -0
- data/lib/phusion_passenger/templates/nginx/cannot_write_to_dir.txt.erb +11 -0
- data/lib/phusion_passenger/templates/nginx/config_snippets.txt.erb +17 -0
- data/lib/phusion_passenger/templates/nginx/config_snippets_inserted.txt.erb +20 -0
- data/lib/phusion_passenger/templates/nginx/confirm_extra_configure_flags.txt.erb +5 -0
- data/lib/phusion_passenger/templates/nginx/deployment_example.txt.erb +22 -0
- data/lib/phusion_passenger/templates/nginx/pcre_could_not_be_downloaded.txt.erb +11 -0
- data/lib/phusion_passenger/templates/nginx/pcre_could_not_be_extracted.txt.erb +11 -0
- data/lib/phusion_passenger/templates/nginx/possible_solutions_for_compilation_and_installation_problems.txt.erb +11 -0
- data/lib/phusion_passenger/templates/nginx/possible_solutions_for_download_and_extraction_problems.txt.erb +20 -0
- data/lib/phusion_passenger/templates/nginx/query_download_and_install.txt.erb +21 -0
- data/lib/phusion_passenger/templates/nginx/run_installer_as_root.txt.erb +8 -0
- data/lib/phusion_passenger/templates/nginx/welcome.txt.erb +15 -0
- data/lib/phusion_passenger/utils.rb +20 -15
- data/lib/phusion_passenger/wsgi/application_spawner.rb +18 -11
- data/lib/phusion_passenger/wsgi/request_handler.py +23 -0
- data/misc/copy_boost_headers.rb +23 -0
- data/misc/find_owner_pipe_leaks.rb +18 -11
- data/misc/rake/cplusplus.rb +18 -11
- data/misc/rake/extensions.rb +21 -14
- data/misc/render_error_pages.rb +18 -11
- data/test/ApplicationPoolServerTest.cpp +1 -3
- data/test/ApplicationPoolServer_ApplicationPoolTest.cpp +1 -1
- data/test/CxxTestMain.cpp +19 -3
- data/test/HttpStatusExtractorTest.cpp +181 -0
- data/test/ScgiRequestParserTest.cpp +337 -0
- data/test/StaticStringTest.cpp +51 -0
- data/test/UtilsTest.cpp +32 -0
- data/test/config.yml.example +5 -0
- data/test/{integration_tests.rb → integration_tests/apache2_tests.rb} +7 -299
- data/test/integration_tests/hello_world_rack_spec.rb +36 -0
- data/test/integration_tests/hello_world_wsgi_spec.rb +41 -0
- data/test/integration_tests/mycook_spec.rb +192 -0
- data/test/integration_tests/nginx_tests.rb +98 -0
- data/test/ruby/rack/application_spawner_spec.rb +40 -0
- data/test/stub/nginx/koi-utf +109 -0
- data/test/stub/nginx/koi-win +103 -0
- data/test/stub/nginx/mime.types +70 -0
- data/test/stub/nginx/nginx.conf.erb +57 -0
- data/test/stub/nginx/win-utf +126 -0
- data/test/stub/rails_apps/mycook/app/controllers/uploads_controller.rb +4 -0
- data/test/stub/rails_apps/mycook/config/routes.rb +1 -1
- data/test/stub/wsgi/passenger_wsgi.pyc +0 -0
- data/test/support/Support.h +40 -0
- data/test/support/nginx_controller.rb +98 -0
- data/test/support/test_helper.rb +79 -0
- metadata +1091 -1028
- data/benchmark/DummyRequestHandler.cpp +0 -101
- data/ext/apache2/Logging.cpp +0 -60
- data/ext/apache2/SystemTime.cpp +0 -28
@@ -0,0 +1,72 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) Igor Sysoev
|
3
|
+
* Copyright (C) 2007 Manlio Perillo (manlio.perillo@gmail.com)
|
4
|
+
* Copyright (C) 2008 Phusion
|
5
|
+
*
|
6
|
+
* Redistribution and use in source and binary forms, with or without
|
7
|
+
* modification, are permitted provided that the following conditions
|
8
|
+
* are met:
|
9
|
+
* 1. Redistributions of source code must retain the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
12
|
+
* notice, this list of conditions and the following disclaimer in the
|
13
|
+
* documentation and/or other materials provided with the distribution.
|
14
|
+
*
|
15
|
+
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
16
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
18
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
|
19
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
20
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
21
|
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
22
|
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
23
|
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
24
|
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
25
|
+
* SUCH DAMAGE.
|
26
|
+
*/
|
27
|
+
|
28
|
+
#ifndef _PASSENGER_NGINX_MODULE_H_
|
29
|
+
#define _PASSENGER_NGINX_MODULE_H_
|
30
|
+
|
31
|
+
#include <ngx_core.h>
|
32
|
+
#include "../common/CachedFileStat.h"
|
33
|
+
|
34
|
+
/**
|
35
|
+
* The Nginx version number as an integer.
|
36
|
+
* For example, on nginx 1.7.30 this value is 1007030.
|
37
|
+
*/
|
38
|
+
#define NGINX_VERSION_NUM \
|
39
|
+
(1000000 * PASSENGER_NGINX_MAJOR_VERSION + \
|
40
|
+
1000 * PASSENGER_NGINX_MINOR_VERSION + \
|
41
|
+
PASSENGER_NGINX_MICRO_VERSION)
|
42
|
+
|
43
|
+
extern ngx_module_t ngx_http_passenger_module;
|
44
|
+
|
45
|
+
/**
|
46
|
+
* The folder in which Passenger temp files are to be stored. This folder
|
47
|
+
* is created during Nginx initialization and removed during Nginx shutdown.
|
48
|
+
*/
|
49
|
+
extern const char passenger_temp_dir[NGX_MAX_PATH];
|
50
|
+
|
51
|
+
/**
|
52
|
+
* A static schema string to be assigned to Nginx 'upstream' strctures.
|
53
|
+
*/
|
54
|
+
extern ngx_str_t passenger_schema_string;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* An autogenerated password, used for authenticating with the helper server.
|
58
|
+
*/
|
59
|
+
extern ngx_str_t passenger_helper_server_password;
|
60
|
+
|
61
|
+
/**
|
62
|
+
* The filename of the Unix socket on which the helper server is listening.
|
63
|
+
*/
|
64
|
+
extern const char passenger_helper_server_socket[NGX_MAX_PATH];
|
65
|
+
|
66
|
+
/**
|
67
|
+
* A CachedMultiFileStat object used for caching stat() calls.
|
68
|
+
*/
|
69
|
+
extern CachedMultiFileStat *passenger_stat_cache;
|
70
|
+
|
71
|
+
#endif /* _PASSENGER_NGINX_MODULE_H_ */
|
72
|
+
|
data/ext/oxt/backtrace.cpp
CHANGED
@@ -27,6 +27,7 @@
|
|
27
27
|
#include <boost/thread/mutex.hpp>
|
28
28
|
#include <boost/thread/tss.hpp>
|
29
29
|
#include <sstream>
|
30
|
+
#include <cstring>
|
30
31
|
#include "backtrace.hpp"
|
31
32
|
|
32
33
|
namespace oxt {
|
@@ -142,7 +143,13 @@ format_backtrace(Iterable backtrace_list) {
|
|
142
143
|
|
143
144
|
result << " in '" << p->function << "'";
|
144
145
|
if (p->source != NULL) {
|
145
|
-
|
146
|
+
const char *source = strrchr(p->source, '/');
|
147
|
+
if (source != NULL) {
|
148
|
+
source++;
|
149
|
+
} else {
|
150
|
+
source = p->source;
|
151
|
+
}
|
152
|
+
result << " (" << source << ":" << p->line << ")";
|
146
153
|
}
|
147
154
|
result << endl;
|
148
155
|
}
|
data/ext/oxt/system_calls.cpp
CHANGED
@@ -104,6 +104,26 @@ syscalls::close(int fd) {
|
|
104
104
|
return ret;
|
105
105
|
}
|
106
106
|
|
107
|
+
int
|
108
|
+
syscalls::accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
|
109
|
+
int ret;
|
110
|
+
CHECK_INTERRUPTION(
|
111
|
+
ret == -1,
|
112
|
+
ret = ::accept(sockfd, addr, addrlen)
|
113
|
+
);
|
114
|
+
return ret;
|
115
|
+
}
|
116
|
+
|
117
|
+
int
|
118
|
+
syscalls::bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
|
119
|
+
int ret;
|
120
|
+
CHECK_INTERRUPTION(
|
121
|
+
ret == -1,
|
122
|
+
ret = ::bind(sockfd, addr, addrlen)
|
123
|
+
);
|
124
|
+
return ret;
|
125
|
+
}
|
126
|
+
|
107
127
|
int
|
108
128
|
syscalls::connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) {
|
109
129
|
int ret;
|
@@ -114,6 +134,16 @@ syscalls::connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrle
|
|
114
134
|
return ret;
|
115
135
|
}
|
116
136
|
|
137
|
+
int
|
138
|
+
syscalls::listen(int sockfd, int backlog) {
|
139
|
+
int ret;
|
140
|
+
CHECK_INTERRUPTION(
|
141
|
+
ret == -1,
|
142
|
+
ret = ::listen(sockfd, backlog)
|
143
|
+
);
|
144
|
+
return ret;
|
145
|
+
}
|
146
|
+
|
117
147
|
int
|
118
148
|
syscalls::socket(int domain, int type, int protocol) {
|
119
149
|
int ret;
|
@@ -202,6 +232,16 @@ syscalls::fclose(FILE *fp) {
|
|
202
232
|
return ret;
|
203
233
|
}
|
204
234
|
|
235
|
+
int
|
236
|
+
syscalls::unlink(const char *pathname) {
|
237
|
+
int ret;
|
238
|
+
CHECK_INTERRUPTION(
|
239
|
+
ret == -1,
|
240
|
+
ret = ::unlink(pathname)
|
241
|
+
);
|
242
|
+
return ret;
|
243
|
+
}
|
244
|
+
|
205
245
|
int
|
206
246
|
syscalls::stat(const char *path, struct stat *buf) {
|
207
247
|
int ret;
|
data/ext/oxt/system_calls.hpp
CHANGED
@@ -49,12 +49,15 @@
|
|
49
49
|
* boost::thread_interrupted upon interruption, instead of returning an EINTR
|
50
50
|
* error.
|
51
51
|
*
|
52
|
-
*
|
53
|
-
* interruption is
|
54
|
-
*
|
55
|
-
*
|
56
|
-
*
|
57
|
-
*
|
52
|
+
* Once setup_syscall_interruption_support() has been called, system call
|
53
|
+
* interruption is enabled by default. You can enable or disable system call
|
54
|
+
* interruption in the current scope by creating instances of
|
55
|
+
* boost::this_thread::enable_syscall_interruption or
|
56
|
+
* boost::this_thread::disable_syscall_interruption, respectively. When system
|
57
|
+
* call interruption is disabled, the oxt::syscall wrapper functions will
|
58
|
+
* ignore interruption requests -- that is, they will never throw
|
59
|
+
* boost::thread_interrupted, nor will they return EINTR errors. This is similar
|
60
|
+
* to Boost thread interruption.
|
58
61
|
*
|
59
62
|
* <h2>How to interrupt</h2>
|
60
63
|
* Generally, oxt::thread::interrupt() and oxt::thread::interrupt_and_join()
|
@@ -93,7 +96,7 @@
|
|
93
96
|
// This is one of the things that Java is good at and C++ sucks at. Sigh...
|
94
97
|
|
95
98
|
namespace oxt {
|
96
|
-
static const int INTERRUPTION_SIGNAL =
|
99
|
+
static const int INTERRUPTION_SIGNAL = SIGUSR2;
|
97
100
|
|
98
101
|
/**
|
99
102
|
* Setup system call interruption support.
|
@@ -121,7 +124,10 @@ namespace oxt {
|
|
121
124
|
ssize_t write(int fd, const void *buf, size_t count);
|
122
125
|
int close(int fd);
|
123
126
|
|
127
|
+
int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
|
128
|
+
int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
|
124
129
|
int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen);
|
130
|
+
int listen(int sockfd, int backlog);
|
125
131
|
int socket(int domain, int type, int protocol);
|
126
132
|
int socketpair(int d, int type, int protocol, int sv[2]);
|
127
133
|
ssize_t recvmsg(int s, struct msghdr *msg, int flags);
|
@@ -132,6 +138,7 @@ namespace oxt {
|
|
132
138
|
|
133
139
|
FILE *fopen(const char *path, const char *mode);
|
134
140
|
int fclose(FILE *fp);
|
141
|
+
int unlink(const char *pathname);
|
135
142
|
int stat(const char *path, struct stat *buf);
|
136
143
|
|
137
144
|
time_t time(time_t *t);
|
@@ -1,20 +1,25 @@
|
|
1
1
|
# Phusion Passenger - http://www.modrails.com/
|
2
|
-
# Copyright (
|
2
|
+
# Copyright (c) 2008, 2009 Phusion
|
3
3
|
#
|
4
|
-
# Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.
|
4
|
+
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
5
5
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
# the
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
9
12
|
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
# GNU General Public License for more details.
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
14
15
|
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
# THE SOFTWARE.
|
18
23
|
require 'mkmf'
|
19
24
|
$LIBS=""
|
20
25
|
|
@@ -1,21 +1,26 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - http://www.modrails.com/
|
3
|
-
* Copyright (
|
3
|
+
* Copyright (c) 2008, 2009 Phusion
|
4
4
|
*
|
5
|
-
* Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.
|
5
|
+
* "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
* the
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
12
|
+
* furnished to do so, subject to the following conditions:
|
10
13
|
*
|
11
|
-
*
|
12
|
-
*
|
13
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
-
* GNU General Public License for more details.
|
14
|
+
* The above copyright notice and this permission notice shall be included in
|
15
|
+
* all copies or substantial portions of the Software.
|
15
16
|
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
* THE SOFTWARE.
|
19
24
|
*/
|
20
25
|
#include "ruby.h"
|
21
26
|
#include <sys/types.h>
|
@@ -277,6 +282,8 @@ disable_stdio_buffering() {
|
|
277
282
|
return Qnil;
|
278
283
|
}
|
279
284
|
|
285
|
+
/***************************/
|
286
|
+
|
280
287
|
void
|
281
288
|
Init_native_support() {
|
282
289
|
struct sockaddr_un addr;
|
@@ -0,0 +1,196 @@
|
|
1
|
+
# Phusion Passenger - http://www.modrails.com/
|
2
|
+
# Copyright (c) 2008, 2009 Phusion
|
3
|
+
#
|
4
|
+
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in
|
14
|
+
# all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
|
+
# THE SOFTWARE.
|
23
|
+
|
24
|
+
require 'phusion_passenger/constants'
|
25
|
+
require 'phusion_passenger/packaging'
|
26
|
+
require 'phusion_passenger/console_text_template'
|
27
|
+
|
28
|
+
module PhusionPassenger
|
29
|
+
|
30
|
+
# Abstract base class for installers. Used by passenger-install-apache2-module
|
31
|
+
# and passenger-install-nginx-module.
|
32
|
+
class AbstractInstaller
|
33
|
+
PASSENGER_WEBSITE = "http://www.modrails.com/"
|
34
|
+
PHUSION_WEBSITE = "www.phusion.nl"
|
35
|
+
|
36
|
+
def initialize(options = {})
|
37
|
+
options.each_pair do |key, value|
|
38
|
+
instance_variable_set(:"@#{key}", value)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def start
|
43
|
+
install!
|
44
|
+
ensure
|
45
|
+
reset_terminal_colors
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
def reset_terminal_colors
|
50
|
+
STDOUT.write("\e[0m")
|
51
|
+
STDOUT.flush
|
52
|
+
end
|
53
|
+
|
54
|
+
def color_print(text)
|
55
|
+
STDOUT.write(ConsoleTextTemplate.new(:text => text).result)
|
56
|
+
STDOUT.flush
|
57
|
+
end
|
58
|
+
|
59
|
+
def color_puts(text)
|
60
|
+
color_print("#{text}\n")
|
61
|
+
end
|
62
|
+
|
63
|
+
def render_template(name, options = {})
|
64
|
+
puts ConsoleTextTemplate.new({ :file => name }, options).result
|
65
|
+
end
|
66
|
+
|
67
|
+
def new_screen
|
68
|
+
puts
|
69
|
+
line
|
70
|
+
puts
|
71
|
+
end
|
72
|
+
|
73
|
+
def line
|
74
|
+
puts "--------------------------------------------"
|
75
|
+
end
|
76
|
+
|
77
|
+
def prompt(message)
|
78
|
+
done = false
|
79
|
+
while !done
|
80
|
+
color_print "#{message}: "
|
81
|
+
begin
|
82
|
+
result = STDIN.readline
|
83
|
+
rescue EOFError
|
84
|
+
exit 2
|
85
|
+
end
|
86
|
+
result.strip!
|
87
|
+
done = !block_given? || yield(result)
|
88
|
+
end
|
89
|
+
return result
|
90
|
+
rescue Interrupt
|
91
|
+
exit 2
|
92
|
+
end
|
93
|
+
|
94
|
+
def wait(timeout = nil)
|
95
|
+
return if @auto
|
96
|
+
begin
|
97
|
+
if timeout
|
98
|
+
require 'timeout' unless defined?(Timeout)
|
99
|
+
begin
|
100
|
+
Timeout.timeout(timeout) do
|
101
|
+
STDIN.readline
|
102
|
+
end
|
103
|
+
rescue Timeout::Error
|
104
|
+
# Do nothing.
|
105
|
+
end
|
106
|
+
else
|
107
|
+
STDIN.readline
|
108
|
+
end
|
109
|
+
rescue Interrupt
|
110
|
+
exit 2
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def sh(*args)
|
115
|
+
puts "# #{args.join(' ')}"
|
116
|
+
result = system(*args)
|
117
|
+
if result
|
118
|
+
return true
|
119
|
+
elsif $?.signaled? && $?.termsig == Signal.list["INT"]
|
120
|
+
raise Interrupt
|
121
|
+
else
|
122
|
+
return false
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
def dependencies
|
127
|
+
return []
|
128
|
+
end
|
129
|
+
|
130
|
+
def check_dependencies
|
131
|
+
new_screen
|
132
|
+
missing_dependencies = []
|
133
|
+
color_puts "<banner>Checking for required software...</banner>"
|
134
|
+
puts
|
135
|
+
dependencies.each do |dep|
|
136
|
+
color_print " * #{dep.name}... "
|
137
|
+
result = dep.check
|
138
|
+
if result.found?
|
139
|
+
if result.found_at
|
140
|
+
color_puts "<green>found at #{result.found_at}</green>"
|
141
|
+
else
|
142
|
+
color_puts "<green>found</green>"
|
143
|
+
end
|
144
|
+
else
|
145
|
+
color_puts "<red>not found</red>"
|
146
|
+
missing_dependencies << dep
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
if missing_dependencies.empty?
|
151
|
+
return true
|
152
|
+
else
|
153
|
+
puts
|
154
|
+
color_puts "<red>Some required software is not installed.</red>"
|
155
|
+
color_puts "But don't worry, this installer will tell you how to install them.\n"
|
156
|
+
color_puts "<b>Press Enter to continue, or Ctrl-C to abort.</b>"
|
157
|
+
if PhusionPassenger.natively_packaged?
|
158
|
+
wait(10)
|
159
|
+
else
|
160
|
+
wait
|
161
|
+
end
|
162
|
+
|
163
|
+
line
|
164
|
+
puts
|
165
|
+
color_puts "<banner>Installation instructions for required software</banner>"
|
166
|
+
puts
|
167
|
+
missing_dependencies.each do |dep|
|
168
|
+
print_dependency_installation_instructions(dep)
|
169
|
+
puts
|
170
|
+
end
|
171
|
+
color_puts "If the aforementioned instructions didn't solve your problem, then please take"
|
172
|
+
color_puts "a look at the Users Guide:"
|
173
|
+
puts
|
174
|
+
color_puts " <yellow>#{users_guide}</yellow>"
|
175
|
+
return false
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
def print_dependency_installation_instructions(dep)
|
180
|
+
color_puts " * To install <yellow>#{dep.name}</yellow>:"
|
181
|
+
if !dep.install_command.nil?
|
182
|
+
color_puts " Please run <b>#{dep.install_command}</b> as root."
|
183
|
+
elsif !dep.install_instructions.nil?
|
184
|
+
color_puts " " << dep.install_instructions
|
185
|
+
elsif !dep.website.nil?
|
186
|
+
color_puts " Please download it from <b>#{dep.website}</b>"
|
187
|
+
if !dep.website_comments.nil?
|
188
|
+
color_puts " (#{dep.website_comments})"
|
189
|
+
end
|
190
|
+
else
|
191
|
+
color_puts " Search Google."
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
end # module PhusionPassenger
|