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,78 @@
|
|
1
|
+
.What does this option do?
|
2
|
+
|
3
|
+
Recall that Phusion Passenger spawns multiple backend processes (e.g. multiple
|
4
|
+
Ruby on Rails processes), each which processes HTTP requests serially. One of
|
5
|
+
Phusion Passenger's jobs is to forward HTTP requests to a suitable backend
|
6
|
+
process. A backend process may take an arbitrary amount of time to process a
|
7
|
+
specific HTTP request. If the websites are (temporarily) under high load, and
|
8
|
+
the backend processes cannot process the requests fast enough, then some
|
9
|
+
requests may have to be queued.
|
10
|
+
|
11
|
+
If global queuing is turned off, then Phusion Passenger will use 'fair load
|
12
|
+
balancing'. This means that each backend process will have its own private
|
13
|
+
queue. Phusion Passenger will forward an HTTP request to the backend process
|
14
|
+
that has the least amount of requests in its queue.
|
15
|
+
|
16
|
+
If global queuing is turned on, then Phusion Passenger will use a global queue
|
17
|
+
that's shared between all backend processes. If an HTTP request comes in, and
|
18
|
+
all the backend processes are still busy, then Phusion Passenger will wait until
|
19
|
+
at least one backend process is done, and will then forward the request to that
|
20
|
+
process.
|
21
|
+
|
22
|
+
.When to turn on global queuing?
|
23
|
+
|
24
|
+
You should turn on global queuing if one of your web applications may have
|
25
|
+
long-running requests.
|
26
|
+
|
27
|
+
For example suppose that:
|
28
|
+
|
29
|
+
- global queuing is turned off.
|
30
|
+
- we're currently in a state where all backend processes have 3 requests in
|
31
|
+
their queue, except for a single backend process, which has 1 request in its
|
32
|
+
queue.
|
33
|
+
|
34
|
+
The situation looks like this:
|
35
|
+
|
36
|
+
--------------------------------------------------
|
37
|
+
Backend process A: [* ] (1 request in queue)
|
38
|
+
Backend process B: [*** ] (3 requests in queue)
|
39
|
+
Backend process C: [*** ] (3 requests in queue)
|
40
|
+
Backend process D: [*** ] (3 requests in queue)
|
41
|
+
--------------------------------------------------
|
42
|
+
|
43
|
+
Each process is currently serving short-running requests.
|
44
|
+
|
45
|
+
Phusion Passenger will forward the next request to backend process A. A will
|
46
|
+
now have 2 items in its queue. We'll mark this new request with an X:
|
47
|
+
|
48
|
+
--------------------------------------------------
|
49
|
+
Backend process A: [*X ] (2 request in queue)
|
50
|
+
Backend process B: [*** ] (3 requests in queue)
|
51
|
+
Backend process C: [*** ] (3 requests in queue)
|
52
|
+
Backend process D: [*** ] (3 requests in queue)
|
53
|
+
--------------------------------------------------
|
54
|
+
|
55
|
+
Assuming that B, C and D still aren't done with their current request, the next
|
56
|
+
HTTP request - let's call this Y - will be forwarded to backend process A as
|
57
|
+
well, because it has the least number of items in its queue:
|
58
|
+
|
59
|
+
--------------------------------------------------
|
60
|
+
Backend process A: [*XY ] (3 requests in queue)
|
61
|
+
Backend process B: [*** ] (3 requests in queue)
|
62
|
+
Backend process C: [*** ] (3 requests in queue)
|
63
|
+
Backend process D: [*** ] (3 requests in queue)
|
64
|
+
--------------------------------------------------
|
65
|
+
|
66
|
+
But if request X happens to be a long-running request that needs 60 seconds to
|
67
|
+
complete, then we'll have a problem. Y won't be processed for at least 60
|
68
|
+
seconds. It would have been a better idea if Y was forward to processes B, C or
|
69
|
+
D instead, because they only have short-living requests in their queues.
|
70
|
+
|
71
|
+
This problem will be avoided entirely if you turn global queuing on. With global
|
72
|
+
queuing, all backend processes will share the same queue. The first backend
|
73
|
+
process that becomes available will take from the queue, and so this
|
74
|
+
``queuing-behind-long-running-request'' problem will never occur.
|
75
|
+
|
76
|
+
Turning global queuing off will yield a minor performance improvement (about 5%,
|
77
|
+
depending on how fast/slow your web application is), which is why it's off by
|
78
|
+
default.
|
@@ -0,0 +1,75 @@
|
|
1
|
+
This subsection shows example 'config.ru' files for various web frameworks.
|
2
|
+
|
3
|
+
==== Camping ====
|
4
|
+
------------------------------------------------------
|
5
|
+
require 'rubygems'
|
6
|
+
require 'rack'
|
7
|
+
require 'camping'
|
8
|
+
|
9
|
+
##### Begin Camping application
|
10
|
+
Camping.goes :Blog
|
11
|
+
|
12
|
+
...your application code here...
|
13
|
+
##### End Camping application
|
14
|
+
|
15
|
+
run Rack::Adapter::Camping.new(Blog)
|
16
|
+
------------------------------------------------------
|
17
|
+
|
18
|
+
For Camping versions 2.0 and up, using `run Blog` as the final line will do.
|
19
|
+
|
20
|
+
==== Halcyon ====
|
21
|
+
------------------------------------------------------
|
22
|
+
require 'rubygems'
|
23
|
+
require 'halcyon'
|
24
|
+
$LOAD_PATH.unshift(Halcyon.root / 'lib')
|
25
|
+
Halcyon::Runner.load_config Halcyon.root/'config'/'config.yml'
|
26
|
+
run Halcyon::Runner.new
|
27
|
+
------------------------------------------------------
|
28
|
+
|
29
|
+
==== Mack ====
|
30
|
+
------------------------------------------------------
|
31
|
+
ENV["MACK_ENV"] = ENV["RACK_ENV"]
|
32
|
+
load("Rakefile")
|
33
|
+
require 'rubygems'
|
34
|
+
require 'mack'
|
35
|
+
run Mack::Utils::Server.build_app
|
36
|
+
------------------------------------------------------
|
37
|
+
|
38
|
+
==== Merb ====
|
39
|
+
------------------------------------------------------
|
40
|
+
require 'rubygems'
|
41
|
+
require 'merb-core'
|
42
|
+
|
43
|
+
Merb::Config.setup(
|
44
|
+
:merb_root => File.expand_path(File.dirname(__FILE__)),
|
45
|
+
:environment => ENV['RACK_ENV']
|
46
|
+
)
|
47
|
+
Merb.environment = Merb::Config[:environment]
|
48
|
+
Merb.root = Merb::Config[:merb_root]
|
49
|
+
Merb::BootLoader.run
|
50
|
+
|
51
|
+
run Merb::Rack::Application.new
|
52
|
+
------------------------------------------------------
|
53
|
+
|
54
|
+
==== Ramaze ====
|
55
|
+
------------------------------------------------------
|
56
|
+
require "start"
|
57
|
+
Ramaze.trait[:essentials].delete Ramaze::Adapter
|
58
|
+
Ramaze.start :force => true
|
59
|
+
run Ramaze::Adapter::Base
|
60
|
+
------------------------------------------------------
|
61
|
+
|
62
|
+
==== Sinatra ====
|
63
|
+
------------------------------------------------------
|
64
|
+
require 'rubygems'
|
65
|
+
require 'sinatra'
|
66
|
+
|
67
|
+
root_dir = File.dirname(__FILE__)
|
68
|
+
|
69
|
+
set :environment, ENV['RACK_ENV'].to_sym
|
70
|
+
set :root, root_dir
|
71
|
+
set :app_file, File.join(root_dir, 'app.rb')
|
72
|
+
disable :run
|
73
|
+
|
74
|
+
run Sinatra::Application
|
75
|
+
------------------------------------------------------
|
@@ -0,0 +1,48 @@
|
|
1
|
+
Internally, Phusion Passenger spawns multiple Ruby on Rails processes in order to handle
|
2
|
+
requests. But there are multiple ways with which processes can be spawned, each having
|
3
|
+
its own set of pros and cons. Supported spawn methods are:
|
4
|
+
|
5
|
+
'smart'::
|
6
|
+
When this spawn method is used, Phusion Passenger will attempt to cache Ruby on Rails
|
7
|
+
framework code and application code for a limited period of time. Please read
|
8
|
+
<<spawning_methods_explained,Spawning methods explained>> for a more detailed
|
9
|
+
explanation of what smart spawning exactly does.
|
10
|
+
+
|
11
|
+
*Pros:*
|
12
|
+
This can significantly decrease spawn time (by as much as 90%). And, when Ruby Enterprise
|
13
|
+
Edition is used, <<reducing_memory_usage,memory usage can be reduced by 33% on average>>.
|
14
|
+
+
|
15
|
+
*Cons:*
|
16
|
+
Some Ruby on Rails applications and libraries are not compatible with smart spawning.
|
17
|
+
If that's the case for your application, then you should use 'conservative' as
|
18
|
+
spawning method.
|
19
|
+
|
20
|
+
'smart-lv2'::
|
21
|
+
This spawning method is similar to 'smart' but it skips the framework spawner
|
22
|
+
and uses the application spawner directly. This means the framework code is not
|
23
|
+
cached between multiple applications, although it is still cached within
|
24
|
+
instances of the same application. Please read
|
25
|
+
<<spawning_methods_explained,Spawning methods explained>> for a more detailed
|
26
|
+
explanation of what smart-lv2 spawning exactly does.
|
27
|
+
+
|
28
|
+
*Pros:* It is compatible with a larger number of applications when compared to
|
29
|
+
the 'smart' method, and still performs some caching.
|
30
|
+
+
|
31
|
+
*Cons:* It is slower than smart spawning if you have many applications which
|
32
|
+
use the same framework version. It is therefore advised that shared hosts use the
|
33
|
+
'smart' method instead.
|
34
|
+
|
35
|
+
'conservative'::
|
36
|
+
This spawning method is similar to the one used in Mongrel Cluster. It does not
|
37
|
+
perform any code caching at all. Please read
|
38
|
+
<<spawning_methods_explained,Spawning methods explained>> for a more detailed
|
39
|
+
explanation of what conservative spawning exactly does.
|
40
|
+
+
|
41
|
+
*Pros:*
|
42
|
+
Conservative spawning is guaranteed to be compatible with all Rails applications
|
43
|
+
and libraries.
|
44
|
+
+
|
45
|
+
*Cons:*
|
46
|
+
Much slower than smart spawning. Every spawn action will be equally slow, though no slower than
|
47
|
+
the startup time of a single server in Mongrel Cluster. Conservative spawning will also
|
48
|
+
render <<reducing_memory_usage,Ruby Enterprise Edition's memory reduction technology>> useless.
|
@@ -0,0 +1,173 @@
|
|
1
|
+
[[user_switching]]
|
2
|
+
=== User switching (security) ===
|
3
|
+
|
4
|
+
There is a problem that plagues most PHP web hosts, namely the fact that all PHP
|
5
|
+
applications are run in the same user context as the web server. So for
|
6
|
+
example, Joe's PHP application will be able to read Jane's PHP application's
|
7
|
+
passwords. This is obviously undesirable on many servers.
|
8
|
+
|
9
|
+
Phusion Passenger solves this problem by implementing 'user switching'. A Rails
|
10
|
+
application is started as the owner of the file 'config/environment.rb',
|
11
|
+
and a Rack application is started as the owner of the file 'config.ru'.
|
12
|
+
So if '/home/webapps/foo/config/environment.rb' is owned by 'joe', then Phusion
|
13
|
+
Passenger will launch the corresponding Rails application as 'joe' as well.
|
14
|
+
|
15
|
+
This behavior is the default, and you don't need to configure anything. But
|
16
|
+
there are things that you should keep in mind:
|
17
|
+
|
18
|
+
- The owner of 'environment.rb' must have read access to the Rails application's
|
19
|
+
folder, and read/write access to the Rails application's 'logs' folder.
|
20
|
+
Likewise, the owner of 'config.ru' must have read access to the Rack application's
|
21
|
+
folder.
|
22
|
+
- This feature is only available if Apache is started by 'root'. This is the
|
23
|
+
case on most Apache installations.
|
24
|
+
- Under no circumstances will applications be run as 'root'. If
|
25
|
+
'environment.rb'/'config.ru' is owned as root or by an unknown user, then the
|
26
|
+
Rails/Rack application will run as the user specified by
|
27
|
+
<<PassengerDefaultUser,PassengerDefaultUser (Apache)>>/<<PassengerDefaultUser,passenger_default_user (Nginx)>>.
|
28
|
+
|
29
|
+
User switching can be disabled with the
|
30
|
+
<<PassengerUserSwitching,PassengerUserSwitching (Apache)>>/<<PassengerUserSwitching,passenger_user_switching (Nginx)>>
|
31
|
+
option.
|
32
|
+
|
33
|
+
|
34
|
+
[[reducing_memory_usage]]
|
35
|
+
=== Reducing memory consumption of Ruby on Rails applications by 33% ===
|
36
|
+
|
37
|
+
Is it possible to reduce memory consumption of your Rails applications by 33% on average,
|
38
|
+
by using http://www.rubyenterpriseedition.com/[Ruby Enterprise Edition].
|
39
|
+
Please visit the website for details.
|
40
|
+
|
41
|
+
Note that this feature does not apply to Rack applications.
|
42
|
+
|
43
|
+
[[capistrano]]
|
44
|
+
=== Capistrano recipe ===
|
45
|
+
|
46
|
+
Phusion Passenger can be combined with link:http://capify.org/[Capistrano].
|
47
|
+
The following Capistrano recipe demonstrates Phusion Passenger support.
|
48
|
+
It assumes that you're using Git as version control system.
|
49
|
+
|
50
|
+
--------------------------------------------------
|
51
|
+
set :application, "myapp"
|
52
|
+
set :domain, "example.com"
|
53
|
+
set :repository, "ssh://#{domain}/path-to-your-git-repo/#{application}.git"
|
54
|
+
set :use_sudo, false
|
55
|
+
set :deploy_to, "/path-to-your-web-app-directory/#{application}"
|
56
|
+
set :scm, "git"
|
57
|
+
|
58
|
+
role :app, domain
|
59
|
+
role :web, domain
|
60
|
+
role :db, domain, :primary => true
|
61
|
+
|
62
|
+
namespace :deploy do
|
63
|
+
task :start, :roles => :app do
|
64
|
+
run "touch #{current_release}/tmp/restart.txt"
|
65
|
+
end
|
66
|
+
|
67
|
+
task :stop, :roles => :app do
|
68
|
+
# Do nothing.
|
69
|
+
end
|
70
|
+
|
71
|
+
desc "Restart Application"
|
72
|
+
task :restart, :roles => :app do
|
73
|
+
run "touch #{current_release}/tmp/restart.txt"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
--------------------------------------------------
|
77
|
+
|
78
|
+
|
79
|
+
[[moving_phusion_passenger]]
|
80
|
+
=== Moving Phusion Passenger to a different directory ===
|
81
|
+
|
82
|
+
It is possible to relocate the Phusion Passenger files to a different directory. It
|
83
|
+
involves two steps:
|
84
|
+
|
85
|
+
1. Moving the directory.
|
86
|
+
2. Updating the ``PassengerRoot'' configuration option in Apache.
|
87
|
+
|
88
|
+
For example, if Phusion Passenger is located in '/opt/passenger/', and you'd like to
|
89
|
+
move it to '/usr/local/passenger/', then do this:
|
90
|
+
|
91
|
+
1. Run the following command:
|
92
|
+
+
|
93
|
+
------------------------------------
|
94
|
+
mv /opt/passenger /usr/local/passenger
|
95
|
+
------------------------------------
|
96
|
+
2. Edit your Apache configuration file, and set:
|
97
|
+
+
|
98
|
+
------------------------------------
|
99
|
+
PassengerRoot /usr/local/passenger
|
100
|
+
------------------------------------
|
101
|
+
|
102
|
+
=== Installing multiple Ruby on Rails versions ===
|
103
|
+
|
104
|
+
Each Ruby on Rails applications that are going to be deployed may require a
|
105
|
+
specific Ruby on Rails version. You can install a specific version with
|
106
|
+
this command:
|
107
|
+
-----------------------------
|
108
|
+
gem install rails -v X.X.X
|
109
|
+
-----------------------------
|
110
|
+
where 'X.X.X' is the version number of Ruby on Rails.
|
111
|
+
|
112
|
+
All of these versions will exist in parallel, and will not conflict with each
|
113
|
+
other. Phusion Passenger will automatically make use of the correct version.
|
114
|
+
|
115
|
+
=== Making the application restart after each request ===
|
116
|
+
|
117
|
+
In some situations it might be desirable to restart the web application after
|
118
|
+
each request, for example when developing a non-Rails application that doesn't
|
119
|
+
support code reloading, or when developing a web framework.
|
120
|
+
|
121
|
+
To achieve this, simply create the file 'tmp/always_restart.txt' in your
|
122
|
+
application's root folder. Unlike 'restart.txt', Phusion Passenger does not
|
123
|
+
check for this file's timestamp: Phusion Passenger will always restart the
|
124
|
+
application, as long as 'always_restart.txt' exists.
|
125
|
+
|
126
|
+
NOTE: If you're just developing a Rails application then you probably don't need
|
127
|
+
this feature. If you set 'RailsEnv development' in your Apache configuration,
|
128
|
+
then Rails will automatically reload your application code after each request.
|
129
|
+
'always_restart.txt' is only useful if you're working on Ruby on Rails itself,
|
130
|
+
or when you're not developing a Rails application and your web framework
|
131
|
+
does not support code reloading.
|
132
|
+
|
133
|
+
[[sub_uri_deployment_uri_fix]]
|
134
|
+
=== How to fix broken images/CSS/JavaScript URIs in sub-URI deployments
|
135
|
+
|
136
|
+
Some people experience broken images and other broken static assets when they
|
137
|
+
deploy their application to a sub-URI (i.e. 'http://mysite.com/railsapp/').
|
138
|
+
The reason for this usually is that you used a
|
139
|
+
static URI for your image in the views. This means your 'img' source probably refers
|
140
|
+
to something like '/images/foo.jpg'. The leading slash means that it's an absolute URI:
|
141
|
+
you're telling the browser to always load 'http://mysite.com/images/foo.jpg' no
|
142
|
+
matter what. The problem is that the image is actually at
|
143
|
+
'http://mysite.com/railsapp/images/foo.jpg'. There are two ways to fix this.
|
144
|
+
|
145
|
+
The first way (not recommended) is to change your view templates to refer to
|
146
|
+
'images/foo.jpg'. This is a relative URI: note the lack of a leading slash). What
|
147
|
+
this does is making the path relative to the current URI. The problem is that if you
|
148
|
+
use restful URIs, then your images will probably break again when you add a level to
|
149
|
+
the URI.
|
150
|
+
For example, when you're at 'http://mysite.com/railsapp' the browser will look for
|
151
|
+
'http://mysite.com/railsapp/images/foo.jpg'. But when you're at
|
152
|
+
'http://mysite.com/railsapp/controller'. the browser will look for
|
153
|
+
'http://mysite.com/railsapp/controller/images/foo.jpg'.
|
154
|
+
So relative URIs usually don't work well with layout templates.
|
155
|
+
|
156
|
+
The second and highly recommended way is to always use Rails helper methods to
|
157
|
+
output tags for static assets. These helper methods automatically take care
|
158
|
+
of prepending the base URI that you've deployed the application to. For images
|
159
|
+
there is `image_tag`, for JavaScript there is `javascript_include_tag` and for
|
160
|
+
CSS there is `stylesheet_link_tag`. In the above example you would simply remove
|
161
|
+
the '<img>' HTML tag and replace it with inline Ruby like this:
|
162
|
+
|
163
|
+
---------------------------------------
|
164
|
+
<%= image_tag("foo.jpg") %>
|
165
|
+
---------------------------------------
|
166
|
+
|
167
|
+
This will generate the proper image tag to `$RAILS_ROOT/public/images/foo.jpg`
|
168
|
+
so that your images will always work no matter what sub-URI you've deployed to.
|
169
|
+
|
170
|
+
These helper methods are more valuable than you may think. For example they also
|
171
|
+
append a timestamp to the URI to better facilitate HTTP caching. For more information,
|
172
|
+
please refer to
|
173
|
+
link:http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html[the Rails API docs].
|
data/ext/apache2/Bucket.cpp
CHANGED
@@ -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 "Bucket.h"
|
21
26
|
|
data/ext/apache2/Bucket.h
CHANGED
@@ -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
|
#ifndef _PASSENGER_BUCKET_H_
|
21
26
|
#define _PASSENGER_BUCKET_H_
|