passenger_dudemeister 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/DEVELOPERS.TXT +113 -0
- data/INSTALL +6 -0
- data/LICENSE +19 -0
- data/NEWS +429 -0
- data/PACKAGING.TXT +25 -0
- data/README +45 -0
- data/Rakefile +56 -0
- data/bin/passenger +32 -0
- data/bin/passenger-config +46 -0
- data/bin/passenger-install-apache2-module +237 -0
- data/bin/passenger-install-nginx-module +476 -0
- data/bin/passenger-make-enterprisey +82 -0
- data/bin/passenger-memory-stats +171 -0
- data/bin/passenger-status +211 -0
- data/build/agents.rb +80 -0
- data/build/apache2.rb +168 -0
- data/build/basics.rb +105 -0
- data/build/common_library.rb +268 -0
- data/build/config.rb +42 -0
- data/build/cplusplus_support.rb +61 -0
- data/build/cxx_tests.rb +219 -0
- data/build/documentation.rb +84 -0
- data/build/gempackagetask.rb +99 -0
- data/build/integration_tests.rb +64 -0
- data/build/misc.rb +153 -0
- data/build/nginx.rb +72 -0
- data/build/oxt_tests.rb +59 -0
- data/build/packagetask.rb +186 -0
- data/build/packaging.rb +194 -0
- data/build/rake_extensions.rb +182 -0
- data/build/rdoctask.rb +209 -0
- data/build/rpm.rb +98 -0
- data/build/ruby_extension.rb +52 -0
- data/build/ruby_tests.rb +49 -0
- data/build/test_basics.rb +43 -0
- data/debian/README.Debian +15 -0
- data/debian/changelog +185 -0
- data/debian/compat +1 -0
- data/debian/control +49 -0
- data/debian/copyright +20 -0
- data/debian/libapache2-mod-passenger.install +1 -0
- data/debian/libapache2-mod-passenger.postinst +36 -0
- data/debian/libapache2-mod-passenger.prerm +15 -0
- data/debian/passenger-common.install +4 -0
- data/debian/passenger.conf +4 -0
- data/debian/passenger.load +1 -0
- data/debian/prerm +2 -0
- data/debian/rules +37 -0
- data/debian/watch +3 -0
- data/dev/copy_boost_headers.rb +155 -0
- data/dev/find_owner_pipe_leaks.rb +128 -0
- data/dev/render_error_pages.rb +116 -0
- data/doc/ApplicationPool algorithm.txt +615 -0
- data/doc/Architectural overview.html +1 -0
- data/doc/Architectural overview.txt +334 -0
- data/doc/Doxyfile +241 -0
- data/doc/Security of user switching support.html +1 -0
- data/doc/Security of user switching support.txt +197 -0
- data/doc/Users guide Apache.html +1 -0
- data/doc/Users guide Apache.txt +2208 -0
- data/doc/Users guide Nginx.html +1 -0
- data/doc/Users guide Nginx.txt +1394 -0
- data/doc/Users guide Standalone.html +1 -0
- data/doc/Users guide Standalone.txt +40 -0
- data/doc/definitions.h +5 -0
- data/doc/images/by_sa.png +0 -0
- data/doc/images/conservative_spawning.png +0 -0
- data/doc/images/conservative_spawning.svg +248 -0
- data/doc/images/icons/README +5 -0
- data/doc/images/icons/callouts/1.png +0 -0
- data/doc/images/icons/callouts/10.png +0 -0
- data/doc/images/icons/callouts/11.png +0 -0
- data/doc/images/icons/callouts/12.png +0 -0
- data/doc/images/icons/callouts/13.png +0 -0
- data/doc/images/icons/callouts/14.png +0 -0
- data/doc/images/icons/callouts/15.png +0 -0
- data/doc/images/icons/callouts/2.png +0 -0
- data/doc/images/icons/callouts/3.png +0 -0
- data/doc/images/icons/callouts/4.png +0 -0
- data/doc/images/icons/callouts/5.png +0 -0
- data/doc/images/icons/callouts/6.png +0 -0
- data/doc/images/icons/callouts/7.png +0 -0
- data/doc/images/icons/callouts/8.png +0 -0
- data/doc/images/icons/callouts/9.png +0 -0
- data/doc/images/icons/caution.png +0 -0
- data/doc/images/icons/example.png +0 -0
- data/doc/images/icons/home.png +0 -0
- data/doc/images/icons/important.png +0 -0
- data/doc/images/icons/next.png +0 -0
- data/doc/images/icons/note.png +0 -0
- data/doc/images/icons/prev.png +0 -0
- data/doc/images/icons/tip.png +0 -0
- data/doc/images/icons/up.png +0 -0
- data/doc/images/icons/warning.png +0 -0
- data/doc/images/passenger_architecture.png +0 -0
- data/doc/images/passenger_architecture.svg +401 -0
- data/doc/images/phusion_banner.png +0 -0
- data/doc/images/smart-lv2.png +0 -0
- data/doc/images/smart-lv2.svg +320 -0
- data/doc/images/spawn_server_architecture.png +0 -0
- data/doc/images/spawn_server_architecture.svg +655 -0
- data/doc/images/typical_isolated_web_application.png +0 -0
- data/doc/images/typical_isolated_web_application.svg +213 -0
- data/doc/rdoc/classes/ConditionVariable.html +215 -0
- data/doc/rdoc/classes/Exception.html +120 -0
- data/doc/rdoc/classes/GC.html +113 -0
- data/doc/rdoc/classes/IO.html +221 -0
- data/doc/rdoc/classes/PhusionPassenger.html +397 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +180 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +647 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +654 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +97 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +96 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +97 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +96 -0
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +619 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +142 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +368 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +231 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +588 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +147 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +279 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +123 -0
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +341 -0
- data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +294 -0
- data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +199 -0
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +155 -0
- data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +367 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +95 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +351 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +98 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +200 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +410 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +98 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +156 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +115 -0
- data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +202 -0
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +172 -0
- data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +273 -0
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +145 -0
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +162 -0
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +141 -0
- data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +673 -0
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +92 -0
- data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +415 -0
- data/doc/rdoc/classes/PhusionPassenger/NativeSupportLoader.html +134 -0
- data/doc/rdoc/classes/PhusionPassenger/Packaging.html +129 -0
- data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +1972 -0
- data/doc/rdoc/classes/PhusionPassenger/Plugin.html +237 -0
- data/doc/rdoc/classes/PhusionPassenger/Rack.html +91 -0
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +312 -0
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +98 -0
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +218 -0
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +114 -0
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +259 -0
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +139 -0
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +118 -0
- data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +135 -0
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +378 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone.html +111 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +252 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +161 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +368 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +132 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +151 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +189 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +177 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +341 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +203 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +156 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +168 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +86 -0
- data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +135 -0
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +125 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +1543 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +204 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +171 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +140 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +260 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +169 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +265 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +120 -0
- data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +561 -0
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +140 -0
- data/doc/rdoc/classes/PhusionPassenger/WSGI.html +89 -0
- data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +182 -0
- data/doc/rdoc/classes/Process.html +115 -0
- data/doc/rdoc/classes/Signal.html +139 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/DEVELOPERS_TXT.html +280 -0
- data/doc/rdoc/files/README.html +157 -0
- data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +130 -0
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +135 -0
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +128 -0
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +132 -0
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +129 -0
- data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +141 -0
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +146 -0
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +125 -0
- data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +132 -0
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +147 -0
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +120 -0
- data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +132 -0
- data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +129 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +128 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +137 -0
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +125 -0
- data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +160 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +136 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +133 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +136 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +127 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +120 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +100 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +122 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +126 -0
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +179 -0
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +132 -0
- data/doc/rdoc/fr_class_index.html +138 -0
- data/doc/rdoc/fr_file_index.html +108 -0
- data/doc/rdoc/fr_method_index.html +433 -0
- data/doc/rdoc/index.html +26 -0
- data/doc/rdoc/rdoc-style.css +187 -0
- data/doc/template/horo.rb +613 -0
- data/doc/users_guide_snippets/analysis_and_system_maintenance.txt +201 -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 +303 -0
- data/doc/users_guide_snippets/global_queueing_explained.txt +74 -0
- data/doc/users_guide_snippets/passenger_spawn_method.txt +49 -0
- data/doc/users_guide_snippets/rackup_specifications.txt +71 -0
- data/doc/users_guide_snippets/tips.txt +207 -0
- data/doc/users_guide_snippets/under_the_hood/page_caching_support.txt +22 -0
- data/ext/apache2/Bucket.cpp +190 -0
- data/ext/apache2/Bucket.h +87 -0
- data/ext/apache2/Configuration.cpp +717 -0
- data/ext/apache2/Configuration.h +51 -0
- data/ext/apache2/Configuration.hpp +462 -0
- data/ext/apache2/DirectoryMapper.h +280 -0
- data/ext/apache2/HelperAgent.cpp +365 -0
- data/ext/apache2/Hooks.cpp +1757 -0
- data/ext/apache2/Hooks.h +45 -0
- data/ext/apache2/mod_passenger.c +44 -0
- data/ext/boost/algorithm/string/case_conv.hpp +176 -0
- data/ext/boost/algorithm/string/compare.hpp +199 -0
- data/ext/boost/algorithm/string/concept.hpp +83 -0
- data/ext/boost/algorithm/string/config.hpp +28 -0
- data/ext/boost/algorithm/string/constants.hpp +36 -0
- data/ext/boost/algorithm/string/detail/case_conv.hpp +121 -0
- data/ext/boost/algorithm/string/detail/find_format.hpp +204 -0
- data/ext/boost/algorithm/string/detail/find_format_all.hpp +273 -0
- data/ext/boost/algorithm/string/detail/find_format_store.hpp +89 -0
- data/ext/boost/algorithm/string/detail/finder.hpp +646 -0
- data/ext/boost/algorithm/string/detail/formatter.hpp +94 -0
- data/ext/boost/algorithm/string/detail/replace_storage.hpp +159 -0
- data/ext/boost/algorithm/string/detail/sequence.hpp +200 -0
- data/ext/boost/algorithm/string/detail/util.hpp +106 -0
- data/ext/boost/algorithm/string/erase.hpp +844 -0
- data/ext/boost/algorithm/string/find_format.hpp +287 -0
- data/ext/boost/algorithm/string/finder.hpp +270 -0
- data/ext/boost/algorithm/string/formatter.hpp +103 -0
- data/ext/boost/algorithm/string/replace.hpp +928 -0
- data/ext/boost/algorithm/string/sequence_traits.hpp +193 -0
- data/ext/boost/algorithm/string/yes_no_type.hpp +33 -0
- data/ext/boost/assert.hpp +50 -0
- data/ext/boost/bind.hpp +24 -0
- data/ext/boost/bind/arg.hpp +62 -0
- data/ext/boost/bind/bind.hpp +1751 -0
- data/ext/boost/bind/bind_cc.hpp +117 -0
- data/ext/boost/bind/bind_mf2_cc.hpp +228 -0
- data/ext/boost/bind/bind_mf_cc.hpp +227 -0
- data/ext/boost/bind/bind_template.hpp +345 -0
- data/ext/boost/bind/mem_fn.hpp +389 -0
- data/ext/boost/bind/mem_fn_cc.hpp +103 -0
- data/ext/boost/bind/mem_fn_template.hpp +1047 -0
- data/ext/boost/bind/placeholders.hpp +69 -0
- data/ext/boost/bind/storage.hpp +475 -0
- data/ext/boost/call_traits.hpp +24 -0
- data/ext/boost/checked_delete.hpp +69 -0
- data/ext/boost/concept/assert.hpp +46 -0
- data/ext/boost/concept/detail/backward_compatibility.hpp +16 -0
- data/ext/boost/concept/detail/concept_def.hpp +51 -0
- data/ext/boost/concept/detail/concept_undef.hpp +5 -0
- data/ext/boost/concept/detail/general.hpp +75 -0
- data/ext/boost/concept/detail/has_constraints.hpp +50 -0
- data/ext/boost/concept/usage.hpp +44 -0
- data/ext/boost/concept_check.hpp +1007 -0
- data/ext/boost/config.hpp +70 -0
- data/ext/boost/config/abi/borland_prefix.hpp +27 -0
- data/ext/boost/config/abi/borland_suffix.hpp +12 -0
- data/ext/boost/config/abi/msvc_prefix.hpp +22 -0
- data/ext/boost/config/abi/msvc_suffix.hpp +8 -0
- data/ext/boost/config/abi_prefix.hpp +25 -0
- data/ext/boost/config/abi_suffix.hpp +27 -0
- data/ext/boost/config/auto_link.hpp +420 -0
- data/ext/boost/config/compiler/borland.hpp +275 -0
- data/ext/boost/config/compiler/clang.hpp +62 -0
- data/ext/boost/config/compiler/codegear.hpp +177 -0
- data/ext/boost/config/compiler/comeau.hpp +59 -0
- data/ext/boost/config/compiler/common_edg.hpp +99 -0
- data/ext/boost/config/compiler/compaq_cxx.hpp +19 -0
- data/ext/boost/config/compiler/digitalmars.hpp +93 -0
- data/ext/boost/config/compiler/gcc.hpp +243 -0
- data/ext/boost/config/compiler/gcc_xml.hpp +55 -0
- data/ext/boost/config/compiler/greenhills.hpp +28 -0
- data/ext/boost/config/compiler/hp_acc.hpp +127 -0
- data/ext/boost/config/compiler/intel.hpp +196 -0
- data/ext/boost/config/compiler/kai.hpp +33 -0
- data/ext/boost/config/compiler/metrowerks.hpp +139 -0
- data/ext/boost/config/compiler/mpw.hpp +81 -0
- data/ext/boost/config/compiler/nvcc.hpp +86 -0
- data/ext/boost/config/compiler/pgi.hpp +77 -0
- data/ext/boost/config/compiler/sgi_mipspro.hpp +29 -0
- data/ext/boost/config/compiler/sunpro_cc.hpp +144 -0
- data/ext/boost/config/compiler/vacpp.hpp +96 -0
- data/ext/boost/config/compiler/visualc.hpp +274 -0
- data/ext/boost/config/no_tr1/cmath.hpp +28 -0
- data/ext/boost/config/no_tr1/complex.hpp +28 -0
- data/ext/boost/config/no_tr1/functional.hpp +28 -0
- data/ext/boost/config/no_tr1/memory.hpp +28 -0
- data/ext/boost/config/no_tr1/utility.hpp +28 -0
- data/ext/boost/config/platform/aix.hpp +33 -0
- data/ext/boost/config/platform/amigaos.hpp +15 -0
- data/ext/boost/config/platform/beos.hpp +26 -0
- data/ext/boost/config/platform/bsd.hpp +86 -0
- data/ext/boost/config/platform/cygwin.hpp +48 -0
- data/ext/boost/config/platform/hpux.hpp +87 -0
- data/ext/boost/config/platform/irix.hpp +31 -0
- data/ext/boost/config/platform/linux.hpp +98 -0
- data/ext/boost/config/platform/macos.hpp +86 -0
- data/ext/boost/config/platform/qnxnto.hpp +31 -0
- data/ext/boost/config/platform/solaris.hpp +28 -0
- data/ext/boost/config/platform/symbian.hpp +94 -0
- data/ext/boost/config/platform/vxworks.hpp +31 -0
- data/ext/boost/config/platform/win32.hpp +65 -0
- data/ext/boost/config/posix_features.hpp +95 -0
- data/ext/boost/config/requires_threads.hpp +92 -0
- data/ext/boost/config/select_compiler_config.hpp +129 -0
- data/ext/boost/config/select_platform_config.hpp +98 -0
- data/ext/boost/config/select_stdlib_config.hpp +77 -0
- data/ext/boost/config/stdlib/dinkumware.hpp +148 -0
- data/ext/boost/config/stdlib/libcomo.hpp +72 -0
- data/ext/boost/config/stdlib/libstdcpp3.hpp +128 -0
- data/ext/boost/config/stdlib/modena.hpp +56 -0
- data/ext/boost/config/stdlib/msl.hpp +84 -0
- data/ext/boost/config/stdlib/roguewave.hpp +180 -0
- data/ext/boost/config/stdlib/sgi.hpp +137 -0
- data/ext/boost/config/stdlib/stlport.hpp +237 -0
- data/ext/boost/config/stdlib/vacpp.hpp +44 -0
- data/ext/boost/config/suffix.hpp +639 -0
- data/ext/boost/config/user.hpp +124 -0
- data/ext/boost/config/warning_disable.hpp +47 -0
- data/ext/boost/cstdint.hpp +504 -0
- data/ext/boost/current_function.hpp +67 -0
- data/ext/boost/date_time/adjust_functors.hpp +178 -0
- data/ext/boost/date_time/c_time.hpp +107 -0
- data/ext/boost/date_time/compiler_config.hpp +171 -0
- data/ext/boost/date_time/constrained_value.hpp +121 -0
- data/ext/boost/date_time/date.hpp +208 -0
- data/ext/boost/date_time/date_clock_device.hpp +77 -0
- data/ext/boost/date_time/date_defs.hpp +26 -0
- data/ext/boost/date_time/date_duration.hpp +146 -0
- data/ext/boost/date_time/date_duration_types.hpp +269 -0
- data/ext/boost/date_time/date_facet.hpp +764 -0
- data/ext/boost/date_time/date_format_simple.hpp +159 -0
- data/ext/boost/date_time/date_formatting.hpp +127 -0
- data/ext/boost/date_time/date_formatting_limited.hpp +121 -0
- data/ext/boost/date_time/date_formatting_locales.hpp +233 -0
- data/ext/boost/date_time/date_generator_formatter.hpp +265 -0
- data/ext/boost/date_time/date_generator_parser.hpp +330 -0
- data/ext/boost/date_time/date_generators.hpp +509 -0
- data/ext/boost/date_time/date_iterator.hpp +101 -0
- data/ext/boost/date_time/date_names_put.hpp +320 -0
- data/ext/boost/date_time/date_parsing.hpp +316 -0
- data/ext/boost/date_time/dst_rules.hpp +391 -0
- data/ext/boost/date_time/filetime_functions.hpp +170 -0
- data/ext/boost/date_time/format_date_parser.hpp +743 -0
- data/ext/boost/date_time/gregorian/conversion.hpp +68 -0
- data/ext/boost/date_time/gregorian/formatters.hpp +162 -0
- data/ext/boost/date_time/gregorian/formatters_limited.hpp +81 -0
- data/ext/boost/date_time/gregorian/greg_calendar.hpp +48 -0
- data/ext/boost/date_time/gregorian/greg_date.hpp +136 -0
- data/ext/boost/date_time/gregorian/greg_day.hpp +57 -0
- data/ext/boost/date_time/gregorian/greg_day_of_year.hpp +38 -0
- data/ext/boost/date_time/gregorian/greg_duration.hpp +134 -0
- data/ext/boost/date_time/gregorian/greg_duration_types.hpp +43 -0
- data/ext/boost/date_time/gregorian/greg_month.hpp +105 -0
- data/ext/boost/date_time/gregorian/greg_weekday.hpp +66 -0
- data/ext/boost/date_time/gregorian/greg_year.hpp +53 -0
- data/ext/boost/date_time/gregorian/greg_ymd.hpp +33 -0
- data/ext/boost/date_time/gregorian/gregorian.hpp +38 -0
- data/ext/boost/date_time/gregorian/gregorian_io.hpp +784 -0
- data/ext/boost/date_time/gregorian/gregorian_types.hpp +109 -0
- data/ext/boost/date_time/gregorian/parsers.hpp +91 -0
- data/ext/boost/date_time/gregorian_calendar.hpp +70 -0
- data/ext/boost/date_time/gregorian_calendar.ipp +219 -0
- data/ext/boost/date_time/int_adapter.hpp +509 -0
- data/ext/boost/date_time/iso_format.hpp +303 -0
- data/ext/boost/date_time/locale_config.hpp +31 -0
- data/ext/boost/date_time/microsec_time_clock.hpp +127 -0
- data/ext/boost/date_time/parse_format_base.hpp +29 -0
- data/ext/boost/date_time/period.hpp +377 -0
- data/ext/boost/date_time/period_formatter.hpp +196 -0
- data/ext/boost/date_time/period_parser.hpp +198 -0
- data/ext/boost/date_time/posix_time/conversion.hpp +94 -0
- data/ext/boost/date_time/posix_time/date_duration_operators.hpp +114 -0
- data/ext/boost/date_time/posix_time/posix_time.hpp +39 -0
- data/ext/boost/date_time/posix_time/posix_time_config.hpp +178 -0
- data/ext/boost/date_time/posix_time/posix_time_duration.hpp +82 -0
- data/ext/boost/date_time/posix_time/posix_time_io.hpp +239 -0
- data/ext/boost/date_time/posix_time/posix_time_system.hpp +68 -0
- data/ext/boost/date_time/posix_time/posix_time_types.hpp +55 -0
- data/ext/boost/date_time/posix_time/ptime.hpp +65 -0
- data/ext/boost/date_time/posix_time/time_formatters.hpp +289 -0
- data/ext/boost/date_time/posix_time/time_parsers.hpp +44 -0
- data/ext/boost/date_time/posix_time/time_period.hpp +29 -0
- data/ext/boost/date_time/special_defs.hpp +25 -0
- data/ext/boost/date_time/special_values_formatter.hpp +96 -0
- data/ext/boost/date_time/special_values_parser.hpp +159 -0
- data/ext/boost/date_time/string_convert.hpp +33 -0
- data/ext/boost/date_time/string_parse_tree.hpp +278 -0
- data/ext/boost/date_time/strings_from_facet.hpp +125 -0
- data/ext/boost/date_time/time.hpp +191 -0
- data/ext/boost/date_time/time_clock.hpp +83 -0
- data/ext/boost/date_time/time_defs.hpp +43 -0
- data/ext/boost/date_time/time_duration.hpp +282 -0
- data/ext/boost/date_time/time_facet.hpp +1367 -0
- data/ext/boost/date_time/time_formatting_streams.hpp +122 -0
- data/ext/boost/date_time/time_iterator.hpp +52 -0
- data/ext/boost/date_time/time_parsing.hpp +321 -0
- data/ext/boost/date_time/time_resolution_traits.hpp +144 -0
- data/ext/boost/date_time/time_system_counted.hpp +254 -0
- data/ext/boost/date_time/time_system_split.hpp +207 -0
- data/ext/boost/date_time/wrapping_int.hpp +169 -0
- data/ext/boost/date_time/year_month_day.hpp +45 -0
- data/ext/boost/detail/call_traits.hpp +164 -0
- data/ext/boost/detail/endian.hpp +76 -0
- data/ext/boost/detail/indirect_traits.hpp +487 -0
- data/ext/boost/detail/iterator.hpp +494 -0
- data/ext/boost/detail/lcast_precision.hpp +184 -0
- data/ext/boost/detail/limits.hpp +449 -0
- data/ext/boost/detail/no_exceptions_support.hpp +87 -0
- data/ext/boost/detail/reference_content.hpp +141 -0
- data/ext/boost/detail/sp_typeinfo.hpp +129 -0
- data/ext/boost/detail/workaround.hpp +267 -0
- data/ext/boost/enable_shared_from_this.hpp +18 -0
- data/ext/boost/exception/current_exception_cast.hpp +43 -0
- data/ext/boost/exception/detail/attribute_noreturn.hpp +17 -0
- data/ext/boost/exception/detail/error_info_impl.hpp +75 -0
- data/ext/boost/exception/detail/exception_ptr.hpp +431 -0
- data/ext/boost/exception/detail/is_output_streamable.hpp +60 -0
- data/ext/boost/exception/detail/object_hex_dump.hpp +50 -0
- data/ext/boost/exception/detail/type_info.hpp +83 -0
- data/ext/boost/exception/diagnostic_information.hpp +184 -0
- data/ext/boost/exception/exception.hpp +436 -0
- data/ext/boost/exception/get_error_info.hpp +130 -0
- data/ext/boost/exception/info.hpp +200 -0
- data/ext/boost/exception/to_string.hpp +83 -0
- data/ext/boost/exception/to_string_stub.hpp +109 -0
- data/ext/boost/exception_ptr.hpp +11 -0
- data/ext/boost/function.hpp +66 -0
- data/ext/boost/function/detail/function_iterate.hpp +16 -0
- data/ext/boost/function/detail/maybe_include.hpp +267 -0
- data/ext/boost/function/detail/prologue.hpp +26 -0
- data/ext/boost/function/function_base.hpp +904 -0
- data/ext/boost/function/function_fwd.hpp +70 -0
- data/ext/boost/function/function_template.hpp +1158 -0
- data/ext/boost/function_equal.hpp +28 -0
- data/ext/boost/get_pointer.hpp +33 -0
- data/ext/boost/implicit_cast.hpp +29 -0
- data/ext/boost/integer.hpp +257 -0
- data/ext/boost/integer_fwd.hpp +180 -0
- data/ext/boost/integer_traits.hpp +261 -0
- data/ext/boost/io/ios_state.hpp +439 -0
- data/ext/boost/io_fwd.hpp +67 -0
- data/ext/boost/is_placeholder.hpp +31 -0
- data/ext/boost/iterator.hpp +59 -0
- data/ext/boost/iterator/detail/config_def.hpp +137 -0
- data/ext/boost/iterator/detail/config_undef.hpp +25 -0
- data/ext/boost/iterator/detail/enable_if.hpp +86 -0
- data/ext/boost/iterator/detail/facade_iterator_category.hpp +200 -0
- data/ext/boost/iterator/detail/minimum_category.hpp +116 -0
- data/ext/boost/iterator/interoperable.hpp +50 -0
- data/ext/boost/iterator/iterator_adaptor.hpp +371 -0
- data/ext/boost/iterator/iterator_categories.hpp +188 -0
- data/ext/boost/iterator/iterator_concepts.hpp +284 -0
- data/ext/boost/iterator/iterator_facade.hpp +878 -0
- data/ext/boost/iterator/iterator_traits.hpp +92 -0
- data/ext/boost/iterator/reverse_iterator.hpp +69 -0
- data/ext/boost/iterator/transform_iterator.hpp +187 -0
- data/ext/boost/lexical_cast.hpp +1213 -0
- data/ext/boost/limits.hpp +146 -0
- data/ext/boost/make_shared.hpp +17 -0
- data/ext/boost/mem_fn.hpp +24 -0
- data/ext/boost/memory_order.hpp +53 -0
- data/ext/boost/mpl/always.hpp +39 -0
- data/ext/boost/mpl/and.hpp +60 -0
- data/ext/boost/mpl/apply.hpp +229 -0
- data/ext/boost/mpl/apply_fwd.hpp +107 -0
- data/ext/boost/mpl/apply_wrap.hpp +234 -0
- data/ext/boost/mpl/arg.hpp +131 -0
- data/ext/boost/mpl/arg_fwd.hpp +28 -0
- data/ext/boost/mpl/assert.hpp +370 -0
- data/ext/boost/mpl/aux_/adl_barrier.hpp +48 -0
- data/ext/boost/mpl/aux_/arg_typedef.hpp +31 -0
- data/ext/boost/mpl/aux_/arity.hpp +39 -0
- data/ext/boost/mpl/aux_/arity_spec.hpp +67 -0
- data/ext/boost/mpl/aux_/common_name_wknd.hpp +34 -0
- data/ext/boost/mpl/aux_/config/adl.hpp +40 -0
- data/ext/boost/mpl/aux_/config/arrays.hpp +30 -0
- data/ext/boost/mpl/aux_/config/bcc.hpp +28 -0
- data/ext/boost/mpl/aux_/config/bind.hpp +33 -0
- data/ext/boost/mpl/aux_/config/compiler.hpp +66 -0
- data/ext/boost/mpl/aux_/config/ctps.hpp +30 -0
- data/ext/boost/mpl/aux_/config/dtp.hpp +46 -0
- data/ext/boost/mpl/aux_/config/eti.hpp +47 -0
- data/ext/boost/mpl/aux_/config/gcc.hpp +23 -0
- data/ext/boost/mpl/aux_/config/has_apply.hpp +32 -0
- data/ext/boost/mpl/aux_/config/has_xxx.hpp +34 -0
- data/ext/boost/mpl/aux_/config/integral.hpp +38 -0
- data/ext/boost/mpl/aux_/config/intel.hpp +21 -0
- data/ext/boost/mpl/aux_/config/lambda.hpp +32 -0
- data/ext/boost/mpl/aux_/config/msvc.hpp +21 -0
- data/ext/boost/mpl/aux_/config/msvc_typename.hpp +26 -0
- data/ext/boost/mpl/aux_/config/nttp.hpp +41 -0
- data/ext/boost/mpl/aux_/config/overload_resolution.hpp +29 -0
- data/ext/boost/mpl/aux_/config/pp_counter.hpp +26 -0
- data/ext/boost/mpl/aux_/config/preprocessor.hpp +39 -0
- data/ext/boost/mpl/aux_/config/static_constant.hpp +25 -0
- data/ext/boost/mpl/aux_/config/ttp.hpp +41 -0
- data/ext/boost/mpl/aux_/config/use_preprocessed.hpp +19 -0
- data/ext/boost/mpl/aux_/config/workaround.hpp +19 -0
- data/ext/boost/mpl/aux_/full_lambda.hpp +354 -0
- data/ext/boost/mpl/aux_/has_apply.hpp +32 -0
- data/ext/boost/mpl/aux_/has_type.hpp +23 -0
- data/ext/boost/mpl/aux_/include_preprocessed.hpp +42 -0
- data/ext/boost/mpl/aux_/integral_wrapper.hpp +93 -0
- data/ext/boost/mpl/aux_/lambda_arity_param.hpp +25 -0
- data/ext/boost/mpl/aux_/lambda_support.hpp +169 -0
- data/ext/boost/mpl/aux_/msvc_never_true.hpp +34 -0
- data/ext/boost/mpl/aux_/na.hpp +95 -0
- data/ext/boost/mpl/aux_/na_assert.hpp +34 -0
- data/ext/boost/mpl/aux_/na_fwd.hpp +31 -0
- data/ext/boost/mpl/aux_/na_spec.hpp +175 -0
- data/ext/boost/mpl/aux_/nested_type_wknd.hpp +48 -0
- data/ext/boost/mpl/aux_/nttp_decl.hpp +35 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/and.hpp +69 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/apply.hpp +169 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/apply_fwd.hpp +52 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/apply_wrap.hpp +84 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/arg.hpp +123 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/bind.hpp +561 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/bind_fwd.hpp +52 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp +558 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/or.hpp +69 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp +105 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/quote.hpp +123 -0
- data/ext/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp +97 -0
- data/ext/boost/mpl/aux_/preprocessor/def_params_tail.hpp +105 -0
- data/ext/boost/mpl/aux_/preprocessor/enum.hpp +62 -0
- data/ext/boost/mpl/aux_/preprocessor/filter_params.hpp +28 -0
- data/ext/boost/mpl/aux_/preprocessor/params.hpp +65 -0
- data/ext/boost/mpl/aux_/preprocessor/sub.hpp +65 -0
- data/ext/boost/mpl/aux_/static_cast.hpp +27 -0
- data/ext/boost/mpl/aux_/template_arity.hpp +189 -0
- data/ext/boost/mpl/aux_/template_arity_fwd.hpp +23 -0
- data/ext/boost/mpl/aux_/type_wrapper.hpp +47 -0
- data/ext/boost/mpl/aux_/value_wknd.hpp +89 -0
- data/ext/boost/mpl/aux_/yes_no.hpp +58 -0
- data/ext/boost/mpl/bind.hpp +551 -0
- data/ext/boost/mpl/bind_fwd.hpp +99 -0
- data/ext/boost/mpl/bool.hpp +39 -0
- data/ext/boost/mpl/bool_fwd.hpp +33 -0
- data/ext/boost/mpl/eval_if.hpp +71 -0
- data/ext/boost/mpl/has_xxx.hpp +640 -0
- data/ext/boost/mpl/identity.hpp +45 -0
- data/ext/boost/mpl/if.hpp +135 -0
- data/ext/boost/mpl/int.hpp +22 -0
- data/ext/boost/mpl/int_fwd.hpp +27 -0
- data/ext/boost/mpl/integral_c.hpp +51 -0
- data/ext/boost/mpl/integral_c_fwd.hpp +32 -0
- data/ext/boost/mpl/integral_c_tag.hpp +26 -0
- data/ext/boost/mpl/lambda.hpp +29 -0
- data/ext/boost/mpl/lambda_fwd.hpp +57 -0
- data/ext/boost/mpl/limits/arity.hpp +21 -0
- data/ext/boost/mpl/logical.hpp +21 -0
- data/ext/boost/mpl/next.hpp +19 -0
- data/ext/boost/mpl/next_prior.hpp +49 -0
- data/ext/boost/mpl/not.hpp +51 -0
- data/ext/boost/mpl/or.hpp +61 -0
- data/ext/boost/mpl/placeholders.hpp +100 -0
- data/ext/boost/mpl/protect.hpp +55 -0
- data/ext/boost/mpl/quote.hpp +151 -0
- data/ext/boost/mpl/size_t.hpp +25 -0
- data/ext/boost/mpl/size_t_fwd.hpp +28 -0
- data/ext/boost/mpl/void.hpp +76 -0
- data/ext/boost/mpl/void_fwd.hpp +26 -0
- data/ext/boost/next_prior.hpp +51 -0
- data/ext/boost/non_type.hpp +27 -0
- data/ext/boost/noncopyable.hpp +36 -0
- data/ext/boost/none.hpp +28 -0
- data/ext/boost/none_t.hpp +24 -0
- data/ext/boost/operators.hpp +976 -0
- data/ext/boost/optional.hpp +18 -0
- data/ext/boost/optional/optional.hpp +924 -0
- data/ext/boost/optional/optional_fwd.hpp +22 -0
- data/ext/boost/preprocessor/arithmetic/add.hpp +51 -0
- data/ext/boost/preprocessor/arithmetic/dec.hpp +288 -0
- data/ext/boost/preprocessor/arithmetic/detail/div_base.hpp +61 -0
- data/ext/boost/preprocessor/arithmetic/inc.hpp +288 -0
- data/ext/boost/preprocessor/arithmetic/mod.hpp +39 -0
- data/ext/boost/preprocessor/arithmetic/sub.hpp +50 -0
- data/ext/boost/preprocessor/array/data.hpp +28 -0
- data/ext/boost/preprocessor/array/elem.hpp +29 -0
- data/ext/boost/preprocessor/array/size.hpp +28 -0
- data/ext/boost/preprocessor/cat.hpp +35 -0
- data/ext/boost/preprocessor/comma_if.hpp +17 -0
- data/ext/boost/preprocessor/comparison/less_equal.hpp +39 -0
- data/ext/boost/preprocessor/config/config.hpp +70 -0
- data/ext/boost/preprocessor/control/deduce_d.hpp +22 -0
- data/ext/boost/preprocessor/control/detail/while.hpp +536 -0
- data/ext/boost/preprocessor/control/expr_iif.hpp +31 -0
- data/ext/boost/preprocessor/control/if.hpp +30 -0
- data/ext/boost/preprocessor/control/iif.hpp +34 -0
- data/ext/boost/preprocessor/control/while.hpp +312 -0
- data/ext/boost/preprocessor/debug/error.hpp +33 -0
- data/ext/boost/preprocessor/detail/auto_rec.hpp +293 -0
- data/ext/boost/preprocessor/detail/check.hpp +48 -0
- data/ext/boost/preprocessor/detail/is_binary.hpp +30 -0
- data/ext/boost/preprocessor/empty.hpp +17 -0
- data/ext/boost/preprocessor/enum.hpp +17 -0
- data/ext/boost/preprocessor/enum_params.hpp +17 -0
- data/ext/boost/preprocessor/facilities/empty.hpp +21 -0
- data/ext/boost/preprocessor/facilities/identity.hpp +23 -0
- data/ext/boost/preprocessor/identity.hpp +17 -0
- data/ext/boost/preprocessor/inc.hpp +17 -0
- data/ext/boost/preprocessor/iterate.hpp +17 -0
- data/ext/boost/preprocessor/iteration/detail/bounds/lower1.hpp +99 -0
- data/ext/boost/preprocessor/iteration/detail/bounds/upper1.hpp +99 -0
- data/ext/boost/preprocessor/iteration/detail/iter/forward1.hpp +1342 -0
- data/ext/boost/preprocessor/iteration/iterate.hpp +82 -0
- data/ext/boost/preprocessor/list/adt.hpp +73 -0
- data/ext/boost/preprocessor/list/append.hpp +40 -0
- data/ext/boost/preprocessor/list/detail/fold_left.hpp +279 -0
- data/ext/boost/preprocessor/list/detail/fold_right.hpp +277 -0
- data/ext/boost/preprocessor/list/fold_left.hpp +303 -0
- data/ext/boost/preprocessor/list/fold_right.hpp +40 -0
- data/ext/boost/preprocessor/list/for_each_i.hpp +65 -0
- data/ext/boost/preprocessor/list/reverse.hpp +40 -0
- data/ext/boost/preprocessor/list/transform.hpp +49 -0
- data/ext/boost/preprocessor/logical/and.hpp +30 -0
- data/ext/boost/preprocessor/logical/bitand.hpp +38 -0
- data/ext/boost/preprocessor/logical/bool.hpp +288 -0
- data/ext/boost/preprocessor/logical/compl.hpp +36 -0
- data/ext/boost/preprocessor/logical/not.hpp +30 -0
- data/ext/boost/preprocessor/punctuation/comma.hpp +21 -0
- data/ext/boost/preprocessor/punctuation/comma_if.hpp +31 -0
- data/ext/boost/preprocessor/repeat.hpp +17 -0
- data/ext/boost/preprocessor/repetition/detail/for.hpp +536 -0
- data/ext/boost/preprocessor/repetition/enum.hpp +66 -0
- data/ext/boost/preprocessor/repetition/enum_binary_params.hpp +54 -0
- data/ext/boost/preprocessor/repetition/enum_params.hpp +41 -0
- data/ext/boost/preprocessor/repetition/enum_trailing_params.hpp +38 -0
- data/ext/boost/preprocessor/repetition/for.hpp +306 -0
- data/ext/boost/preprocessor/repetition/repeat.hpp +825 -0
- data/ext/boost/preprocessor/repetition/repeat_from_to.hpp +87 -0
- data/ext/boost/preprocessor/seq/cat.hpp +48 -0
- data/ext/boost/preprocessor/seq/elem.hpp +304 -0
- data/ext/boost/preprocessor/seq/enum.hpp +288 -0
- data/ext/boost/preprocessor/seq/fold_left.hpp +1070 -0
- data/ext/boost/preprocessor/seq/for_each_i.hpp +61 -0
- data/ext/boost/preprocessor/seq/seq.hpp +44 -0
- data/ext/boost/preprocessor/seq/size.hpp +548 -0
- data/ext/boost/preprocessor/seq/transform.hpp +48 -0
- data/ext/boost/preprocessor/slot/detail/def.hpp +49 -0
- data/ext/boost/preprocessor/slot/detail/shared.hpp +247 -0
- data/ext/boost/preprocessor/slot/slot.hpp +32 -0
- data/ext/boost/preprocessor/stringize.hpp +33 -0
- data/ext/boost/preprocessor/tuple/eat.hpp +57 -0
- data/ext/boost/preprocessor/tuple/elem.hpp +385 -0
- data/ext/boost/preprocessor/tuple/rem.hpp +72 -0
- data/ext/boost/preprocessor/tuple/to_list.hpp +62 -0
- data/ext/boost/range/algorithm/equal.hpp +188 -0
- data/ext/boost/range/as_literal.hpp +127 -0
- data/ext/boost/range/begin.hpp +132 -0
- data/ext/boost/range/concepts.hpp +331 -0
- data/ext/boost/range/config.hpp +54 -0
- data/ext/boost/range/const_iterator.hpp +67 -0
- data/ext/boost/range/detail/common.hpp +117 -0
- data/ext/boost/range/detail/extract_optional_type.hpp +52 -0
- data/ext/boost/range/detail/implementation_help.hpp +103 -0
- data/ext/boost/range/detail/misc_concept.hpp +33 -0
- data/ext/boost/range/detail/sfinae.hpp +77 -0
- data/ext/boost/range/detail/str_types.hpp +38 -0
- data/ext/boost/range/difference_type.hpp +29 -0
- data/ext/boost/range/distance.hpp +34 -0
- data/ext/boost/range/empty.hpp +34 -0
- data/ext/boost/range/end.hpp +131 -0
- data/ext/boost/range/functions.hpp +27 -0
- data/ext/boost/range/iterator.hpp +72 -0
- data/ext/boost/range/iterator_range.hpp +16 -0
- data/ext/boost/range/iterator_range_core.hpp +542 -0
- data/ext/boost/range/iterator_range_io.hpp +93 -0
- data/ext/boost/range/mutable_iterator.hpp +67 -0
- data/ext/boost/range/rbegin.hpp +65 -0
- data/ext/boost/range/rend.hpp +65 -0
- data/ext/boost/range/reverse_iterator.hpp +40 -0
- data/ext/boost/range/size.hpp +36 -0
- data/ext/boost/range/size_type.hpp +79 -0
- data/ext/boost/range/value_type.hpp +34 -0
- data/ext/boost/ref.hpp +189 -0
- data/ext/boost/scoped_array.hpp +16 -0
- data/ext/boost/scoped_ptr.hpp +16 -0
- data/ext/boost/shared_array.hpp +19 -0
- data/ext/boost/shared_ptr.hpp +19 -0
- data/ext/boost/smart_ptr/bad_weak_ptr.hpp +59 -0
- data/ext/boost/smart_ptr/detail/atomic_count.hpp +119 -0
- data/ext/boost/smart_ptr/detail/atomic_count_gcc.hpp +72 -0
- data/ext/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +77 -0
- data/ext/boost/smart_ptr/detail/atomic_count_pthreads.hpp +96 -0
- data/ext/boost/smart_ptr/detail/atomic_count_solaris.hpp +59 -0
- data/ext/boost/smart_ptr/detail/atomic_count_sync.hpp +61 -0
- data/ext/boost/smart_ptr/detail/atomic_count_win32.hpp +63 -0
- data/ext/boost/smart_ptr/detail/operator_bool.hpp +56 -0
- data/ext/boost/smart_ptr/detail/shared_count.hpp +444 -0
- data/ext/boost/smart_ptr/detail/sp_convertible.hpp +76 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base.hpp +70 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +150 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +170 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp +158 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +157 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +172 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +181 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +166 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +173 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_nt.hpp +107 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_pt.hpp +135 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_solaris.hpp +113 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_spin.hpp +131 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_sync.hpp +155 -0
- data/ext/boost/smart_ptr/detail/sp_counted_base_w32.hpp +130 -0
- data/ext/boost/smart_ptr/detail/sp_counted_impl.hpp +231 -0
- data/ext/boost/smart_ptr/detail/sp_has_sync.hpp +49 -0
- data/ext/boost/smart_ptr/detail/spinlock.hpp +53 -0
- data/ext/boost/smart_ptr/detail/spinlock_gcc_arm.hpp +85 -0
- data/ext/boost/smart_ptr/detail/spinlock_nt.hpp +89 -0
- data/ext/boost/smart_ptr/detail/spinlock_pool.hpp +87 -0
- data/ext/boost/smart_ptr/detail/spinlock_pt.hpp +79 -0
- data/ext/boost/smart_ptr/detail/spinlock_sync.hpp +87 -0
- data/ext/boost/smart_ptr/detail/yield_k.hpp +149 -0
- data/ext/boost/smart_ptr/enable_shared_from_this.hpp +79 -0
- data/ext/boost/smart_ptr/make_shared.hpp +508 -0
- data/ext/boost/smart_ptr/scoped_array.hpp +107 -0
- data/ext/boost/smart_ptr/scoped_ptr.hpp +131 -0
- data/ext/boost/smart_ptr/shared_array.hpp +147 -0
- data/ext/boost/smart_ptr/shared_ptr.hpp +701 -0
- data/ext/boost/smart_ptr/weak_ptr.hpp +230 -0
- data/ext/boost/src/pthread/once.cpp +51 -0
- data/ext/boost/src/pthread/thread.cpp +616 -0
- data/ext/boost/src/pthread/timeconv.inl +133 -0
- data/ext/boost/src/tss_null.cpp +34 -0
- data/ext/boost/static_assert.hpp +132 -0
- data/ext/boost/thread.hpp +26 -0
- data/ext/boost/thread/barrier.hpp +64 -0
- data/ext/boost/thread/condition.hpp +16 -0
- data/ext/boost/thread/condition_variable.hpp +21 -0
- data/ext/boost/thread/detail/config.hpp +100 -0
- data/ext/boost/thread/detail/force_cast.hpp +39 -0
- data/ext/boost/thread/detail/move.hpp +60 -0
- data/ext/boost/thread/detail/platform.hpp +71 -0
- data/ext/boost/thread/detail/singleton.hpp +59 -0
- data/ext/boost/thread/detail/thread.hpp +540 -0
- data/ext/boost/thread/detail/thread_group.hpp +108 -0
- data/ext/boost/thread/detail/thread_heap_alloc.hpp +23 -0
- data/ext/boost/thread/detail/thread_interruption.hpp +35 -0
- data/ext/boost/thread/detail/tss_hooks.hpp +65 -0
- data/ext/boost/thread/exceptions.hpp +223 -0
- data/ext/boost/thread/future.hpp +1375 -0
- data/ext/boost/thread/locks.hpp +1585 -0
- data/ext/boost/thread/mutex.hpp +21 -0
- data/ext/boost/thread/once.hpp +33 -0
- data/ext/boost/thread/pthread/condition_variable.hpp +179 -0
- data/ext/boost/thread/pthread/condition_variable_fwd.hpp +102 -0
- data/ext/boost/thread/pthread/mutex.hpp +236 -0
- data/ext/boost/thread/pthread/once.hpp +95 -0
- data/ext/boost/thread/pthread/pthread_mutex_scoped_lock.hpp +54 -0
- data/ext/boost/thread/pthread/recursive_mutex.hpp +345 -0
- data/ext/boost/thread/pthread/shared_mutex.hpp +303 -0
- data/ext/boost/thread/pthread/thread_data.hpp +129 -0
- data/ext/boost/thread/pthread/thread_heap_alloc.hpp +242 -0
- data/ext/boost/thread/pthread/timespec.hpp +36 -0
- data/ext/boost/thread/recursive_mutex.hpp +21 -0
- data/ext/boost/thread/shared_mutex.hpp +21 -0
- data/ext/boost/thread/thread.hpp +27 -0
- data/ext/boost/thread/thread_time.hpp +50 -0
- data/ext/boost/thread/tss.hpp +113 -0
- data/ext/boost/thread/xtime.hpp +92 -0
- data/ext/boost/throw_exception.hpp +91 -0
- data/ext/boost/token_functions.hpp +641 -0
- data/ext/boost/token_iterator.hpp +128 -0
- data/ext/boost/tokenizer.hpp +98 -0
- data/ext/boost/type.hpp +18 -0
- data/ext/boost/type_traits/add_const.hpp +47 -0
- data/ext/boost/type_traits/add_pointer.hpp +72 -0
- data/ext/boost/type_traits/add_reference.hpp +107 -0
- data/ext/boost/type_traits/add_volatile.hpp +47 -0
- data/ext/boost/type_traits/alignment_of.hpp +128 -0
- data/ext/boost/type_traits/broken_compiler_spec.hpp +117 -0
- data/ext/boost/type_traits/composite_traits.hpp +29 -0
- data/ext/boost/type_traits/config.hpp +76 -0
- data/ext/boost/type_traits/conversion_traits.hpp +17 -0
- data/ext/boost/type_traits/detail/bool_trait_def.hpp +173 -0
- data/ext/boost/type_traits/detail/bool_trait_undef.hpp +27 -0
- data/ext/boost/type_traits/detail/cv_traits_impl.hpp +97 -0
- data/ext/boost/type_traits/detail/false_result.hpp +28 -0
- data/ext/boost/type_traits/detail/ice_and.hpp +35 -0
- data/ext/boost/type_traits/detail/ice_eq.hpp +36 -0
- data/ext/boost/type_traits/detail/ice_not.hpp +31 -0
- data/ext/boost/type_traits/detail/ice_or.hpp +34 -0
- data/ext/boost/type_traits/detail/is_function_ptr_helper.hpp +220 -0
- data/ext/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +817 -0
- data/ext/boost/type_traits/detail/size_t_trait_def.hpp +58 -0
- data/ext/boost/type_traits/detail/size_t_trait_undef.hpp +16 -0
- data/ext/boost/type_traits/detail/template_arity_spec.hpp +31 -0
- data/ext/boost/type_traits/detail/type_trait_def.hpp +61 -0
- data/ext/boost/type_traits/detail/type_trait_undef.hpp +19 -0
- data/ext/boost/type_traits/detail/yes_no_type.hpp +26 -0
- data/ext/boost/type_traits/function_traits.hpp +236 -0
- data/ext/boost/type_traits/has_nothrow_copy.hpp +39 -0
- data/ext/boost/type_traits/has_trivial_copy.hpp +49 -0
- data/ext/boost/type_traits/has_trivial_destructor.hpp +42 -0
- data/ext/boost/type_traits/ice.hpp +20 -0
- data/ext/boost/type_traits/integral_constant.hpp +53 -0
- data/ext/boost/type_traits/intrinsics.hpp +240 -0
- data/ext/boost/type_traits/is_abstract.hpp +153 -0
- data/ext/boost/type_traits/is_arithmetic.hpp +51 -0
- data/ext/boost/type_traits/is_array.hpp +91 -0
- data/ext/boost/type_traits/is_base_and_derived.hpp +254 -0
- data/ext/boost/type_traits/is_base_of.hpp +51 -0
- data/ext/boost/type_traits/is_class.hpp +140 -0
- data/ext/boost/type_traits/is_const.hpp +165 -0
- data/ext/boost/type_traits/is_convertible.hpp +430 -0
- data/ext/boost/type_traits/is_enum.hpp +189 -0
- data/ext/boost/type_traits/is_float.hpp +27 -0
- data/ext/boost/type_traits/is_function.hpp +106 -0
- data/ext/boost/type_traits/is_fundamental.hpp +45 -0
- data/ext/boost/type_traits/is_integral.hpp +78 -0
- data/ext/boost/type_traits/is_lvalue_reference.hpp +118 -0
- data/ext/boost/type_traits/is_member_function_pointer.hpp +136 -0
- data/ext/boost/type_traits/is_member_pointer.hpp +116 -0
- data/ext/boost/type_traits/is_pod.hpp +135 -0
- data/ext/boost/type_traits/is_pointer.hpp +162 -0
- data/ext/boost/type_traits/is_reference.hpp +45 -0
- data/ext/boost/type_traits/is_rvalue_reference.hpp +29 -0
- data/ext/boost/type_traits/is_same.hpp +103 -0
- data/ext/boost/type_traits/is_scalar.hpp +55 -0
- data/ext/boost/type_traits/is_signed.hpp +135 -0
- data/ext/boost/type_traits/is_union.hpp +49 -0
- data/ext/boost/type_traits/is_unsigned.hpp +130 -0
- data/ext/boost/type_traits/is_void.hpp +38 -0
- data/ext/boost/type_traits/is_volatile.hpp +152 -0
- data/ext/boost/type_traits/make_unsigned.hpp +137 -0
- data/ext/boost/type_traits/remove_const.hpp +90 -0
- data/ext/boost/type_traits/remove_cv.hpp +83 -0
- data/ext/boost/type_traits/remove_pointer.hpp +43 -0
- data/ext/boost/type_traits/remove_reference.hpp +70 -0
- data/ext/boost/type_traits/type_with_alignment.hpp +393 -0
- data/ext/boost/units/detail/utility.hpp +104 -0
- data/ext/boost/utility.hpp +20 -0
- data/ext/boost/utility/addressof.hpp +102 -0
- data/ext/boost/utility/base_from_member.hpp +87 -0
- data/ext/boost/utility/binary.hpp +708 -0
- data/ext/boost/utility/compare_pointees.hpp +68 -0
- data/ext/boost/utility/enable_if.hpp +119 -0
- data/ext/boost/visit_each.hpp +29 -0
- data/ext/boost/weak_ptr.hpp +18 -0
- data/ext/common/AbstractSpawnManager.h +110 -0
- data/ext/common/Account.h +175 -0
- data/ext/common/AccountsDatabase.cpp +81 -0
- data/ext/common/AccountsDatabase.h +130 -0
- data/ext/common/AgentBase.cpp +323 -0
- data/ext/common/AgentBase.h +39 -0
- data/ext/common/AgentsStarter.cpp +154 -0
- data/ext/common/AgentsStarter.h +81 -0
- data/ext/common/AgentsStarter.hpp +646 -0
- data/ext/common/ApplicationPool/Client.h +796 -0
- data/ext/common/ApplicationPool/Interface.h +295 -0
- data/ext/common/ApplicationPool/Pool.h +1327 -0
- data/ext/common/ApplicationPool/Server.h +475 -0
- data/ext/common/BCrypt.cpp +343 -0
- data/ext/common/BCrypt.h +73 -0
- data/ext/common/Blowfish.c +685 -0
- data/ext/common/Blowfish.h +103 -0
- data/ext/common/Constants.h +48 -0
- data/ext/common/EventedClient.h +702 -0
- data/ext/common/EventedMessageServer.h +327 -0
- data/ext/common/EventedServer.h +295 -0
- data/ext/common/Exceptions.h +348 -0
- data/ext/common/FileDescriptor.h +293 -0
- data/ext/common/HelperAgent/BacktracesServer.h +59 -0
- data/ext/common/IniFile.h +488 -0
- data/ext/common/Logging.cpp +64 -0
- data/ext/common/Logging.h +695 -0
- data/ext/common/LoggingAgent/ChangeNotifier.h +63 -0
- data/ext/common/LoggingAgent/DataStoreId.h +177 -0
- data/ext/common/LoggingAgent/LoggingServer.h +1343 -0
- data/ext/common/LoggingAgent/Main.cpp +278 -0
- data/ext/common/LoggingAgent/RemoteSender.h +468 -0
- data/ext/common/MessageChannel.h +737 -0
- data/ext/common/MessageClient.h +297 -0
- data/ext/common/MessageReadersWriters.h +508 -0
- data/ext/common/MessageServer.h +581 -0
- data/ext/common/PoolOptions.h +518 -0
- data/ext/common/Process.h +255 -0
- data/ext/common/RandomGenerator.h +160 -0
- data/ext/common/ResourceLocator.h +134 -0
- data/ext/common/SafeLibev.h +149 -0
- data/ext/common/ServerInstanceDir.h +347 -0
- data/ext/common/Session.h +470 -0
- data/ext/common/SpawnManager.h +616 -0
- data/ext/common/StaticString.h +298 -0
- data/ext/common/StringListCreator.h +83 -0
- data/ext/common/Utils.cpp +972 -0
- data/ext/common/Utils.h +428 -0
- data/ext/common/Utils/Base64.cpp +143 -0
- data/ext/common/Utils/Base64.h +83 -0
- data/ext/common/Utils/BlockingQueue.h +136 -0
- data/ext/common/Utils/BufferedIO.h +196 -0
- data/ext/common/Utils/CachedFileStat.cpp +62 -0
- data/ext/common/Utils/CachedFileStat.h +51 -0
- data/ext/common/Utils/CachedFileStat.hpp +243 -0
- data/ext/common/Utils/FileChangeChecker.h +209 -0
- data/ext/common/Utils/IOUtils.cpp +913 -0
- data/ext/common/Utils/IOUtils.h +370 -0
- data/ext/common/Utils/MD5.cpp +406 -0
- data/ext/common/Utils/MD5.h +98 -0
- data/ext/common/Utils/MemZeroGuard.h +103 -0
- data/ext/common/Utils/ProcessMetricsCollector.h +590 -0
- data/ext/common/Utils/ScopeGuard.h +72 -0
- data/ext/common/Utils/StrIntUtils.cpp +363 -0
- data/ext/common/Utils/StrIntUtils.h +231 -0
- data/ext/common/Utils/SystemTime.cpp +37 -0
- data/ext/common/Utils/SystemTime.h +201 -0
- data/ext/common/Utils/Timer.h +152 -0
- data/ext/common/Utils/VariantMap.h +363 -0
- data/ext/common/Utils/utf8.h +35 -0
- data/ext/common/Utils/utf8/checked.h +324 -0
- data/ext/common/Utils/utf8/core.h +359 -0
- data/ext/common/Utils/utf8/unchecked.h +229 -0
- data/ext/common/Watchdog.cpp +1001 -0
- data/ext/google/COPYING +28 -0
- data/ext/google/ChangeLog +167 -0
- data/ext/google/dense_hash_map +310 -0
- data/ext/google/dense_hash_set +287 -0
- data/ext/google/sparse_hash_map +294 -0
- data/ext/google/sparse_hash_set +275 -0
- data/ext/google/sparsehash/densehashtable.h +1062 -0
- data/ext/google/sparsehash/sparseconfig.h +55 -0
- data/ext/google/sparsehash/sparsehashtable.h +1015 -0
- data/ext/google/sparsetable +1468 -0
- data/ext/google/type_traits.h +250 -0
- data/ext/libev/Changes +302 -0
- data/ext/libev/LICENSE +36 -0
- data/ext/libev/Makefile.am +18 -0
- data/ext/libev/Makefile.in +685 -0
- data/ext/libev/README +58 -0
- data/ext/libev/aclocal.m4 +7549 -0
- data/ext/libev/autogen.sh +6 -0
- data/ext/libev/config.guess +1526 -0
- data/ext/libev/config.h.in +121 -0
- data/ext/libev/config.sub +1658 -0
- data/ext/libev/configure +22156 -0
- data/ext/libev/configure.ac +18 -0
- data/ext/libev/ev++.h +800 -0
- data/ext/libev/ev.c +3694 -0
- data/ext/libev/ev.h +705 -0
- data/ext/libev/ev_epoll.c +228 -0
- data/ext/libev/ev_kqueue.c +196 -0
- data/ext/libev/ev_poll.c +144 -0
- data/ext/libev/ev_port.c +165 -0
- data/ext/libev/ev_select.c +308 -0
- data/ext/libev/ev_vars.h +187 -0
- data/ext/libev/ev_win32.c +153 -0
- data/ext/libev/ev_wrap.h +178 -0
- data/ext/libev/event.c +401 -0
- data/ext/libev/event.h +158 -0
- data/ext/libev/install-sh +294 -0
- data/ext/libev/libev.m4 +38 -0
- data/ext/libev/ltmain.sh +6871 -0
- data/ext/libev/missing +336 -0
- data/ext/libev/mkinstalldirs +111 -0
- data/ext/nginx/Configuration.c +1454 -0
- data/ext/nginx/Configuration.h +94 -0
- data/ext/nginx/ContentHandler.c +1360 -0
- data/ext/nginx/ContentHandler.h +64 -0
- data/ext/nginx/HelperAgent.cpp +988 -0
- data/ext/nginx/HttpStatusExtractor.h +351 -0
- data/ext/nginx/ScgiRequestParser.h +375 -0
- data/ext/nginx/StaticContentHandler.c +256 -0
- data/ext/nginx/StaticContentHandler.h +37 -0
- data/ext/nginx/config +56 -0
- data/ext/nginx/ngx_http_passenger_module.c +499 -0
- data/ext/nginx/ngx_http_passenger_module.h +63 -0
- data/ext/oxt/backtrace.cpp +185 -0
- data/ext/oxt/backtrace.hpp +135 -0
- data/ext/oxt/detail/backtrace_disabled.hpp +39 -0
- data/ext/oxt/detail/backtrace_enabled.hpp +156 -0
- data/ext/oxt/detail/spin_lock_darwin.hpp +69 -0
- data/ext/oxt/detail/spin_lock_gcc_x86.hpp +81 -0
- data/ext/oxt/detail/spin_lock_portable.hpp +38 -0
- data/ext/oxt/detail/spin_lock_pthreads.hpp +97 -0
- data/ext/oxt/detail/tracable_exception_disabled.hpp +46 -0
- data/ext/oxt/detail/tracable_exception_enabled.hpp +48 -0
- data/ext/oxt/dynamic_thread_group.hpp +195 -0
- data/ext/oxt/macros.hpp +58 -0
- data/ext/oxt/spin_lock.hpp +57 -0
- data/ext/oxt/system_calls.cpp +477 -0
- data/ext/oxt/system_calls.hpp +260 -0
- data/ext/oxt/thread.cpp +32 -0
- data/ext/oxt/thread.hpp +370 -0
- data/ext/oxt/tracable_exception.cpp +87 -0
- data/ext/oxt/tracable_exception.hpp +35 -0
- data/ext/ruby/extconf.rb +41 -0
- data/ext/ruby/passenger_native_support.c +1037 -0
- data/helper-scripts/passenger-spawn-server +106 -0
- data/helper-scripts/prespawn +63 -0
- data/lib/phusion_passenger.rb +107 -0
- data/lib/phusion_passenger/abstract_installer.rb +234 -0
- data/lib/phusion_passenger/abstract_request_handler.rb +738 -0
- data/lib/phusion_passenger/abstract_server.rb +372 -0
- data/lib/phusion_passenger/abstract_server_collection.rb +335 -0
- data/lib/phusion_passenger/admin_tools.rb +48 -0
- data/lib/phusion_passenger/admin_tools/memory_stats.rb +299 -0
- data/lib/phusion_passenger/admin_tools/server_instance.rb +334 -0
- data/lib/phusion_passenger/analytics_logger.rb +342 -0
- data/lib/phusion_passenger/app_process.rb +162 -0
- data/lib/phusion_passenger/classic_rails/application_spawner.rb +344 -0
- data/lib/phusion_passenger/classic_rails/cgi_fixed.rb +68 -0
- data/lib/phusion_passenger/classic_rails/framework_spawner.rb +311 -0
- data/lib/phusion_passenger/classic_rails/request_handler.rb +75 -0
- data/lib/phusion_passenger/classic_rails_extensions/analytics_logging/ac_base_extension.rb +65 -0
- data/lib/phusion_passenger/classic_rails_extensions/analytics_logging/ac_benchmarking_extension.rb +48 -0
- data/lib/phusion_passenger/classic_rails_extensions/analytics_logging/ac_rescue_extension.rb +59 -0
- data/lib/phusion_passenger/classic_rails_extensions/analytics_logging/ar_abstract_adapter_extension.rb +54 -0
- data/lib/phusion_passenger/classic_rails_extensions/analytics_logging/as_cache_extension.rb +130 -0
- data/lib/phusion_passenger/classic_rails_extensions/analytics_logging/av_benchmark_helper_extension.rb +47 -0
- data/lib/phusion_passenger/classic_rails_extensions/init.rb +123 -0
- data/lib/phusion_passenger/console_text_template.rb +66 -0
- data/lib/phusion_passenger/constants.rb +35 -0
- data/lib/phusion_passenger/debug_logging.rb +104 -0
- data/lib/phusion_passenger/dependencies.rb +633 -0
- data/lib/phusion_passenger/exceptions.rb +103 -0
- data/lib/phusion_passenger/html_template.rb +107 -0
- data/lib/phusion_passenger/message_channel.rb +387 -0
- data/lib/phusion_passenger/message_client.rb +173 -0
- data/lib/phusion_passenger/native_support.rb +166 -0
- data/lib/phusion_passenger/packaging.rb +108 -0
- data/lib/phusion_passenger/platform_info.rb +248 -0
- data/lib/phusion_passenger/platform_info/apache.rb +332 -0
- data/lib/phusion_passenger/platform_info/binary_compatibility.rb +175 -0
- data/lib/phusion_passenger/platform_info/compiler.rb +183 -0
- data/lib/phusion_passenger/platform_info/curl.rb +61 -0
- data/lib/phusion_passenger/platform_info/documentation_tools.rb +35 -0
- data/lib/phusion_passenger/platform_info/linux.rb +77 -0
- data/lib/phusion_passenger/platform_info/operating_system.rb +158 -0
- data/lib/phusion_passenger/platform_info/ruby.rb +338 -0
- data/lib/phusion_passenger/platform_info/zlib.rb +38 -0
- data/lib/phusion_passenger/plugin.rb +96 -0
- data/lib/phusion_passenger/public_api.rb +112 -0
- data/lib/phusion_passenger/rack/application_spawner.rb +227 -0
- data/lib/phusion_passenger/rack/request_handler.rb +145 -0
- data/lib/phusion_passenger/rails3_extensions/init.rb +207 -0
- data/lib/phusion_passenger/simple_benchmarking.rb +52 -0
- data/lib/phusion_passenger/spawn_manager.rb +359 -0
- data/lib/phusion_passenger/standalone/app_finder.rb +153 -0
- data/lib/phusion_passenger/standalone/command.rb +241 -0
- data/lib/phusion_passenger/standalone/config_file.rb +119 -0
- data/lib/phusion_passenger/standalone/help_command.rb +57 -0
- data/lib/phusion_passenger/standalone/main.rb +101 -0
- data/lib/phusion_passenger/standalone/package_runtime_command.rb +92 -0
- data/lib/phusion_passenger/standalone/runtime_installer.rb +479 -0
- data/lib/phusion_passenger/standalone/start_command.rb +514 -0
- data/lib/phusion_passenger/standalone/status_command.rb +62 -0
- data/lib/phusion_passenger/standalone/stop_command.rb +74 -0
- data/lib/phusion_passenger/standalone/utils.rb +46 -0
- data/lib/phusion_passenger/standalone/version_command.rb +42 -0
- data/lib/phusion_passenger/templates/apache2/apache_must_be_compiled_with_compatible_mpm.txt.erb +9 -0
- data/lib/phusion_passenger/templates/apache2/config_snippets.txt.erb +13 -0
- data/lib/phusion_passenger/templates/apache2/deployment_example.txt.erb +23 -0
- data/lib/phusion_passenger/templates/apache2/no_write_permission_to_passenger_root.txt.erb +9 -0
- data/lib/phusion_passenger/templates/apache2/possible_solutions_for_compilation_and_installation_problems.txt.erb +11 -0
- data/lib/phusion_passenger/templates/apache2/run_installer_as_root.txt.erb +8 -0
- data/lib/phusion_passenger/templates/apache2/welcome.txt.erb +15 -0
- data/lib/phusion_passenger/templates/app_exited_during_initialization.html.erb +38 -0
- data/lib/phusion_passenger/templates/app_init_error.html.erb +64 -0
- data/lib/phusion_passenger/templates/database_error.html.erb +66 -0
- data/lib/phusion_passenger/templates/error_layout.css +97 -0
- data/lib/phusion_passenger/templates/error_layout.html.erb +39 -0
- data/lib/phusion_passenger/templates/framework_init_error.html.erb +39 -0
- data/lib/phusion_passenger/templates/general_error.html.erb +22 -0
- data/lib/phusion_passenger/templates/load_error.html.erb +46 -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/templates/standalone/cannot_write_to_dir.txt.erb +11 -0
- data/lib/phusion_passenger/templates/standalone/config.erb +94 -0
- data/lib/phusion_passenger/templates/standalone/possible_solutions_for_download_and_extraction_problems.txt.erb +17 -0
- data/lib/phusion_passenger/templates/standalone/run_installer_as_root.txt.erb +8 -0
- data/lib/phusion_passenger/templates/standalone/welcome.txt.erb +8 -0
- data/lib/phusion_passenger/templates/standalone_default_root/index.html +1 -0
- data/lib/phusion_passenger/templates/version_not_found.html.erb +34 -0
- data/lib/phusion_passenger/utils.rb +1080 -0
- data/lib/phusion_passenger/utils/file_system_watcher.rb +186 -0
- data/lib/phusion_passenger/utils/hosts_file_parser.rb +130 -0
- data/lib/phusion_passenger/utils/rewindable_input.rb +125 -0
- data/lib/phusion_passenger/utils/tmpdir.rb +70 -0
- data/lib/phusion_passenger/utils/unseekable_socket.rb +196 -0
- data/lib/phusion_passenger/wsgi/application_spawner.rb +108 -0
- data/lib/phusion_passenger/wsgi/request_handler.py +199 -0
- data/man/passenger-config.1 +29 -0
- data/man/passenger-make-enterprisey.8 +23 -0
- data/man/passenger-memory-stats.8 +33 -0
- data/man/passenger-status.8 +43 -0
- data/man/passenger-stress-test.1 +43 -0
- data/resources/mime.types +73 -0
- data/resources/union_station_gateway.crt +32 -0
- data/test/config.yml.example +41 -0
- data/test/cxx/ApplicationPool_PoolTest.cpp +33 -0
- data/test/cxx/ApplicationPool_PoolTestCases.cpp +1029 -0
- data/test/cxx/ApplicationPool_ServerTest.cpp +308 -0
- data/test/cxx/ApplicationPool_Server_PoolTest.cpp +80 -0
- data/test/cxx/Base64Test.cpp +50 -0
- data/test/cxx/BufferedIOTest.cpp +364 -0
- data/test/cxx/CachedFileStatTest.cpp +402 -0
- data/test/cxx/CxxTestMain.cpp +122 -0
- data/test/cxx/EventedClientTest.cpp +523 -0
- data/test/cxx/FileChangeCheckerTest.cpp +329 -0
- data/test/cxx/FileDescriptorTest.cpp +69 -0
- data/test/cxx/HttpStatusExtractorTest.cpp +198 -0
- data/test/cxx/IOUtilsTest.cpp +796 -0
- data/test/cxx/LoggingTest.cpp +914 -0
- data/test/cxx/MessageChannelTest.cpp +557 -0
- data/test/cxx/MessageReadersWritersTest.cpp +574 -0
- data/test/cxx/MessageServerTest.cpp +383 -0
- data/test/cxx/PoolOptionsTest.cpp +116 -0
- data/test/cxx/ProcessMetricsCollectorTest.cpp +121 -0
- data/test/cxx/ScgiRequestParserTest.cpp +389 -0
- data/test/cxx/ServerInstanceDirTest.cpp +186 -0
- data/test/cxx/SpawnManagerTest.cpp +161 -0
- data/test/cxx/StaticStringTest.cpp +220 -0
- data/test/cxx/SystemTimeTest.cpp +37 -0
- data/test/cxx/TestSupport.cpp +166 -0
- data/test/cxx/TestSupport.h +254 -0
- data/test/cxx/UtilsTest.cpp +491 -0
- data/test/cxx/VariantMapTest.cpp +179 -0
- data/test/integration_tests/apache2_tests.rb +666 -0
- data/test/integration_tests/cgi_environment_spec.rb +26 -0
- 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 +166 -0
- data/test/integration_tests/nginx_tests.rb +260 -0
- data/test/integration_tests/spec_helper.rb +19 -0
- data/test/oxt/backtrace_test.cpp +88 -0
- data/test/oxt/counter.hpp +55 -0
- data/test/oxt/dynamic_thread_group_test.cpp +131 -0
- data/test/oxt/oxt_test_main.cpp +25 -0
- data/test/oxt/spin_lock_test.cpp +59 -0
- data/test/oxt/syscall_interruption_test.cpp +38 -0
- data/test/ruby/abstract_request_handler_spec.rb +406 -0
- data/test/ruby/abstract_server_collection_spec.rb +247 -0
- data/test/ruby/abstract_server_spec.rb +61 -0
- data/test/ruby/admin_tools_spec.rb +362 -0
- data/test/ruby/analytics_logger_spec.rb +253 -0
- data/test/ruby/app_process_spec.rb +43 -0
- data/test/ruby/classic_rails/application_spawner_spec.rb +89 -0
- data/test/ruby/classic_rails/framework_spawner_spec.rb +92 -0
- data/test/ruby/debug_logging_spec.rb +141 -0
- data/test/ruby/message_channel_spec.rb +196 -0
- data/test/ruby/rack/application_spawner_spec.rb +116 -0
- data/test/ruby/shared/abstract_server_spec.rb +23 -0
- data/test/ruby/shared/rails/analytics_logging_extensions_spec.rb +375 -0
- data/test/ruby/shared/spawners/classic_rails/framework_spawner_spec.rb +38 -0
- data/test/ruby/shared/spawners/classic_rails/lack_of_rails_gem_version_spec.rb +19 -0
- data/test/ruby/shared/spawners/classic_rails/spawner_spec.rb +15 -0
- data/test/ruby/shared/spawners/non_preloading_spawner_spec.rb +27 -0
- data/test/ruby/shared/spawners/preloading_spawner_spec.rb +29 -0
- data/test/ruby/shared/spawners/reload_all_spec.rb +36 -0
- data/test/ruby/shared/spawners/reload_single_spec.rb +52 -0
- data/test/ruby/shared/spawners/spawn_server_spec.rb +28 -0
- data/test/ruby/shared/spawners/spawner_spec.rb +273 -0
- data/test/ruby/shared/utils/pseudo_io_spec.rb +60 -0
- data/test/ruby/spawn_manager_spec.rb +134 -0
- data/test/ruby/spec_helper.rb +104 -0
- data/test/ruby/utils/file_system_watcher_spec.rb +221 -0
- data/test/ruby/utils/hosts_file_parser.rb +258 -0
- data/test/ruby/utils/unseekable_socket_spec.rb +66 -0
- data/test/ruby/utils_spec.rb +748 -0
- data/test/ruby/wsgi/application_spawner_spec.rb +50 -0
- data/test/stub/apache2/httpd.conf.erb +86 -0
- data/test/stub/apache2/mime.types +748 -0
- data/test/stub/garbage1.dat +0 -0
- data/test/stub/garbage2.dat +0 -0
- data/test/stub/garbage3.dat +0 -0
- data/test/stub/http_request.yml +23 -0
- data/test/stub/message_channel.rb +11 -0
- data/test/stub/message_channel_2.rb +12 -0
- data/test/stub/message_channel_3.rb +19 -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 +58 -0
- data/test/stub/nginx/win-utf +126 -0
- data/test/stub/rack/config.ru +4 -0
- data/test/stub/rack/public/rack.jpg +0 -0
- data/test/stub/rails_apps/1.2/empty/Rakefile +10 -0
- data/test/stub/rails_apps/1.2/empty/app/controllers/application.rb +7 -0
- data/test/stub/rails_apps/1.2/empty/app/helpers/application_helper.rb +3 -0
- data/test/stub/rails_apps/1.2/empty/config/boot.rb +108 -0
- data/test/stub/rails_apps/1.2/empty/config/database.yml +31 -0
- data/test/stub/rails_apps/1.2/empty/config/environment.rb +66 -0
- data/test/stub/rails_apps/1.2/empty/config/environments/development.rb +21 -0
- data/test/stub/rails_apps/1.2/empty/config/environments/production.rb +18 -0
- data/test/stub/rails_apps/1.2/empty/config/environments/staging.rb +18 -0
- data/test/stub/rails_apps/1.2/empty/config/environments/test.rb +19 -0
- data/test/stub/rails_apps/1.2/empty/config/routes.rb +23 -0
- data/test/stub/rails_apps/1.2/empty/doc/README_FOR_APP +2 -0
- data/test/stub/rails_apps/1.2/empty/public/404.html +30 -0
- data/test/stub/rails_apps/1.2/empty/public/500.html +30 -0
- data/test/stub/rails_apps/1.2/empty/public/dispatch.cgi +10 -0
- data/test/stub/rails_apps/1.2/empty/public/dispatch.fcgi +24 -0
- data/test/stub/rails_apps/1.2/empty/public/dispatch.rb +10 -0
- data/test/stub/rails_apps/1.2/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/1.2/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/1.2/empty/public/robots.txt +1 -0
- data/test/stub/rails_apps/1.2/empty/script/about +3 -0
- data/test/stub/rails_apps/1.2/empty/script/breakpointer +3 -0
- data/test/stub/rails_apps/1.2/empty/script/console +3 -0
- data/test/stub/rails_apps/1.2/empty/script/destroy +3 -0
- data/test/stub/rails_apps/1.2/empty/script/generate +3 -0
- data/test/stub/rails_apps/1.2/empty/script/performance/benchmarker +3 -0
- data/test/stub/rails_apps/1.2/empty/script/performance/profiler +3 -0
- data/test/stub/rails_apps/1.2/empty/script/plugin +3 -0
- data/test/stub/rails_apps/1.2/empty/script/process/inspector +3 -0
- data/test/stub/rails_apps/1.2/empty/script/process/reaper +3 -0
- data/test/stub/rails_apps/1.2/empty/script/process/spawner +3 -0
- data/test/stub/rails_apps/1.2/empty/script/runner +3 -0
- data/test/stub/rails_apps/1.2/empty/script/server +3 -0
- data/test/stub/rails_apps/1.2/empty/test/test_helper.rb +28 -0
- data/test/stub/rails_apps/2.0/empty/Rakefile +10 -0
- data/test/stub/rails_apps/2.0/empty/app/controllers/application.rb +10 -0
- data/test/stub/rails_apps/2.0/empty/app/helpers/application_helper.rb +3 -0
- data/test/stub/rails_apps/2.0/empty/config/boot.rb +108 -0
- data/test/stub/rails_apps/2.0/empty/config/database.yml +31 -0
- data/test/stub/rails_apps/2.0/empty/config/environment.rb +59 -0
- data/test/stub/rails_apps/2.0/empty/config/environments/development.rb +18 -0
- data/test/stub/rails_apps/2.0/empty/config/environments/production.rb +18 -0
- data/test/stub/rails_apps/2.0/empty/config/environments/staging.rb +18 -0
- data/test/stub/rails_apps/2.0/empty/config/environments/test.rb +22 -0
- data/test/stub/rails_apps/2.0/empty/config/initializers/inflections.rb +10 -0
- data/test/stub/rails_apps/2.0/empty/config/initializers/mime_types.rb +5 -0
- data/test/stub/rails_apps/2.0/empty/config/routes.rb +35 -0
- data/test/stub/rails_apps/2.0/empty/doc/README_FOR_APP +2 -0
- data/test/stub/rails_apps/2.0/empty/public/404.html +30 -0
- data/test/stub/rails_apps/2.0/empty/public/422.html +30 -0
- data/test/stub/rails_apps/2.0/empty/public/500.html +30 -0
- data/test/stub/rails_apps/2.0/empty/public/dispatch.cgi +10 -0
- data/test/stub/rails_apps/2.0/empty/public/dispatch.fcgi +24 -0
- data/test/stub/rails_apps/2.0/empty/public/dispatch.rb +10 -0
- data/test/stub/rails_apps/2.0/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.0/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.0/empty/public/robots.txt +5 -0
- data/test/stub/rails_apps/2.0/empty/script/about +3 -0
- data/test/stub/rails_apps/2.0/empty/script/console +3 -0
- data/test/stub/rails_apps/2.0/empty/script/destroy +3 -0
- data/test/stub/rails_apps/2.0/empty/script/generate +3 -0
- data/test/stub/rails_apps/2.0/empty/script/performance/benchmarker +3 -0
- data/test/stub/rails_apps/2.0/empty/script/performance/profiler +3 -0
- data/test/stub/rails_apps/2.0/empty/script/performance/request +3 -0
- data/test/stub/rails_apps/2.0/empty/script/plugin +3 -0
- data/test/stub/rails_apps/2.0/empty/script/process/inspector +3 -0
- data/test/stub/rails_apps/2.0/empty/script/process/reaper +3 -0
- data/test/stub/rails_apps/2.0/empty/script/process/spawner +3 -0
- data/test/stub/rails_apps/2.0/empty/script/runner +3 -0
- data/test/stub/rails_apps/2.0/empty/script/server +3 -0
- data/test/stub/rails_apps/2.0/empty/test/test_helper.rb +38 -0
- data/test/stub/rails_apps/2.2/empty/Rakefile +10 -0
- data/test/stub/rails_apps/2.2/empty/app/controllers/application.rb +15 -0
- data/test/stub/rails_apps/2.2/empty/app/helpers/application_helper.rb +3 -0
- data/test/stub/rails_apps/2.2/empty/config/boot.rb +109 -0
- data/test/stub/rails_apps/2.2/empty/config/database.yml +31 -0
- data/test/stub/rails_apps/2.2/empty/config/environment.rb +75 -0
- data/test/stub/rails_apps/2.2/empty/config/environments/development.rb +17 -0
- data/test/stub/rails_apps/2.2/empty/config/environments/production.rb +24 -0
- data/test/stub/rails_apps/2.2/empty/config/environments/staging.rb +24 -0
- data/test/stub/rails_apps/2.2/empty/config/environments/test.rb +22 -0
- data/test/stub/rails_apps/2.2/empty/config/initializers/inflections.rb +10 -0
- data/test/stub/rails_apps/2.2/empty/config/initializers/mime_types.rb +5 -0
- data/test/stub/rails_apps/2.2/empty/config/initializers/new_rails_defaults.rb +17 -0
- data/test/stub/rails_apps/2.2/empty/config/locales/en.yml +5 -0
- data/test/stub/rails_apps/2.2/empty/config/routes.rb +43 -0
- data/test/stub/rails_apps/2.2/empty/doc/README_FOR_APP +5 -0
- data/test/stub/rails_apps/2.2/empty/public/404.html +30 -0
- data/test/stub/rails_apps/2.2/empty/public/422.html +30 -0
- data/test/stub/rails_apps/2.2/empty/public/500.html +33 -0
- data/test/stub/rails_apps/2.2/empty/public/dispatch.cgi +10 -0
- data/test/stub/rails_apps/2.2/empty/public/dispatch.fcgi +24 -0
- data/test/stub/rails_apps/2.2/empty/public/dispatch.rb +10 -0
- data/test/stub/rails_apps/2.2/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.2/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.2/empty/public/robots.txt +5 -0
- data/test/stub/rails_apps/2.2/empty/script/about +4 -0
- data/test/stub/rails_apps/2.2/empty/script/console +3 -0
- data/test/stub/rails_apps/2.2/empty/script/dbconsole +3 -0
- data/test/stub/rails_apps/2.2/empty/script/destroy +3 -0
- data/test/stub/rails_apps/2.2/empty/script/generate +3 -0
- data/test/stub/rails_apps/2.2/empty/script/performance/benchmarker +3 -0
- data/test/stub/rails_apps/2.2/empty/script/performance/profiler +3 -0
- data/test/stub/rails_apps/2.2/empty/script/performance/request +3 -0
- data/test/stub/rails_apps/2.2/empty/script/plugin +3 -0
- data/test/stub/rails_apps/2.2/empty/script/process/inspector +3 -0
- data/test/stub/rails_apps/2.2/empty/script/process/reaper +3 -0
- data/test/stub/rails_apps/2.2/empty/script/process/spawner +3 -0
- data/test/stub/rails_apps/2.2/empty/script/runner +3 -0
- data/test/stub/rails_apps/2.2/empty/script/server +3 -0
- data/test/stub/rails_apps/2.2/empty/test/performance/browsing_test.rb +9 -0
- data/test/stub/rails_apps/2.2/empty/test/test_helper.rb +38 -0
- data/test/stub/rails_apps/2.3/empty/Rakefile +10 -0
- data/test/stub/rails_apps/2.3/empty/app/controllers/application_controller.rb +10 -0
- data/test/stub/rails_apps/2.3/empty/app/helpers/application_helper.rb +3 -0
- data/test/stub/rails_apps/2.3/empty/config/boot.rb +110 -0
- data/test/stub/rails_apps/2.3/empty/config/database.yml +31 -0
- data/test/stub/rails_apps/2.3/empty/config/environment.rb +41 -0
- data/test/stub/rails_apps/2.3/empty/config/environments/development.rb +17 -0
- data/test/stub/rails_apps/2.3/empty/config/environments/production.rb +28 -0
- data/test/stub/rails_apps/2.3/empty/config/environments/staging.rb +28 -0
- data/test/stub/rails_apps/2.3/empty/config/environments/test.rb +28 -0
- data/test/stub/rails_apps/2.3/empty/config/initializers/backtrace_silencers.rb +7 -0
- data/test/stub/rails_apps/2.3/empty/config/initializers/inflections.rb +10 -0
- data/test/stub/rails_apps/2.3/empty/config/initializers/mime_types.rb +5 -0
- data/test/stub/rails_apps/2.3/empty/config/initializers/new_rails_defaults.rb +21 -0
- data/test/stub/rails_apps/2.3/empty/config/initializers/session_store.rb +15 -0
- data/test/stub/rails_apps/2.3/empty/config/locales/en.yml +5 -0
- data/test/stub/rails_apps/2.3/empty/config/routes.rb +43 -0
- data/test/stub/rails_apps/2.3/empty/db/seeds.rb +7 -0
- data/test/stub/rails_apps/2.3/empty/doc/README_FOR_APP +2 -0
- data/test/stub/rails_apps/2.3/empty/public/404.html +30 -0
- data/test/stub/rails_apps/2.3/empty/public/422.html +30 -0
- data/test/stub/rails_apps/2.3/empty/public/500.html +30 -0
- data/test/stub/rails_apps/2.3/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.3/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.3/empty/public/robots.txt +5 -0
- data/test/stub/rails_apps/2.3/empty/script/about +4 -0
- data/test/stub/rails_apps/2.3/empty/script/console +3 -0
- data/test/stub/rails_apps/2.3/empty/script/dbconsole +3 -0
- data/test/stub/rails_apps/2.3/empty/script/destroy +3 -0
- data/test/stub/rails_apps/2.3/empty/script/generate +3 -0
- data/test/stub/rails_apps/2.3/empty/script/performance/benchmarker +3 -0
- data/test/stub/rails_apps/2.3/empty/script/performance/profiler +3 -0
- data/test/stub/rails_apps/2.3/empty/script/plugin +3 -0
- data/test/stub/rails_apps/2.3/empty/script/runner +3 -0
- data/test/stub/rails_apps/2.3/empty/script/server +3 -0
- data/test/stub/rails_apps/2.3/empty/test/performance/browsing_test.rb +9 -0
- data/test/stub/rails_apps/2.3/empty/test/test_helper.rb +38 -0
- data/test/stub/rails_apps/2.3/foobar/Rakefile +10 -0
- data/test/stub/rails_apps/2.3/foobar/app/controllers/application_controller.rb +12 -0
- data/test/stub/rails_apps/2.3/foobar/app/controllers/bar_controller_1.rb +5 -0
- data/test/stub/rails_apps/2.3/foobar/app/controllers/bar_controller_2.rb +5 -0
- data/test/stub/rails_apps/2.3/foobar/app/controllers/foo_controller.rb +21 -0
- data/test/stub/rails_apps/2.3/foobar/app/helpers/application_helper.rb +3 -0
- data/test/stub/rails_apps/2.3/foobar/config/boot.rb +110 -0
- data/test/stub/rails_apps/2.3/foobar/config/database.yml +19 -0
- data/test/stub/rails_apps/2.3/foobar/config/environment.rb +59 -0
- data/test/stub/rails_apps/2.3/foobar/config/environments/development.rb +17 -0
- data/test/stub/rails_apps/2.3/foobar/config/environments/production.rb +18 -0
- data/test/stub/rails_apps/2.3/foobar/config/environments/staging.rb +18 -0
- data/test/stub/rails_apps/2.3/foobar/config/initializers/inflections.rb +10 -0
- data/test/stub/rails_apps/2.3/foobar/config/initializers/mime_types.rb +5 -0
- data/test/stub/rails_apps/2.3/foobar/config/routes.rb +35 -0
- data/test/stub/rails_apps/2.3/foobar/script/about +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/console +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/dbconsole +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/destroy +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/generate +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/performance/benchmarker +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/performance/profiler +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/performance/request +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/plugin +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/process/inspector +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/process/reaper +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/process/spawner +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/runner +3 -0
- data/test/stub/rails_apps/2.3/foobar/script/server +3 -0
- data/test/stub/rails_apps/2.3/mycook/Rakefile +10 -0
- data/test/stub/rails_apps/2.3/mycook/app/controllers/application_controller.rb +12 -0
- data/test/stub/rails_apps/2.3/mycook/app/controllers/recipes_controller.rb +5 -0
- data/test/stub/rails_apps/2.3/mycook/app/controllers/uploads_controller.rb +15 -0
- data/test/stub/rails_apps/2.3/mycook/app/controllers/welcome_controller.rb +71 -0
- data/test/stub/rails_apps/2.3/mycook/app/helpers/application_helper.rb +3 -0
- data/test/stub/rails_apps/2.3/mycook/app/views/layouts/default.rhtml +26 -0
- data/test/stub/rails_apps/2.3/mycook/app/views/recipes/create.rhtml +13 -0
- data/test/stub/rails_apps/2.3/mycook/app/views/recipes/index.rhtml +3 -0
- data/test/stub/rails_apps/2.3/mycook/app/views/recipes/new.rhtml +8 -0
- data/test/stub/rails_apps/2.3/mycook/app/views/uploads/index.rhtml +1 -0
- data/test/stub/rails_apps/2.3/mycook/app/views/uploads/new.html.erb +8 -0
- data/test/stub/rails_apps/2.3/mycook/app/views/welcome/cached.rhtml +1 -0
- data/test/stub/rails_apps/2.3/mycook/app/views/welcome/index.rhtml +20 -0
- data/test/stub/rails_apps/2.3/mycook/config/boot.rb +110 -0
- data/test/stub/rails_apps/2.3/mycook/config/database.yml +19 -0
- data/test/stub/rails_apps/2.3/mycook/config/environment.rb +61 -0
- data/test/stub/rails_apps/2.3/mycook/config/environments/development.rb +18 -0
- data/test/stub/rails_apps/2.3/mycook/config/environments/production.rb +19 -0
- data/test/stub/rails_apps/2.3/mycook/config/initializers/inflections.rb +10 -0
- data/test/stub/rails_apps/2.3/mycook/config/initializers/mime_types.rb +5 -0
- data/test/stub/rails_apps/2.3/mycook/config/routes.rb +38 -0
- data/test/stub/rails_apps/2.3/mycook/log/useless.txt +1 -0
- data/test/stub/rails_apps/2.3/mycook/public/404.html +30 -0
- data/test/stub/rails_apps/2.3/mycook/public/422.html +30 -0
- data/test/stub/rails_apps/2.3/mycook/public/500.html +30 -0
- data/test/stub/rails_apps/2.3/mycook/public/dispatch.cgi +10 -0
- data/test/stub/rails_apps/2.3/mycook/public/dispatch.fcgi +24 -0
- data/test/stub/rails_apps/2.3/mycook/public/dispatch.rb +10 -0
- data/test/stub/rails_apps/2.3/mycook/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/images/angrywizard.gif +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/images/cookbook.gif +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/images/header.png +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/javascripts/application.js +2 -0
- data/test/stub/rails_apps/2.3/mycook/public/javascripts/controls.js +963 -0
- data/test/stub/rails_apps/2.3/mycook/public/javascripts/dragdrop.js +973 -0
- data/test/stub/rails_apps/2.3/mycook/public/javascripts/effects.js +1128 -0
- data/test/stub/rails_apps/2.3/mycook/public/javascripts/prototype.js +4320 -0
- data/test/stub/rails_apps/2.3/mycook/public/robots.txt +5 -0
- data/test/stub/rails_apps/2.3/mycook/public/uploads.html +26 -0
- data/test/stub/rails_apps/2.3/mycook/public/welcome/cached.html +26 -0
- data/test/stub/rails_apps/2.3/mycook/script/about +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/console +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/dbconsole +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/destroy +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/generate +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/performance/benchmarker +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/performance/profiler +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/performance/request +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/plugin +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/process/inspector +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/process/reaper +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/process/spawner +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/runner +3 -0
- data/test/stub/rails_apps/2.3/mycook/script/server +3 -0
- data/test/stub/rails_apps/2.3/mycook/sites/some.site/public/uploads.html +26 -0
- data/test/stub/rails_apps/2.3/mycook/sites/some.site/public/welcome/cached.html +26 -0
- data/test/stub/rails_apps/2.3/mycook/tmp/cache/useless.txt +1 -0
- data/test/stub/rails_apps/2.3/mycook/tmp/pids/useless.txt +1 -0
- data/test/stub/rails_apps/2.3/mycook/tmp/sessions/useless.txt +1 -0
- data/test/stub/rails_apps/2.3/mycook/tmp/sockets/useless.txt +1 -0
- data/test/stub/rails_apps/3.0/empty/Gemfile +22 -0
- data/test/stub/rails_apps/3.0/empty/Gemfile.lock +73 -0
- data/test/stub/rails_apps/3.0/empty/Rakefile +10 -0
- data/test/stub/rails_apps/3.0/empty/app/controllers/application_controller.rb +4 -0
- data/test/stub/rails_apps/3.0/empty/app/helpers/application_helper.rb +2 -0
- data/test/stub/rails_apps/3.0/empty/app/views/layouts/application.html.erb +14 -0
- data/test/stub/rails_apps/3.0/empty/config.ru +4 -0
- data/test/stub/rails_apps/3.0/empty/config/application.rb +48 -0
- data/test/stub/rails_apps/3.0/empty/config/boot.rb +13 -0
- data/test/stub/rails_apps/3.0/empty/config/database.yml +22 -0
- data/test/stub/rails_apps/3.0/empty/config/environment.rb +5 -0
- data/test/stub/rails_apps/3.0/empty/config/environments/development.rb +19 -0
- data/test/stub/rails_apps/3.0/empty/config/environments/production.rb +48 -0
- data/test/stub/rails_apps/3.0/empty/config/environments/test.rb +32 -0
- data/test/stub/rails_apps/3.0/empty/config/initializers/backtrace_silencers.rb +7 -0
- data/test/stub/rails_apps/3.0/empty/config/initializers/inflections.rb +10 -0
- data/test/stub/rails_apps/3.0/empty/config/initializers/mime_types.rb +5 -0
- data/test/stub/rails_apps/3.0/empty/config/initializers/passenger.rb +1 -0
- data/test/stub/rails_apps/3.0/empty/config/initializers/secret_token.rb +7 -0
- data/test/stub/rails_apps/3.0/empty/config/initializers/session_store.rb +8 -0
- data/test/stub/rails_apps/3.0/empty/config/locales/en.yml +5 -0
- data/test/stub/rails_apps/3.0/empty/config/routes.rb +58 -0
- data/test/stub/rails_apps/3.0/empty/db/seeds.rb +7 -0
- data/test/stub/rails_apps/3.0/empty/doc/README_FOR_APP +2 -0
- data/test/stub/rails_apps/3.0/empty/public/404.html +26 -0
- data/test/stub/rails_apps/3.0/empty/public/422.html +26 -0
- data/test/stub/rails_apps/3.0/empty/public/500.html +26 -0
- data/test/stub/rails_apps/3.0/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/3.0/empty/public/index.html +279 -0
- data/test/stub/rails_apps/3.0/empty/public/robots.txt +5 -0
- data/test/stub/rails_apps/3.0/empty/script/rails +9 -0
- data/test/stub/rails_apps/3.0/empty/test/performance/browsing_test.rb +9 -0
- data/test/stub/rails_apps/3.0/empty/test/test_helper.rb +13 -0
- data/test/stub/spawn_server.rb +22 -0
- data/test/stub/upload_data.txt +494 -0
- data/test/stub/vendor_rails/minimal/README +1 -0
- data/test/stub/vendor_rails/minimal/actionmailer/lib/action_mailer.rb +0 -0
- data/test/stub/vendor_rails/minimal/actionpack/lib/action_controller.rb +22 -0
- data/test/stub/vendor_rails/minimal/actionpack/lib/action_pack.rb +0 -0
- data/test/stub/vendor_rails/minimal/actionpack/lib/action_view.rb +0 -0
- data/test/stub/vendor_rails/minimal/activerecord/lib/active_record.rb +7 -0
- data/test/stub/vendor_rails/minimal/activeresource/lib/active_resource.rb +0 -0
- data/test/stub/vendor_rails/minimal/activesupport/lib/active_support.rb +17 -0
- data/test/stub/vendor_rails/minimal/activesupport/lib/active_support/whiny_nil.rb +0 -0
- data/test/stub/vendor_rails/minimal/railties/lib/dispatcher.rb +0 -0
- data/test/stub/vendor_rails/minimal/railties/lib/initializer.rb +57 -0
- data/test/stub/vendor_rails/minimal/railties/lib/ruby_version_check.rb +1 -0
- data/test/stub/wsgi/passenger_wsgi.py +3 -0
- data/test/stub/wsgi/public/wsgi-snake.jpg +0 -0
- data/test/stub/zsfa/header.png +0 -0
- data/test/stub/zsfa/index.html +14 -0
- data/test/stub/zsfa/zsfa.png +0 -0
- data/test/support/allocate_memory.c +14 -0
- data/test/support/apache2_controller.rb +258 -0
- data/test/support/multipart.rb +62 -0
- data/test/support/nginx_controller.rb +99 -0
- data/test/support/test_helper.rb +448 -0
- data/test/support/valgrind.h +2539 -0
- data/test/tut/tut.h +1240 -0
- data/test/tut/tut_reporter.h +256 -0
- metadata +1703 -0
@@ -0,0 +1 @@
|
|
1
|
+
asciidoc required to build docs
|
@@ -0,0 +1,197 @@
|
|
1
|
+
Security of user switching support in Passenger
|
2
|
+
===============================================
|
3
|
+
|
4
|
+
Problem description
|
5
|
+
-------------------
|
6
|
+
TIP: It is strongly recommended that you first read our
|
7
|
+
link:Architectural%20overview.html[Architectural Overview].
|
8
|
+
|
9
|
+
A straightforward implementation of Passenger will spawn Rails applications in
|
10
|
+
the same user context as Apache itself. On server machines which host multiple
|
11
|
+
websites for multiple users, this may not be desired. All Rails applications
|
12
|
+
spawned by Passenger will be able to read and write to all directories that the
|
13
|
+
web server can. So for example, Joe's Rails applications could read Jane's
|
14
|
+
Rails application's 'database.yml' or delete her application files. This is
|
15
|
+
also a problem that typically plagues PHP web hosts.
|
16
|
+
|
17
|
+
There are multiple ways to solve this problem. The goal of this document is to
|
18
|
+
inform the reader about the solutions have we have analyzed, so that
|
19
|
+
Passenger's security may be peer reviewed.
|
20
|
+
|
21
|
+
|
22
|
+
Analysis of possible solutions
|
23
|
+
------------------------------
|
24
|
+
It seems that the only way to solve this problem on Unix, is to run each Rails
|
25
|
+
application server as its owner's user and group. Passenger can make use of
|
26
|
+
one of the following methods to implement this:
|
27
|
+
|
28
|
+
1. Apache (and thus Passenger) must already be running as root.
|
29
|
+
2. Using Apache's suEXEC.
|
30
|
+
3. A setuid root wrapper application must exist, to allow non-root processes
|
31
|
+
to obtain root privileges (or at least, the privilege to switch user).
|
32
|
+
4. For each user $X that Passenger will need to switch to, there must exist
|
33
|
+
a setuid $X wrapper application.
|
34
|
+
5. Using 'su'.
|
35
|
+
6. Using 'sudo'.
|
36
|
+
|
37
|
+
Let us take a look at each method in detail.
|
38
|
+
|
39
|
+
[[apache_root]]
|
40
|
+
Apache must already be running as root
|
41
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
42
|
+
First, let us take a look at the typical Apache setup, in which Apache is bound
|
43
|
+
to port 80, and uses the prefork MPM. Binding to any port lower than 1024
|
44
|
+
requires root privileges, so Apache is typically run as root. This poses an
|
45
|
+
unacceptable security risk, so Apache's prefork MPM will, upon receiving an
|
46
|
+
HTTP request, spawn a child process with the privileges of a normal user,
|
47
|
+
typically 'www-data' or 'nobody'.
|
48
|
+
See http://httpd.apache.org/docs/2.2/mod/prefork.html[the documentation for the
|
49
|
+
prefork MPM] - in particular the ``User'' and ``Group'' directives - for details.
|
50
|
+
The process which is responsible for spawning child processes (also called the
|
51
|
+
control process) is run as root. This is also true for
|
52
|
+
http://httpd.apache.org/docs/2.2/mod/worker.html[the worker MPM].
|
53
|
+
|
54
|
+
Since Passenger has access to the control process, in the typical Apache setup,
|
55
|
+
Passenger can already launch Rails applications as a different user. But now we
|
56
|
+
have to ask this question:
|
57
|
+
|
58
|
+
=================================
|
59
|
+
If Apache is not running as root, are there still any Passenger users who
|
60
|
+
want to run Rails applications as different users?
|
61
|
+
=================================
|
62
|
+
|
63
|
+
If the answer is yes, then we cannot use this method.
|
64
|
+
|
65
|
+
The advantage of this method is that setting up Apache to run as root is
|
66
|
+
incredibly easy, and requires no new framework to be written. However, testing
|
67
|
+
this method in automated unit tests will require running the unit test suit as
|
68
|
+
root.
|
69
|
+
|
70
|
+
Using Apache's suEXEC
|
71
|
+
~~~~~~~~~~~~~~~~~~~~~
|
72
|
+
Apache's http://httpd.apache.org/docs/2.0/suexec.html[suEXEC] allows one to
|
73
|
+
run CGI processes as different users. But it seems that suEXEC can only be
|
74
|
+
used for CGI, and is not a general-purpose mechanism. The
|
75
|
+
http://alain.knaff.lu/howto/PhpSuexec/[PHP-suEXEC] software allows one to run
|
76
|
+
PHP applications via suEXEC, but it requires patching suEXEC. If Passenger is
|
77
|
+
to use suEXEC, then it is likely that we'll have to patch suEXEC. The suEXEC
|
78
|
+
website strongly discourages patching.
|
79
|
+
|
80
|
+
Using a setuid root wrapper application
|
81
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
82
|
+
If we use this method, we must be extremely careful. It must not be possible
|
83
|
+
for arbitrary processes to gain root privileges. We want Passenger, and only
|
84
|
+
Passenger, to be able to gain root privileges.
|
85
|
+
|
86
|
+
There are multiple ways to implement this security. The first one is to use
|
87
|
+
a password file, which only Apache and the wrapper can read, through
|
88
|
+
the use of proper file permissions. The password file must never be world
|
89
|
+
readable or writable.
|
90
|
+
|
91
|
+
It works as follows:
|
92
|
+
|
93
|
+
1. Passenger runs the wrapper.
|
94
|
+
2. Passenger passes the content of the password file to the wrapper, via
|
95
|
+
an anonymous pipe (or some other anonymous channel, that no other
|
96
|
+
processes can access).
|
97
|
+
3. The wrapper checks whether the passed content is the same as what is in
|
98
|
+
the password file. If it is, then it is proven that whatever application
|
99
|
+
ran the wrapper has read access to the password file, and thus is authorized
|
100
|
+
to use the wrapper.
|
101
|
+
|
102
|
+
An obvious problem that arises is: how does the wrapper locate its own password
|
103
|
+
file? We obviously do not want to be able to specify the password filename as
|
104
|
+
an argument to the wrapper: that would defeat the point of the password file.
|
105
|
+
The solution is that the filename is to be hardcoded into the binary during
|
106
|
+
compile time.
|
107
|
+
|
108
|
+
Another way to implement security is to use a whitelist of users that are
|
109
|
+
allowed to use the wrapper. The wrapper can then check whether the calling
|
110
|
+
process's user is in the whitelist.
|
111
|
+
|
112
|
+
Writing a wrapper is not too hard. Furthermore, unit tests do not have to be
|
113
|
+
run as root, in contrast to the run-Apache-as-root method.
|
114
|
+
|
115
|
+
[[setuid_root]]
|
116
|
+
Using a setuid $X wrapper application
|
117
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
118
|
+
A setuid $X wrapper will work in a fashion similar to the setuid root wrapper,
|
119
|
+
i.e. it will use a password file for authorization.
|
120
|
+
|
121
|
+
Passenger does not spawn Rails applications itself, but does so via the spawn
|
122
|
+
server. This spawn server is also responsible for preloading the Rails
|
123
|
+
framework and the Rails application code, in order to speed up the spawning
|
124
|
+
of Rails applications. See the design document of the spawn server for details.
|
125
|
+
The spawn server never calls `exec()`: doing so will make preloading useless.
|
126
|
+
If Passenger is to use a setuid $X wrapper, then it must start the spawn
|
127
|
+
server via the wrapper. The spawn server itself cannot use the wrapper.
|
128
|
+
|
129
|
+
However, doing so will make preloading less efficient. Passenger will be forced
|
130
|
+
to run a spawn server for each user. The different spawn servers do not share
|
131
|
+
memory with each other, so a lot of memory is wasted compared to the other
|
132
|
+
methods.
|
133
|
+
|
134
|
+
Implementing this will also take more work. One has to create a different
|
135
|
+
wrapper for each user, and to install it.
|
136
|
+
|
137
|
+
Using 'su'
|
138
|
+
~~~~~~~~~~
|
139
|
+
The standard Unix 'su' tool asks for the root password. It's a bad idea for
|
140
|
+
Apache to know the root password, so using 'su' is not a viable alternative.
|
141
|
+
|
142
|
+
Using 'sudo'
|
143
|
+
~~~~~~~~~~~~
|
144
|
+
It might be possible to use the 'sudo' utility. sudo can be configured in
|
145
|
+
such a way that the user Apache runs as can use sudo without having to enter a
|
146
|
+
password.
|
147
|
+
|
148
|
+
However, Passenger uses an anonymous communication channel (an unnamed Unix
|
149
|
+
socket) to communicate with the spawn server. sudo seems to close all file
|
150
|
+
descriptors before executing an application, so Passenger will have to
|
151
|
+
communicate with the spawn server via a non-anonymous channel, such as a named
|
152
|
+
Unix socket. Because other processes can access this channel, it can introduce
|
153
|
+
potential security problems. Note that passing information via program arguments
|
154
|
+
is not secure: it is possible to view that information with tools like 'ps',
|
155
|
+
or (on Linux) by reading the file `/proc/$PID/cmdline`.
|
156
|
+
|
157
|
+
So it seems 'sudo' is not a viable alternative.
|
158
|
+
|
159
|
+
Common security issues
|
160
|
+
~~~~~~~~~~~~~~~~~~~~~~
|
161
|
+
Whatever method Passenger will use, the following security principles must be
|
162
|
+
honored:
|
163
|
+
|
164
|
+
- Rails applications must never be run as root.
|
165
|
+
|
166
|
+
It might also be worthy to look into suEXEC's security model for inspiration.
|
167
|
+
|
168
|
+
Also, the following questions remain:
|
169
|
+
|
170
|
+
- Is there a need for a user whitelist/blacklist? That is, is there a need for
|
171
|
+
the ability to restrict the set of users that Passenger can switch to?
|
172
|
+
|
173
|
+
|
174
|
+
Chosen solution
|
175
|
+
---------------
|
176
|
+
Running Apache as root and writing a setuid root wrapper are the main
|
177
|
+
contestants. The former is preferred, because it's easier to implement.
|
178
|
+
|
179
|
+
We have had some conversations with people on the IRC channel #rubyonrails.
|
180
|
+
Among those people, nobody has ever run Apache as non-root. Because of this
|
181
|
+
we have chosen to implement the <<apache_root,Running Apache as root>>
|
182
|
+
solution, until a significant number of users request us to implement the
|
183
|
+
<<setuid_root,setuid root wrapper>> solution.
|
184
|
+
|
185
|
+
Please read link:rdoc/index.html[the Ruby API documentation] -- in particular
|
186
|
+
that of the 'ApplicationSpawner' class -- for implementation details. But to
|
187
|
+
make a long story short: it will switch to the owner of the file
|
188
|
+
'config/environment.rb'. User whitelisting/blacklisting is currently not
|
189
|
+
implemented. We rely on the system administrator to set the correct owner
|
190
|
+
on that file.
|
191
|
+
|
192
|
+
We have also not implemented suEXEC's security model. suEXEC's model is quite
|
193
|
+
paranoid, and although paranoia is good to a certain extend, it can be in the
|
194
|
+
way of usability while proving little extra security. We are not entirely
|
195
|
+
convinced that implementing suEXEC's full security model will provide
|
196
|
+
significant benefits, but if you have good reasons to think otherwise, please
|
197
|
+
feel free to discuss it with us.
|
@@ -0,0 +1 @@
|
|
1
|
+
asciidoc required to build docs
|
@@ -0,0 +1,2208 @@
|
|
1
|
+
Phusion Passenger users guide
|
2
|
+
=============================
|
3
|
+
|
4
|
+
image:images/phusion_banner.png[link="http://www.phusion.nl/"]
|
5
|
+
|
6
|
+
Phusion Passenger is an Apache module, which makes deploying Ruby and Ruby on
|
7
|
+
Rails applications on Apache a breeze. It follows the usual Ruby on Rails
|
8
|
+
conventions, such as "Don't-Repeat-Yourself" and ease of setup, while at the
|
9
|
+
same time providing enough flexibility.
|
10
|
+
|
11
|
+
This users guide will teach you:
|
12
|
+
|
13
|
+
- How to install Phusion Passenger.
|
14
|
+
- How to configure Phusion Passenger.
|
15
|
+
- How to deploy a Ruby on Rails application.
|
16
|
+
- How to deploy a link:http://rack.rubyforge.org/[Rack]-based Ruby application.
|
17
|
+
- How to solve common problems.
|
18
|
+
|
19
|
+
This guide assumes that the reader is somewhat familiar with Apache and with
|
20
|
+
using the commandline.
|
21
|
+
|
22
|
+
|
23
|
+
== Support information ==
|
24
|
+
|
25
|
+
=== Supported operating systems ===
|
26
|
+
|
27
|
+
Phusion Passenger works on any POSIX-compliant operating system. In other
|
28
|
+
words: practically any operating system on earth, except Microsoft Windows.
|
29
|
+
|
30
|
+
Phusion Passenger is confirmed on a large number of operating systems and Linux
|
31
|
+
distributions, including, but not limited to, Ubuntu, Debian, CentOS/Fedora/RHEL,
|
32
|
+
Gentoo, Mac OS X, FreeBSD and Solaris. Both 32-bit and 64-bit platforms are supported.
|
33
|
+
|
34
|
+
The only POSIX-compliant operating system on which Phusion Passenger for Apache is
|
35
|
+
known not to work at this time, is OpenBSD. Please use Phusion Passenger for Nginx
|
36
|
+
instead.
|
37
|
+
|
38
|
+
Please
|
39
|
+
link:http://code.google.com/p/phusion-passenger/issues/list[report a bug]
|
40
|
+
or
|
41
|
+
link:http://groups.google.com/group/phusion-passenger[join our discussion forum]
|
42
|
+
if it doesn't work on your POSIX-compliant operating system.
|
43
|
+
|
44
|
+
=== Where to get support ===
|
45
|
+
|
46
|
+
* link:http://code.google.com/p/phusion-passenger/issues/list[Issue tracker] - report
|
47
|
+
bugs here.
|
48
|
+
* link:http://groups.google.com/group/phusion-passenger[Discussion forum] - post a
|
49
|
+
message here if you're experiencing problems.
|
50
|
+
|
51
|
+
|
52
|
+
== Installing, upgrading and uninstalling Phusion Passenger ==
|
53
|
+
|
54
|
+
=== Generic installation instructions ===
|
55
|
+
|
56
|
+
[[install_passenger]]
|
57
|
+
==== Overview of installation methods ====
|
58
|
+
|
59
|
+
There are three ways to install Phusion Passenger:
|
60
|
+
|
61
|
+
1. By installing the Phusion Passenger gem, as instructed on the
|
62
|
+
link:http://www.modrails.com/install.html[``Install'' page on the Phusion
|
63
|
+
Passenger website].
|
64
|
+
2. By downloading the source tarball from the Phusion Passenger website
|
65
|
+
('passenger-x.x.x.tar.gz').
|
66
|
+
3. By installing a native Linux package (e.g. Debian package).
|
67
|
+
|
68
|
+
The following sections will explain each installation method. Please read the
|
69
|
+
section for the installation method that you prefer. In our opinion, installing
|
70
|
+
the gem or the native package is easiest. For these two installation methods,
|
71
|
+
Phusion Passenger provides an easy-to-use installer.
|
72
|
+
|
73
|
+
==== Preparation (gem and source tarball only)
|
74
|
+
If you want to install Phusion Passenger via the gem or the source tarball,
|
75
|
+
then some preparations might be required. You can skip this subsection if
|
76
|
+
you're installing Phusion Passenger via a native Linux package, because no
|
77
|
+
compilation is necessary.
|
78
|
+
|
79
|
+
===== Switching to a root command prompt =====
|
80
|
+
|
81
|
+
Before installing, you will probably need to switch to the `root` user first.
|
82
|
+
When you install Phusion Passenger via a gem or a source tarball, some Phusion
|
83
|
+
Passenger files have to be compiled, which requires write access to the
|
84
|
+
directory in which the Phusion Passenger files are located. On Unix systems,
|
85
|
+
the root user is the user who has write access to the entire system. So unless
|
86
|
+
you know that your normal user account has write access to the Phusion Passenger
|
87
|
+
directory, you should switch to root before installing Phusion Passenger.
|
88
|
+
|
89
|
+
You can switch to root by typing the following command:
|
90
|
+
|
91
|
+
-------------------------
|
92
|
+
sudo -s
|
93
|
+
-------------------------
|
94
|
+
|
95
|
+
This will open a command prompt as the root user, from which you can proceed
|
96
|
+
with installing Phusion Passenger.
|
97
|
+
|
98
|
+
If your system does not have 'sudo' installed, please type the following command instead, which should do the same thing:
|
99
|
+
|
100
|
+
-------------------------
|
101
|
+
su
|
102
|
+
-------------------------
|
103
|
+
|
104
|
+
[[specifying_correct_apache_install]]
|
105
|
+
===== Specifying the correct Apache installation =====
|
106
|
+
|
107
|
+
The Phusion Passenger installer will attempt to automatically detect Apache,
|
108
|
+
and compile Phusion Passenger against that Apache version. It does this by
|
109
|
+
looking for the `apxs` or `apxs2` command in the PATH environment variable.
|
110
|
+
Apxs is an integral part of any Apache installation.
|
111
|
+
|
112
|
+
However, some systems have multiple Apache installations. This is likely
|
113
|
+
the case on MacOS X: the OS ships with Apache, but users tend to install
|
114
|
+
another Apache version seperately, e.g. via MacPorts. If your system has
|
115
|
+
multiple Apache installations, then you will need to tell the Phusion Passenger
|
116
|
+
installer which one to use. It is very important that you specify the
|
117
|
+
correct Apache installation, because if you load Phusion Passenger in an
|
118
|
+
Apache installation that it wasn't compiled against, then it will likely
|
119
|
+
crash.
|
120
|
+
|
121
|
+
On yet other systems, Apache is installed in a non-standard location,
|
122
|
+
preventing the Phusion Passenger installer from detecting Apache. This
|
123
|
+
is most likely the case on systems on which Apache was installed by hand
|
124
|
+
from source, i.e. as opposed to installed through the system's native
|
125
|
+
package manager. If this is the case, then you will also have to tell
|
126
|
+
the installer where it can find Apache.
|
127
|
+
|
128
|
+
To do so, set the `APXS2` environment variable to the full path of the
|
129
|
+
correct `apxs` or `apxs2` command. Suppose that you want to use the Apache
|
130
|
+
installation in '/opt/apache2'. Then, assuming that the corresponding
|
131
|
+
`apxs` program's path is '/opt/apache2/bin/apxs', type:
|
132
|
+
|
133
|
+
----------------------------------
|
134
|
+
export APXS2=/opt/apache2/bin/apxs
|
135
|
+
----------------------------------
|
136
|
+
|
137
|
+
NOTE: On some systems, the `apxs` program might be called `apxs2`, and it might
|
138
|
+
be located in the `sbin` folder instead of the `bin` folder.
|
139
|
+
|
140
|
+
.Environment variables and 'sudo'
|
141
|
+
NOTE: By default, the 'sudo' command will erase any environment variables that it
|
142
|
+
doesn't recognize, prior to executing the given command. So if you set APXS2 as a
|
143
|
+
normal user, then run `sudo passenger-install-apache2-module` (which is the command
|
144
|
+
for the Phusion Passenger installer), then the installer will not receive the
|
145
|
+
environment variable value that you set. To solve this problem, please become root
|
146
|
+
prior to setting any environment variables, as described in the previous subsection.
|
147
|
+
|
148
|
+
[[specifying_ruby_installation]]
|
149
|
+
===== Specifying the correct Ruby installation =====
|
150
|
+
|
151
|
+
If your system has multiple Ruby installations -- which is likely the case on
|
152
|
+
MacOS X, or if you've also installed
|
153
|
+
link:http://www.rubyenterpriseedition.com[Ruby Enterprise Edition] -- then you
|
154
|
+
will need to tell the operating system which Ruby installation to use, prior to
|
155
|
+
running the Phusion Passenger installer. If you only have one Ruby installation
|
156
|
+
(the case on most Linux systems), then you can skip this section because Phusion
|
157
|
+
Passenger will automatically detect it.
|
158
|
+
|
159
|
+
To specify a Ruby installation, prepend your Ruby installation's `bin`
|
160
|
+
directory to the `PATH` environment variable. For example, if you have the
|
161
|
+
following Ruby installations:
|
162
|
+
|
163
|
+
- /usr/bin/ruby
|
164
|
+
- /opt/myruby/bin/ruby
|
165
|
+
|
166
|
+
and you want to use the latter, then type:
|
167
|
+
|
168
|
+
----------------------------------
|
169
|
+
export PATH=/opt/myruby/bin:$PATH
|
170
|
+
----------------------------------
|
171
|
+
|
172
|
+
|
173
|
+
==== Installing via the gem ====
|
174
|
+
|
175
|
+
Please install the gem and then run the Phusion Passenger installer, by typing the
|
176
|
+
following commands:
|
177
|
+
------------------------------------------------------
|
178
|
+
gem install passenger-x.x.x.gem
|
179
|
+
passenger-install-apache2-module
|
180
|
+
------------------------------------------------------
|
181
|
+
Please follow the instructions given by the installer.
|
182
|
+
|
183
|
+
|
184
|
+
==== Installing via the source tarball ====
|
185
|
+
|
186
|
+
Extract the tarball to whatever location you prefer. *The Phusion Passenger files
|
187
|
+
are to reside in that location permanently.* For example, if you would like
|
188
|
+
Phusion Passenger to reside in `/opt/passenger-x.x.x`:
|
189
|
+
------------------------------------------------------
|
190
|
+
cd /opt
|
191
|
+
tar xzvf ~/YourDownloadsFolder/passenger-x.x.x.tar.gz
|
192
|
+
------------------------------------------------------
|
193
|
+
|
194
|
+
Next, run the included installer:
|
195
|
+
------------------------------------------------------
|
196
|
+
/opt/passenger-x.x.x/bin/passenger-install-apache2-module
|
197
|
+
------------------------------------------------------
|
198
|
+
Please follow the instructions given by the installer.
|
199
|
+
|
200
|
+
IMPORTANT: Please do not remove the 'passenger-x.x.x' folder after
|
201
|
+
installation. Furthermore, the 'passenger-x.x.x' folder must be accessible by Apache.
|
202
|
+
|
203
|
+
|
204
|
+
==== Installing via a native Linux package ====
|
205
|
+
|
206
|
+
John Leach from Brightbox has kindly provided an Ubuntu Hardy package for Phusion Passenger. The package is available from the link:http://apt.brightbox.net[Brightbox repository].
|
207
|
+
|
208
|
+
Please install the native Linux package, e.g.:
|
209
|
+
------------------------------------------------------
|
210
|
+
sudo sh -c 'echo "deb http://apt.brightbox.net hardy main" > /etc/apt/sources.list.d/brightbox.list'
|
211
|
+
sudo sh -c 'wget -q -O - http://apt.brightbox.net/release.asc | apt-key add -'
|
212
|
+
sudo apt-get update
|
213
|
+
sudo apt-get install libapache2-mod-passenger
|
214
|
+
------------------------------------------------------
|
215
|
+
|
216
|
+
==== What does the installer do? ====
|
217
|
+
|
218
|
+
Although we call it an ``installer'', it doesn't actually install anything.
|
219
|
+
The installer checks whether all required dependencies are installed,
|
220
|
+
compiles Phusion Passenger for you, and tells you how to modify the Apache
|
221
|
+
configuration file, but it doesn't copy any files around.
|
222
|
+
|
223
|
+
`passenger-install-apache2-module` is actually just a user-friendly frontend
|
224
|
+
around the command `rake apache2`, which performs the actual compilation of
|
225
|
+
Phusion Passenger.
|
226
|
+
|
227
|
+
|
228
|
+
=== Operating system-specific instructions and information ===
|
229
|
+
|
230
|
+
==== MacOS X ====
|
231
|
+
|
232
|
+
Ben Ruebenstein has written an excellent
|
233
|
+
link:http://benr75.com/articles/2008/04/12/setup-mod_rails-phusion-mac-os-x-leopard[tutorial
|
234
|
+
on installing Phusion Passenger on OS X].
|
235
|
+
|
236
|
+
==== Ubuntu Linux ====
|
237
|
+
|
238
|
+
Ben Hughes has written an link:http://www.railsgarden.com/2008/04/12/configurating-passenger-mod_rails-on-slicehost-with-ubuntu-710/[article on installing Phusion Passenger on Ubuntu].
|
239
|
+
|
240
|
+
==== OpenSolaris ====
|
241
|
+
|
242
|
+
J Aaron Farr has written a link:http://cubiclemuses.com/cm/articles/2009/04/09/rails-passenger-open-solaris-ec2/[guide]
|
243
|
+
about setting up Ruby on Rails and Phusion Passenger on OpenSolaris and EC2.
|
244
|
+
|
245
|
+
|
246
|
+
=== Upgrading or downgrading Phusion Passenger ===
|
247
|
+
|
248
|
+
==== Via a gem or a source tarball ====
|
249
|
+
|
250
|
+
To ugrade or downgrade Phusion Passenger via the gem or the source tarball, install the newer
|
251
|
+
or older version as you normally would; that is, install the gem or unpack the tarball, and
|
252
|
+
run `passenger-install-apache2-module`. Eventually `passenger-install-apache2-module` will tell
|
253
|
+
you to copy & paste some settings into the Apache configuration file; something that looks along
|
254
|
+
the lines of:
|
255
|
+
|
256
|
+
-----------------------------------
|
257
|
+
LoadModule passenger_module ...
|
258
|
+
PassengerRoot ...
|
259
|
+
PassengerRuby ...
|
260
|
+
-----------------------------------
|
261
|
+
|
262
|
+
Because you already had Phusion Passenger installed, you already had similar settings
|
263
|
+
in your Apache configuration file, just with different values. *Replace* the old settings with
|
264
|
+
the new ones that the installer outputs. It is important that the old settings are removed,
|
265
|
+
otherwise Phusion Passenger may malfunction.
|
266
|
+
|
267
|
+
When you're done, restart Apache.
|
268
|
+
|
269
|
+
==== Via a native Linux package
|
270
|
+
|
271
|
+
There are no special instructions required to upgrade or downgrade Phusion Passenger
|
272
|
+
via a native Linux package.
|
273
|
+
|
274
|
+
=== Unloading (disabling) Phusion Passenger from Apache without uninstalling it ===
|
275
|
+
|
276
|
+
You can temporarily unload (disable) Phusion Passenger from Apache, without
|
277
|
+
uninstalling the Phusion Passenger files, so that Apache behaves as if Phusion
|
278
|
+
Passenger was never installed in the first place. This might be useful to you if,
|
279
|
+
for example, you seem to be experiencing a problem caused by Phusion Passenger,
|
280
|
+
but you want to make sure whether that's actually the case, without having
|
281
|
+
to through the hassle of uninstalling Phusion Passenger completely. When disabled,
|
282
|
+
Phusion Passenger will not occupy any memory or CPU or otherwise interfere with
|
283
|
+
Apache.
|
284
|
+
|
285
|
+
To unload Phusion Passenger from Apache, edit your Apache configuration file(s)
|
286
|
+
and comment out:
|
287
|
+
|
288
|
+
- all Phusion Passenger configuration directives.
|
289
|
+
- the 'LoadModule passenger_module' directive.
|
290
|
+
|
291
|
+
For example, if your configuration file looks like this...
|
292
|
+
|
293
|
+
-----------------------------------
|
294
|
+
Listen *:80
|
295
|
+
NameVirtualHosts *:80
|
296
|
+
....
|
297
|
+
|
298
|
+
LoadModule passenger_module /somewhere/passenger-x.x.x/ext/apache2/mod_passenger.so
|
299
|
+
|
300
|
+
PassengerRuby /usr/bin/ruby
|
301
|
+
PassengerRoot /somewhere/passenger/x.x.x
|
302
|
+
PassengerMaxPoolSize 10
|
303
|
+
|
304
|
+
<VirtualHost *:80>
|
305
|
+
ServerName www.foo.com
|
306
|
+
DocumentRoot /webapps/foo/public
|
307
|
+
RailsBaseURI /rails
|
308
|
+
</VirtualHost>
|
309
|
+
-----------------------------------
|
310
|
+
|
311
|
+
...then comment out the relevant directives, so that it looks like this:
|
312
|
+
|
313
|
+
-----------------------------------
|
314
|
+
Listen *:80
|
315
|
+
NameVirtualHosts *:80
|
316
|
+
....
|
317
|
+
|
318
|
+
# LoadModule passenger_module /somewhere/passenger-x.x.x/ext/apache2/mod_passenger.so
|
319
|
+
|
320
|
+
# PassengerRuby /usr/bin/ruby
|
321
|
+
# PassengerRoot /somewhere/passenger/x.x.x
|
322
|
+
# PassengerMaxPoolSize 10
|
323
|
+
|
324
|
+
<VirtualHost *:80>
|
325
|
+
ServerName www.foo.com
|
326
|
+
DocumentRoot /webapps/foo/public
|
327
|
+
# RailsBaseURI /rails
|
328
|
+
</VirtualHost>
|
329
|
+
-----------------------------------
|
330
|
+
|
331
|
+
After you've done this, save the file and restart Apache.
|
332
|
+
|
333
|
+
=== Uninstalling Phusion Passenger ===
|
334
|
+
|
335
|
+
To uninstall Phusion Passenger, please first remove all Phusion Passenger
|
336
|
+
configuration directives from your Apache configuration file(s). After you've
|
337
|
+
done this, you need to remove the Phusion Passenger files.
|
338
|
+
|
339
|
+
- If you installed Phusion Passenger via a gem, then type `gem uninstall passenger`.
|
340
|
+
You might have to run this as root.
|
341
|
+
- If you installed Phusion Passenger via a source tarball, then remove the directory
|
342
|
+
in which you placed the extracted Phusion Passenger files. This directory is the
|
343
|
+
same as the one pointed to the by 'PassengerRoot' configuration directive.
|
344
|
+
- If you installed Phusion Passenger via a Debian package, then remove type
|
345
|
+
`sudo apt-get remove libapache2-mod-passenger`.
|
346
|
+
|
347
|
+
|
348
|
+
== Deploying a Ruby on Rails application ==
|
349
|
+
|
350
|
+
Suppose you have a Ruby on Rails application in '/webapps/mycook', and you own
|
351
|
+
the domain 'www.mycook.com'. You can either deploy your application to the
|
352
|
+
virtual host's root (i.e. the application will be accessible from the root URL,
|
353
|
+
'http://www.mycook.com/'), or in a sub URI (i.e. the application will be
|
354
|
+
accessible from a sub URL, such as 'http://www.mycook.com/railsapplication').
|
355
|
+
|
356
|
+
NOTE: The default `RAILS_ENV` environment in which deployed Rails applications
|
357
|
+
are run, is ``production''. You can change this by changing the
|
358
|
+
<<rails_env,'RailsEnv'>> configuration option.
|
359
|
+
|
360
|
+
=== Deploying to a virtual host's root ===
|
361
|
+
|
362
|
+
Add a virtual host entry to your Apache configuration file. Make sure that the
|
363
|
+
following conditions are met:
|
364
|
+
|
365
|
+
- The virtual host's document root must point to your Ruby on Rails application's
|
366
|
+
'public' folder.
|
367
|
+
- The Apache per-directory permissions must allow access to this folder.
|
368
|
+
- MultiViews must be disabled for this folder.
|
369
|
+
|
370
|
+
For example:
|
371
|
+
-------------------------------------------
|
372
|
+
<VirtualHost *:80>
|
373
|
+
ServerName www.mycook.com
|
374
|
+
DocumentRoot /webapps/mycook/public
|
375
|
+
<Directory /webapps/mycook/public>
|
376
|
+
Allow from all
|
377
|
+
Options -MultiViews
|
378
|
+
</Directory>
|
379
|
+
</VirtualHost>
|
380
|
+
-------------------------------------------
|
381
|
+
|
382
|
+
You may also need to tweak your file/folder permissions. Make sure that the
|
383
|
+
following folders are readable and executable by Apache:
|
384
|
+
|
385
|
+
* this 'public' folder.
|
386
|
+
* the application's 'config' folder.
|
387
|
+
* all parent folders. That is, /webapps/mycook and /webapps must also be readable and executable by Apache.
|
388
|
+
|
389
|
+
Then restart Apache. The application has now been deployed.
|
390
|
+
|
391
|
+
[[deploying_rails_to_sub_uri]]
|
392
|
+
=== Deploying to a sub URI ===
|
393
|
+
|
394
|
+
Suppose that you already have a virtual host:
|
395
|
+
|
396
|
+
-------------------------------------------
|
397
|
+
<VirtualHost *:80>
|
398
|
+
ServerName www.phusion.nl
|
399
|
+
DocumentRoot /websites/phusion
|
400
|
+
<Directory /websites/phusion>
|
401
|
+
Allow from all
|
402
|
+
</Directory>
|
403
|
+
</VirtualHost>
|
404
|
+
-------------------------------------------
|
405
|
+
|
406
|
+
And you want your Ruby on Rails application to be accessible from the URL
|
407
|
+
'http://www.phusion.nl/rails'.
|
408
|
+
|
409
|
+
To do this, make a symlink in the virtual host's document root, and have it
|
410
|
+
point to your Ruby on Rails application's 'public' folder. For example:
|
411
|
+
-------------------------------------------
|
412
|
+
ln -s /webapps/mycook/public /websites/phusion/rails
|
413
|
+
-------------------------------------------
|
414
|
+
|
415
|
+
Next, add a <<RailsBaseURI,RailsBaseURI>> option to the virtual host configuration,
|
416
|
+
and also make sure that:
|
417
|
+
|
418
|
+
- The Apache per-directory permissions allow access to this folder.
|
419
|
+
- MultiViews is disabled for this folder.
|
420
|
+
|
421
|
+
For example:
|
422
|
+
-------------------------------------------
|
423
|
+
<VirtualHost *:80>
|
424
|
+
ServerName www.phusion.nl
|
425
|
+
DocumentRoot /websites/phusion
|
426
|
+
<Directory /websites/phusion>
|
427
|
+
Allow from all
|
428
|
+
</Directory>
|
429
|
+
|
430
|
+
RailsBaseURI /rails # <-- These lines have
|
431
|
+
<Directory /websites/phusion/rails> # <-- been added.
|
432
|
+
Options -MultiViews # <--
|
433
|
+
</Directory> # <--
|
434
|
+
</VirtualHost>
|
435
|
+
-------------------------------------------
|
436
|
+
Then restart Apache. The application has now been deployed.
|
437
|
+
|
438
|
+
NOTE: If you're deploying to a sub-URI then please make sure that your view
|
439
|
+
templates correctly handles references to sub-URI static assets! Otherwise
|
440
|
+
you may find broken links to images, CSS files, JavaScripts, etc. Please read
|
441
|
+
<<sub_uri_deployment_uri_fix,How to fix broken images/CSS/JavaScript URIs in sub-URI deployments>>
|
442
|
+
for more information.
|
443
|
+
|
444
|
+
[TIP]
|
445
|
+
======================================
|
446
|
+
You can deploy multiple Rails applications under a virtual host, by specifying
|
447
|
+
<<RailsBaseURI,RailsBaseURI>> multiple times. For example:
|
448
|
+
---------------------------------
|
449
|
+
<VirtualHost *:80>
|
450
|
+
....
|
451
|
+
RailsBaseURI /app1
|
452
|
+
RailsBaseURI /app2
|
453
|
+
RailsBaseURI /app3
|
454
|
+
</VirtualHost>
|
455
|
+
---------------------------------
|
456
|
+
======================================
|
457
|
+
|
458
|
+
=== Redeploying (restarting the Ruby on Rails application) ===
|
459
|
+
|
460
|
+
Deploying a new version of a Ruby on Rails application is as simple as
|
461
|
+
re-uploading the application files, and restarting the application.
|
462
|
+
|
463
|
+
There are two ways to restart the application:
|
464
|
+
|
465
|
+
1. By restarting Apache.
|
466
|
+
2. By creating or modifying the file 'tmp/restart.txt' in the Rails
|
467
|
+
application's <<application_root,root folder>>. Phusion Passenger will
|
468
|
+
automatically restart the application during the next request.
|
469
|
+
|
470
|
+
For example, to restart our example MyCook application, we type this in the
|
471
|
+
command line:
|
472
|
+
-------------------------------------------
|
473
|
+
touch /webapps/mycook/tmp/restart.txt
|
474
|
+
-------------------------------------------
|
475
|
+
|
476
|
+
Please note that, unlike earlier versions of Phusion Passenger, 'restart.txt'
|
477
|
+
is not automatically deleted. Phusion Passenger checks whether the timestamp
|
478
|
+
of this file has changed in order to determine whether the application should
|
479
|
+
be restarted.
|
480
|
+
|
481
|
+
=== Migrations ===
|
482
|
+
|
483
|
+
Phusion Passenger is not related to Ruby on Rails migrations in any way. To
|
484
|
+
run migrations on your deployment server, please login to your deployment
|
485
|
+
server (e.g. with 'ssh') and type `rake db:migrate RAILS_ENV=production` in
|
486
|
+
a shell console, just like one would normally run migrations.
|
487
|
+
|
488
|
+
=== Capistrano integration ===
|
489
|
+
|
490
|
+
See <<capistrano,Capistrano recipe>>.
|
491
|
+
|
492
|
+
|
493
|
+
== Deploying a Rack-based Ruby application ==
|
494
|
+
|
495
|
+
Phusion Passenger supports arbitrary Ruby web applications that follow the
|
496
|
+
link:http://rack.rubyforge.org/[Rack] interface.
|
497
|
+
|
498
|
+
Phusion Passenger assumes that Rack application directories have a certain layout.
|
499
|
+
Suppose that you have a Rack application in '/webapps/rackapp'. Then that
|
500
|
+
folder must contain at least three entries:
|
501
|
+
|
502
|
+
- 'config.ru', a Rackup file for starting the Rack application. This file must contain
|
503
|
+
the complete logic for initializing the application.
|
504
|
+
- 'public/', a folder containing public static web assets, like images and stylesheets.
|
505
|
+
- 'tmp/', used for 'restart.txt' (our application restart mechanism). This will
|
506
|
+
be explained in a following subsection.
|
507
|
+
|
508
|
+
So '/webapps/rackapp' must, at minimum, look like this:
|
509
|
+
----------------------
|
510
|
+
/webapps/rackapp
|
511
|
+
|
|
512
|
+
+-- config.ru
|
513
|
+
|
|
514
|
+
+-- public/
|
515
|
+
|
|
516
|
+
+-- tmp/
|
517
|
+
----------------------
|
518
|
+
|
519
|
+
Suppose you own the domain 'www.rackapp.com'. You can either deploy your application
|
520
|
+
to the virtual host's root (i.e. the application will be accessible from the root URL,
|
521
|
+
'http://www.rackapp.com/'), or in a sub URI (i.e. the application will be
|
522
|
+
accessible from a sub URL, such as 'http://www.rackapp.com/rackapp').
|
523
|
+
|
524
|
+
NOTE: The default `RACK_ENV` environment in which deployed Rack applications
|
525
|
+
are run, is ``production''. You can change this by changing the
|
526
|
+
<<rack_env,'RackEnv'>> configuration option.
|
527
|
+
|
528
|
+
=== Tutorial/example: writing and deploying a Hello World Rack application ===
|
529
|
+
|
530
|
+
First we create a Phusion Passenger-compliant Rack directory structure:
|
531
|
+
|
532
|
+
-------------------------------------------
|
533
|
+
$ mkdir /webapps/rack_example
|
534
|
+
$ mkdir /webapps/rack_example/public
|
535
|
+
$ mkdir /webapps/rack_example/tmp
|
536
|
+
-------------------------------------------
|
537
|
+
|
538
|
+
Next, we write a minimal "hello world" Rack application:
|
539
|
+
|
540
|
+
-------------------------------------------
|
541
|
+
$ cd /webapps/rack_example
|
542
|
+
$ some_awesome_editor config.ru
|
543
|
+
...type in some source code...
|
544
|
+
$ cat config.ru
|
545
|
+
app = proc do |env|
|
546
|
+
[200, { "Content-Type" => "text/html" }, ["hello <b>world</b>"]]
|
547
|
+
end
|
548
|
+
run app
|
549
|
+
-------------------------------------------
|
550
|
+
|
551
|
+
Finally, we deploy it by adding the following configuration options to
|
552
|
+
the Apache configuration file:
|
553
|
+
|
554
|
+
-------------------------------------------
|
555
|
+
<VirtualHost *:80>
|
556
|
+
ServerName www.rackexample.com
|
557
|
+
DocumentRoot /webapps/rack_example/public
|
558
|
+
<Directory /webapps/rack_example/public>
|
559
|
+
Allow from all
|
560
|
+
Options -MultiViews
|
561
|
+
</Directory>
|
562
|
+
</VirtualHost>
|
563
|
+
-------------------------------------------
|
564
|
+
|
565
|
+
And we're done! After an Apache restart, the above Rack application will be available
|
566
|
+
under the URL 'http://www.rackexample.com/'.
|
567
|
+
|
568
|
+
=== Deploying to a virtual host's root ===
|
569
|
+
|
570
|
+
Add a virtual host entry to your Apache configuration file. Make sure that the
|
571
|
+
following conditions are met:
|
572
|
+
|
573
|
+
- The virtual host's document root must point to your Rack application's
|
574
|
+
'public' folder.
|
575
|
+
- The Apache per-directory permissions must allow access to this folder.
|
576
|
+
- MultiViews must be disabled for this folder.
|
577
|
+
|
578
|
+
For example:
|
579
|
+
-------------------------------------------
|
580
|
+
<VirtualHost *:80>
|
581
|
+
ServerName www.rackapp.com
|
582
|
+
DocumentRoot /webapps/rackapp/public
|
583
|
+
<Directory /webapps/rackapp/public>
|
584
|
+
Allow from all
|
585
|
+
Options -MultiViews
|
586
|
+
</Directory>
|
587
|
+
</VirtualHost>
|
588
|
+
-------------------------------------------
|
589
|
+
|
590
|
+
You may also need to tweak your file/folder permissions. Make sure that the
|
591
|
+
following folders are readable and executable by Apache:
|
592
|
+
|
593
|
+
* this 'public' folder.
|
594
|
+
* the application's 'config' folder.
|
595
|
+
* all parent folders. That is, /webapps/rackapp and /webapps must also be readable and executable by Apache.
|
596
|
+
|
597
|
+
Then restart Apache. The application has now been deployed.
|
598
|
+
|
599
|
+
[[deploying_rack_to_sub_uri]]
|
600
|
+
=== Deploying to a sub URI ===
|
601
|
+
|
602
|
+
Suppose that you already have a virtual host:
|
603
|
+
|
604
|
+
-------------------------------------------
|
605
|
+
<VirtualHost *:80>
|
606
|
+
ServerName www.phusion.nl
|
607
|
+
DocumentRoot /websites/phusion
|
608
|
+
<Directory /websites/phusion>
|
609
|
+
Allow from all
|
610
|
+
</Directory>
|
611
|
+
</VirtualHost>
|
612
|
+
-------------------------------------------
|
613
|
+
|
614
|
+
And you want your Rack application to be accessible from the URL
|
615
|
+
'http://www.phusion.nl/rack'.
|
616
|
+
|
617
|
+
To do this, make a symlink in the virtual host's document root, and have it
|
618
|
+
point to your Rack application's 'public' folder. For example:
|
619
|
+
-------------------------------------------
|
620
|
+
ln -s /webapps/rackapp/public /websites/phusion/rack
|
621
|
+
-------------------------------------------
|
622
|
+
|
623
|
+
Next, add a <<RackBaseURI,RackBaseURI>> option to the virtual host configuration,
|
624
|
+
and also make sure that:
|
625
|
+
|
626
|
+
- The Apache per-directory permissions allow access to this folder.
|
627
|
+
- MultiViews is disabled for this folder.
|
628
|
+
|
629
|
+
For example:
|
630
|
+
-------------------------------------------
|
631
|
+
<VirtualHost *:80>
|
632
|
+
ServerName www.phusion.nl
|
633
|
+
DocumentRoot /websites/phusion
|
634
|
+
<Directory /websites/phusion>
|
635
|
+
Allow from all
|
636
|
+
</Directory>
|
637
|
+
|
638
|
+
RackBaseURI /rails # <-- These lines have
|
639
|
+
<Directory /websites/phusion/rails> # <-- been added.
|
640
|
+
Options -MultiViews # <--
|
641
|
+
</Directory> # <--
|
642
|
+
</VirtualHost>
|
643
|
+
-------------------------------------------
|
644
|
+
Then restart Apache. The application has now been deployed.
|
645
|
+
|
646
|
+
[TIP]
|
647
|
+
======================================
|
648
|
+
You can deploy multiple Rack applications under a virtual host, by specifying
|
649
|
+
<<RackBaseURI,RackBaseURI>> multiple times. For example:
|
650
|
+
---------------------------------
|
651
|
+
<VirtualHost *:80>
|
652
|
+
....
|
653
|
+
RackBaseURI /app1
|
654
|
+
RackBaseURI /app2
|
655
|
+
RackBaseURI /app3
|
656
|
+
</VirtualHost>
|
657
|
+
---------------------------------
|
658
|
+
======================================
|
659
|
+
|
660
|
+
=== Redeploying (restarting the Rack application) ===
|
661
|
+
|
662
|
+
Deploying a new version of a Rack application is as simple as
|
663
|
+
re-uploading the application files, and restarting the application.
|
664
|
+
|
665
|
+
There are two ways to restart the application:
|
666
|
+
|
667
|
+
1. By restarting Apache.
|
668
|
+
2. By creating or modifying the file 'tmp/restart.txt' in the Rack
|
669
|
+
application's <<application_root,root folder>>. Phusion Passenger will
|
670
|
+
automatically restart the application.
|
671
|
+
|
672
|
+
For example, to restart our example application, we type this in the
|
673
|
+
command line:
|
674
|
+
-------------------------------------------
|
675
|
+
touch /webapps/rackapp/tmp/restart.txt
|
676
|
+
-------------------------------------------
|
677
|
+
|
678
|
+
=== Rackup specifications for various web frameworks ===
|
679
|
+
include::users_guide_snippets/rackup_specifications.txt[]
|
680
|
+
|
681
|
+
|
682
|
+
== Configuring Phusion Passenger ==
|
683
|
+
|
684
|
+
After installation, Phusion Passenger does not need any further configurations.
|
685
|
+
Nevertheless, the system administrator may be interested in changing
|
686
|
+
Phusion Passenger's behavior. Phusion Passenger's Apache module supports the
|
687
|
+
following configuration options:
|
688
|
+
|
689
|
+
=== PassengerRoot <directory> ===
|
690
|
+
The location to the Phusion Passenger root directory. This configuration option
|
691
|
+
is essential to Phusion Passenger, and allows Phusion Passenger to locate its own
|
692
|
+
data files. The correct value is given by the installer.
|
693
|
+
|
694
|
+
If you've moved Phusion Passenger to a different directory then you need to update
|
695
|
+
this option as well. Please read
|
696
|
+
<<moving_phusion_passenger,Moving Phusion Passenger to a different directory>> for more information.
|
697
|
+
|
698
|
+
This required option may only occur once, in the global server configuration.
|
699
|
+
|
700
|
+
[[PassengerRuby]]
|
701
|
+
=== PassengerRuby <filename> ===
|
702
|
+
This option allows one to specify the Ruby interpreter to use.
|
703
|
+
|
704
|
+
This option may only occur once, in the global server configuration.
|
705
|
+
The default is 'ruby'.
|
706
|
+
|
707
|
+
[[PassengerAppRoot]]
|
708
|
+
=== PassengerAppRoot <path/to/root> ===
|
709
|
+
By default, Phusion Passenger assumes that the application's root directory
|
710
|
+
is the parent directory of the 'public' directory. This option allows one to
|
711
|
+
specify the application's root independently from the DocumentRoot, which
|
712
|
+
is useful if the 'public' directory lives in a non-standard place.
|
713
|
+
|
714
|
+
This option may occur in the following places:
|
715
|
+
|
716
|
+
* In the global server configuration.
|
717
|
+
* In a virtual host configuration block.
|
718
|
+
* In a `<Directory>` or `<Location>` block.
|
719
|
+
* In '.htaccess', if `AllowOverride Options` is on.
|
720
|
+
|
721
|
+
In each place, it may be specified at most once.
|
722
|
+
|
723
|
+
Example:
|
724
|
+
|
725
|
+
-----------------------------
|
726
|
+
<VirtualHost test.host>
|
727
|
+
DocumentRoot /var/rails/zena/sites/example.com/public
|
728
|
+
PassengerAppRoot /var/rails/zena # <-- normally Phusion Passenger would
|
729
|
+
# have assumed that the application
|
730
|
+
# root is "/var/rails/zena/sites/example.com"
|
731
|
+
</VirtualHost>
|
732
|
+
-----------------------------
|
733
|
+
|
734
|
+
[[PassengerSpawnMethod]]
|
735
|
+
=== PassengerSpawnMethod <string> ===
|
736
|
+
[TIP]
|
737
|
+
."What spawn method should I use?"
|
738
|
+
=========================================================
|
739
|
+
This subsection attempts to describe spawn methods, but it's okay if you don't (want to)
|
740
|
+
understand it, as it's mostly a technical detail. You can basically follow this rule of thumb:
|
741
|
+
|
742
|
+
************************************************
|
743
|
+
If your application works on Mongrel, but not on Phusion Passenger, then set
|
744
|
+
`PassengerSpawnMethod` to 'conservative'. Otherwise, leave it at 'smart-lv2' (the default).
|
745
|
+
************************************************
|
746
|
+
|
747
|
+
However, we do recommend you to try to understand it. The 'smart' and 'smart-lv2' spawn
|
748
|
+
methods bring many benefits.
|
749
|
+
=========================================================
|
750
|
+
|
751
|
+
include::users_guide_snippets/passenger_spawn_method.txt[]
|
752
|
+
|
753
|
+
This option may occur in the following places:
|
754
|
+
|
755
|
+
* In the global server configuration.
|
756
|
+
* In a virtual host configuration block.
|
757
|
+
|
758
|
+
In each place, it may be specified at most once. The default value is 'smart-lv2'.
|
759
|
+
|
760
|
+
[[PassengerUseGlobalQueue]]
|
761
|
+
=== PassengerUseGlobalQueue <on|off> ===
|
762
|
+
Turns the use of global queuing on or off.
|
763
|
+
|
764
|
+
This option may occur in the following places:
|
765
|
+
|
766
|
+
* In the global server configuration.
|
767
|
+
* In a virtual host configuration block.
|
768
|
+
|
769
|
+
In each place, it may be specified at most once. The default value is 'on'.
|
770
|
+
|
771
|
+
'This feature is sponsored by http://www.37signals.com/[37signals].'
|
772
|
+
|
773
|
+
include::users_guide_snippets/global_queueing_explained.txt[]
|
774
|
+
|
775
|
+
|
776
|
+
=== PassengerEnabled <on|off> ===
|
777
|
+
You can set this option to 'off' to completely disable Phusion Passenger for
|
778
|
+
a certain location. This is useful if, for example, you want to integrate a PHP
|
779
|
+
application into the same virtual host as a Rails application.
|
780
|
+
|
781
|
+
Suppose that you have a Rails application in '/apps/foo'. Suppose that you've
|
782
|
+
dropped Wordpress -- a blogging application written in PHP -- in
|
783
|
+
'/apps/foo/public/wordpress'. You can then configure Phusion Passenger as
|
784
|
+
follows:
|
785
|
+
|
786
|
+
------------------------------------
|
787
|
+
<VirtualHost *:80>
|
788
|
+
ServerName www.foo.com
|
789
|
+
DocumentRoot /apps/foo/public
|
790
|
+
<Directory /apps/foo/public/wordpress>
|
791
|
+
PassengerEnabled off
|
792
|
+
AllowOverride all # <-- Makes Wordpress's .htaccess file work.
|
793
|
+
</Directory>
|
794
|
+
</VirtualHost>
|
795
|
+
------------------------------------
|
796
|
+
|
797
|
+
This way, Phusion Passenger will not interfere with Wordpress.
|
798
|
+
|
799
|
+
'PassengerEnabled' may occur in the following places:
|
800
|
+
|
801
|
+
* In the global server configuration.
|
802
|
+
* In a virtual host configuration block.
|
803
|
+
* In a `<Directory>` or `<Location>` block.
|
804
|
+
* In '.htaccess'.
|
805
|
+
|
806
|
+
In each place, it may be specified at most once. The default value is 'on'.
|
807
|
+
|
808
|
+
[[PassengerTempDir]]
|
809
|
+
=== PassengerTempDir <directory> ===
|
810
|
+
Specifies the directory that Phusion Passenger should use for storing temporary
|
811
|
+
files. This includes things such as Unix socket files, buffered file uploads
|
812
|
+
(see also <<PassengerUploadBufferDir,PassengerUploadBufferDir>>), etc.
|
813
|
+
|
814
|
+
This option may be specified once, in the global server configuration. The
|
815
|
+
default temp directory that Phusion Passenger uses is '/tmp'.
|
816
|
+
|
817
|
+
This option is especially useful if Apache is not allowed to write to /tmp
|
818
|
+
(which is the case on some systems with strict SELinux policies) or if the
|
819
|
+
partition that /tmp lives on doesn't have enough disk space.
|
820
|
+
|
821
|
+
.Command line tools
|
822
|
+
Some Phusion Passenger command line administration tools, such as
|
823
|
+
`passenger-status`, must know what Phusion Passenger's temp directory is
|
824
|
+
in order to function properly. You can pass the directory through the
|
825
|
+
`PASSENGER_TMPDIR` environment variable, or the `TMPDIR` environment variable
|
826
|
+
(the former will be used if both are specified).
|
827
|
+
|
828
|
+
For example, if you set 'PassengerTempDir' to '/my_temp_dir', then invoke
|
829
|
+
`passenger-status` after you've set the `PASSENGER_TMPDIR` or `TMPDIR`
|
830
|
+
environment variable, like this:
|
831
|
+
|
832
|
+
----------------------------------------------------------
|
833
|
+
export PASSENGER_TMPDIR=/my_temp-dir
|
834
|
+
sudo -E passenger-status
|
835
|
+
# The -E option tells 'sudo' to preserve environment variables.
|
836
|
+
----------------------------------------------------------
|
837
|
+
|
838
|
+
[[PassengerUploadBufferDir]]
|
839
|
+
=== PassengerUploadBufferDir <directory> ===
|
840
|
+
Phusion Passenger buffers large file uploads to disk in order prevent slow file
|
841
|
+
uploads from blocking web applications. By default, a subdirectory in the
|
842
|
+
system's temporary files directory (or a subdirectory in the directory specified
|
843
|
+
in <<PassengerTempDir,PassengerTempDir>>, if set) is automatically created for
|
844
|
+
storing these buffered file uploads.
|
845
|
+
|
846
|
+
This configuration directive allows you to specify a different directory for storing
|
847
|
+
buffered file uploads. If you've specified such a directory (as opposed to using
|
848
|
+
Phusion Passenger's default) then you *must* ensure that this directory exists.
|
849
|
+
|
850
|
+
This configuration directive is also useful if you're using apache2-mpm-itk.
|
851
|
+
The buffered file upload directory that Phusion Passenger creates by default has
|
852
|
+
very strict permissions: it can only be accessed by the Apache worker processes.
|
853
|
+
However, Phusion Passenger assumes that all Apache worker processes are running
|
854
|
+
as the same user. apache2-mpm-itk breaks this assumption by running multiple
|
855
|
+
Apache worker processes as different users. So if you're using apace2-mpm-itk,
|
856
|
+
you should set this option to a directory that is writable by all Apache worker
|
857
|
+
processes, such as '/tmp'.
|
858
|
+
|
859
|
+
You may specify 'PassengerUploadBufferDir' in the following places:
|
860
|
+
|
861
|
+
* In the global server configuration.
|
862
|
+
* In a virtual host configuration block.
|
863
|
+
* In a `<Directory>` or `<Location>` block.
|
864
|
+
* In '.htaccess', if `AllowOverrides Options` is enabled.
|
865
|
+
|
866
|
+
In each place, it may be specified at most once.
|
867
|
+
|
868
|
+
=== PassengerRestartDir <directory> ===
|
869
|
+
As described in the deployment chapters of this document, Phusion Passenger
|
870
|
+
checks the file 'tmp/restart.txt' in the applications'
|
871
|
+
<<application_root,root directory>> for restarting applications. Sometimes it
|
872
|
+
may be desirable for Phusion Passenger to look in a different directory instead,
|
873
|
+
for example for security reasons (see below). This option allows you to
|
874
|
+
customize the directory in which 'restart.txt' is searched for.
|
875
|
+
|
876
|
+
You may specify 'PassengerRestartDir' in the following places:
|
877
|
+
|
878
|
+
* In the global server configuration.
|
879
|
+
* In a virtual host configuration block.
|
880
|
+
* In a `<Directory>` or `<Location>` block.
|
881
|
+
* In '.htaccess', if `AllowOverrides Options` is enabled.
|
882
|
+
|
883
|
+
In each place, it may be specified at most once.
|
884
|
+
|
885
|
+
You can either set it to an absolute directory, or to a directory relative to
|
886
|
+
the <<application_root,application root>>. Examples:
|
887
|
+
|
888
|
+
-----------------------------------
|
889
|
+
<VirtualHost *:80>
|
890
|
+
ServerName www.foo.com
|
891
|
+
# Phusion Passenger will check for /apps/foo/public/tmp/restart.txt
|
892
|
+
DocumentRoot /apps/foo/public
|
893
|
+
</VirtualHost>
|
894
|
+
|
895
|
+
<VirtualHost *:80>
|
896
|
+
ServerName www.bar.com
|
897
|
+
DocumentRoot /apps/bar/public
|
898
|
+
# An absolute filename is given; Phusion Passenger will
|
899
|
+
# check for /restart_files/bar/restart.txt
|
900
|
+
PassengerRestartDir /restart_files/bar
|
901
|
+
</VirtualHost>
|
902
|
+
|
903
|
+
<VirtualHost *:80>
|
904
|
+
ServerName www.baz.com
|
905
|
+
DocumentRoot /apps/baz/public
|
906
|
+
# A relative filename is given; Phusion Passenger will
|
907
|
+
# check for /apps/baz/restart_files/restart.txt
|
908
|
+
#
|
909
|
+
# Note that this directory is relative to the APPLICATION ROOT, *not*
|
910
|
+
# the value of DocumentRoot!
|
911
|
+
PassengerRestartDir restart_files
|
912
|
+
</VirtualHost>
|
913
|
+
-----------------------------------
|
914
|
+
|
915
|
+
.What are the security reasons for wanting to customize PassengerRestartDir?
|
916
|
+
Touching restart.txt will cause Phusion Passenger to restart the application.
|
917
|
+
So anybody who can touch restart.txt can effectively cause a Denial-of-Service
|
918
|
+
attack by touching restart.txt over and over. If your web server or one of your
|
919
|
+
web applications has the permission to touch restart.txt, and one of them has a
|
920
|
+
security flaw which allows an attacker to touch restart.txt, then that will
|
921
|
+
allow the attacker to cause a Denial-of-Service.
|
922
|
+
|
923
|
+
You can prevent this from happening by pointing PassengerRestartDir to a
|
924
|
+
directory that's readable by Apache, but only writable by administrators.
|
925
|
+
|
926
|
+
|
927
|
+
=== Security options ===
|
928
|
+
|
929
|
+
[[PassengerUserSwitching]]
|
930
|
+
==== PassengerUserSwitching <on|off> ====
|
931
|
+
Whether to enable <<user_switching,user switching support>>.
|
932
|
+
|
933
|
+
This option may only occur once, in the global server configuration.
|
934
|
+
The default value is 'on'.
|
935
|
+
|
936
|
+
==== PassengerUser <username> ====
|
937
|
+
If <<user_switching,user switching support>> is enabled, then Phusion Passenger will
|
938
|
+
by default run the web application as the owner if the file 'config/environment.rb'
|
939
|
+
(for Rails apps) or 'config.ru' (for Rack apps). This option allows you to override
|
940
|
+
that behavior and explicitly set a user to run the web application as, regardless
|
941
|
+
of the ownership of 'environment.rb'/'config.ru'.
|
942
|
+
|
943
|
+
This option may occur in the following places:
|
944
|
+
|
945
|
+
* In the global server configuration.
|
946
|
+
* In a virtual host configuration block.
|
947
|
+
* In a `<Directory>` or `<Location>` block.
|
948
|
+
|
949
|
+
In each place, it may be specified at most once.
|
950
|
+
|
951
|
+
==== PassengerGroup <group name> ====
|
952
|
+
If <<user_switching,user switching support>> is enabled, then Phusion Passenger will
|
953
|
+
by default run the web application as the primary group of the owner of the file
|
954
|
+
'config/environment.rb' (for Rails apps) or 'config.ru' (for Rack apps). This option
|
955
|
+
allows you to override that behavior and explicitly set a group to run the web application
|
956
|
+
as, regardless of the ownership of 'environment.rb'/'config.ru'.
|
957
|
+
|
958
|
+
'<group name>' may also be set to the special value '!STARTUP_FILE!', in which case
|
959
|
+
the web application's group will be set to 'environment.rb'/'config.ru''s group.
|
960
|
+
|
961
|
+
This option may occur in the following places:
|
962
|
+
|
963
|
+
* In the global server configuration.
|
964
|
+
* In a virtual host configuration block.
|
965
|
+
* In a `<Directory>` or `<Location>` block.
|
966
|
+
|
967
|
+
In each place, it may be specified at most once.
|
968
|
+
|
969
|
+
[[PassengerDefaultUser]]
|
970
|
+
==== PassengerDefaultUser <username> ====
|
971
|
+
Phusion Passenger enables <<user_switching,user switching support>> by default.
|
972
|
+
This configuration option allows one to specify the user that applications must
|
973
|
+
run as, if user switching fails or is disabled.
|
974
|
+
|
975
|
+
This option may only occur once, in the global server configuration.
|
976
|
+
The default value is 'nobody'.
|
977
|
+
|
978
|
+
[[PassengerDefaultGroup]]
|
979
|
+
==== PassengerDefaultGroup <group name> ====
|
980
|
+
Phusion Passenger enables <<user_switching,user switching support>> by default.
|
981
|
+
This configuration option allows one to specify the group that applications must
|
982
|
+
run as, if user switching fails or is disabled.
|
983
|
+
|
984
|
+
This option may only occur once, in the global server configuration.
|
985
|
+
The default value is the primary group of the user specifified by
|
986
|
+
<<PassengerDefaultUser,PassengerDefaultUser>>.
|
987
|
+
|
988
|
+
==== PassengerFriendlyErrorPages <on|off> ====
|
989
|
+
Phusion Passenger can display friendly error pages whenever an application fails
|
990
|
+
to start. This friendly error page presents the startup error message, some
|
991
|
+
suggestions for solving the problem, and a backtrace. This feature is very useful
|
992
|
+
during application development and useful for less experienced system administrators,
|
993
|
+
but the page might reveal potentially sensitive information, depending on the
|
994
|
+
application. Experienced system administrators who are using Phusion Passenger
|
995
|
+
on serious production servers should consider turning this feature off.
|
996
|
+
|
997
|
+
This option may occur in the following places:
|
998
|
+
|
999
|
+
* In the global server configuration.
|
1000
|
+
* In a virtual host configuration block.
|
1001
|
+
* In a `<Directory>` or `<Location>` block.
|
1002
|
+
* In '.htaccess', if `AllowOverride Options` is on.
|
1003
|
+
|
1004
|
+
In each place, it may be specified at most once. The default value is 'on'.
|
1005
|
+
|
1006
|
+
|
1007
|
+
=== Resource control and optimization options ===
|
1008
|
+
|
1009
|
+
==== PassengerMaxPoolSize <integer> ====
|
1010
|
+
The maximum number of Ruby on Rails or Rack application instances that may
|
1011
|
+
be simultaneously active. A larger number results in higher memory usage,
|
1012
|
+
but improved ability to handle concurrent HTTP clients.
|
1013
|
+
|
1014
|
+
The optimal value depends on your system's hardware and the server's average
|
1015
|
+
load. You should experiment with different values. But generally speaking,
|
1016
|
+
the value should be at least equal to the number of CPUs (or CPU cores) that
|
1017
|
+
you have. If your system has 2 GB of RAM, then we recommend a value of '30'.
|
1018
|
+
If your system is a Virtual Private Server (VPS) and has about 256 MB RAM, and
|
1019
|
+
is also running other services such as MySQL, then we recommend a value of '2'.
|
1020
|
+
|
1021
|
+
If you find that your server is unable to handle the load on your Rails/Rack websites
|
1022
|
+
(i.e. running out of memory) then you should lower this value. (Though if your
|
1023
|
+
sites are really that popular, then you should strongly consider upgrading your
|
1024
|
+
hardware or getting more servers.)
|
1025
|
+
|
1026
|
+
This option may only occur once, in the global server configuration.
|
1027
|
+
The default value is '6'.
|
1028
|
+
|
1029
|
+
TIP: We strongly recommend you to <<reducing_memory_usage,use Ruby Enterprise
|
1030
|
+
Edition>>. This allows you to reduce the memory usage of your Ruby on Rails applications
|
1031
|
+
by about 33%. And it's not hard to install.
|
1032
|
+
|
1033
|
+
[[PassengerMinInstances]]
|
1034
|
+
==== PassengerMinInstances <integer> ====
|
1035
|
+
This specifies the minimum number of application instances that must be kept around
|
1036
|
+
whenever Phusion Passenger cleans up idle instances. You should set this option to a
|
1037
|
+
non-zero value if you want to avoid potentially long startup times after a website
|
1038
|
+
has been idle for an extended period.
|
1039
|
+
|
1040
|
+
Please note that this option does *not* pre-start application instances during Apache
|
1041
|
+
startup. It just makes sure that when the application is first accessed:
|
1042
|
+
|
1043
|
+
1. at least the given number of instances will be spawned.
|
1044
|
+
2. the given number of processes will be kept around even when instances are being
|
1045
|
+
idle cleaned (see <<PassengerPoolIdleTime,PassengerPoolIdleTime>>).
|
1046
|
+
|
1047
|
+
If you want to pre-start application instances during Apache startup, then you should use the <<PassengerPreStart,PassengerPreStart>> directive, possibly in combination with
|
1048
|
+
'PassengerMinInstances'. This behavior might seem counter-intuitive at first sight,
|
1049
|
+
but <<PassengerPreStart,PassengerPreStart>> explains the rationale behind it.
|
1050
|
+
|
1051
|
+
For example, suppose that you have the following configuration:
|
1052
|
+
|
1053
|
+
---------------------------------
|
1054
|
+
PassengerMaxPoolSize 15
|
1055
|
+
PassengerPoolIdleTime 10
|
1056
|
+
|
1057
|
+
<VirtualHost *:80>
|
1058
|
+
ServerName foobar.com
|
1059
|
+
DocumentRoot /webapps/foobar/public
|
1060
|
+
PassengerMinInstances 3
|
1061
|
+
</VirtualHost>
|
1062
|
+
---------------------------------
|
1063
|
+
|
1064
|
+
When you start Apache, there are 0 application instances for 'foobar.com'. Things will
|
1065
|
+
stay that way until someone visits 'foobar.com'. Suppose that there is only 1 visitor.
|
1066
|
+
1 application instance will be started immediately to serve the visitor, while 2 will
|
1067
|
+
be spawned in the background. After 10 seconds, when the idle timeout has
|
1068
|
+
been reached, these 3 application instances will not be cleaned up.
|
1069
|
+
|
1070
|
+
Now suppose that there's a sudden spike of traffic, and 100 users visit 'foobar.com'
|
1071
|
+
simultanously. Phusion Passenger will start 12 more application instances. After the idle
|
1072
|
+
timeout of 10 seconds have passed, Phusion Passenger will clean up 12 application
|
1073
|
+
instances, keeping 3 instances around.
|
1074
|
+
|
1075
|
+
The PassengerMinInstances option may occur in the following places:
|
1076
|
+
|
1077
|
+
* In the global server configuration.
|
1078
|
+
* In a virtual host configuration block.
|
1079
|
+
* In a `<Directory>` or `<Location>` block.
|
1080
|
+
* In '.htaccess', if `AllowOverride Limits` is on.
|
1081
|
+
|
1082
|
+
In each place, it may be specified at most once. The default value is '1'.
|
1083
|
+
|
1084
|
+
==== PassengerMaxInstancesPerApp <integer> ====
|
1085
|
+
The maximum number of application instances that may be simultaneously active
|
1086
|
+
for a single application. This helps to make sure that a single application
|
1087
|
+
will not occupy all available slots in the application pool.
|
1088
|
+
|
1089
|
+
This value must be less than <<PassengerMaxPoolSize,PassengerMaxPoolSize>>. A value of 0
|
1090
|
+
means that there is no limit placed on the number of instances a single application
|
1091
|
+
may use, i.e. only the global limit of <<PassengerMaxPoolSize,PassengerMaxPoolSize>>
|
1092
|
+
will be enforced.
|
1093
|
+
|
1094
|
+
This option may only occur once, in the global server configuration.
|
1095
|
+
The default value is '0'.
|
1096
|
+
|
1097
|
+
[[PassengerPoolIdleTime]]
|
1098
|
+
==== PassengerPoolIdleTime <integer> ====
|
1099
|
+
The maximum number of seconds that an application instance may be idle. That is,
|
1100
|
+
if an application instance hasn't received any traffic after the given number of
|
1101
|
+
seconds, then it will be shutdown in order to conserve memory.
|
1102
|
+
|
1103
|
+
Decreasing this value means that applications will have to be spawned
|
1104
|
+
more often. Since spawning is a relatively slow operation, some visitors may
|
1105
|
+
notice a small delay when they visit your Rails/Rack website. However, it will also
|
1106
|
+
free up resources used by applications more quickly.
|
1107
|
+
|
1108
|
+
The optimal value depends on the average time that a visitor spends on a single
|
1109
|
+
Rails/Rack web page. We recommend a value of `2 * x`, where `x` is the average
|
1110
|
+
number of seconds that a visitor spends on a single Rails/Rack web page. But your
|
1111
|
+
mileage may vary.
|
1112
|
+
|
1113
|
+
When this value is set to '0', application instances will not be shutdown unless
|
1114
|
+
it's really necessary, i.e. when Phusion Passenger is out of worker processes
|
1115
|
+
for a given application and one of the inactive application instances needs to
|
1116
|
+
make place for another application instance. Setting the value to 0 is
|
1117
|
+
recommended if you're on a non-shared host that's only running a few
|
1118
|
+
applications, each which must be available at all times.
|
1119
|
+
|
1120
|
+
This option may only occur once, in the global server configuration.
|
1121
|
+
The default value is '300'.
|
1122
|
+
|
1123
|
+
[[PassengerMaxRequests]]
|
1124
|
+
==== PassengerMaxRequests <integer> ====
|
1125
|
+
The maximum number of requests an application instance will process. After
|
1126
|
+
serving that many requests, the application instance will be shut down and
|
1127
|
+
Phusion Passenger will restart it. A value of 0 means that there is no maximum:
|
1128
|
+
an application instance will thus be shut down when its idle timeout has been
|
1129
|
+
reached.
|
1130
|
+
|
1131
|
+
This option is useful if your application is leaking memory. By shutting
|
1132
|
+
it down after a certain number of requests, all of its memory is guaranteed
|
1133
|
+
to be freed by the operating system.
|
1134
|
+
|
1135
|
+
This option may occur in the following places:
|
1136
|
+
|
1137
|
+
* In the global server configuration.
|
1138
|
+
* In a virtual host configuration block.
|
1139
|
+
* In a `<Directory>` or `<Location>` block.
|
1140
|
+
* In '.htaccess', if `AllowOverride Limits` is on.
|
1141
|
+
|
1142
|
+
In each place, it may be specified at most once. The default value is '0'.
|
1143
|
+
|
1144
|
+
[CAUTION]
|
1145
|
+
=====================================================
|
1146
|
+
The <<PassengerMaxRequests,PassengerMaxRequests>> directive should be considered
|
1147
|
+
as a workaround for misbehaving applications. It is advised that you fix the
|
1148
|
+
problem in your application rather than relying on these directives as a
|
1149
|
+
measure to avoid memory leaks.
|
1150
|
+
=====================================================
|
1151
|
+
|
1152
|
+
==== PassengerStatThrottleRate <integer> ====
|
1153
|
+
By default, Phusion Passenger performs several filesystem checks (or, in
|
1154
|
+
programmers jargon, 'stat() calls') each time a request is processed:
|
1155
|
+
|
1156
|
+
- It checks whether 'config/environment.rb', 'config.ru' or 'passenger_wsgi.py'
|
1157
|
+
is present, in order to autodetect Rails, Rack and WSGI applications.
|
1158
|
+
- It checks whether 'restart.txt' has changed or whether 'always_restart.txt'
|
1159
|
+
exists, in order to determine whether the application should be restarted.
|
1160
|
+
|
1161
|
+
On some systems where disk I/O is expensive, e.g. systems where the harddisk is
|
1162
|
+
already being heavily loaded, or systems where applications are stored on NFS
|
1163
|
+
shares, these filesystem checks can incur a lot of overhead.
|
1164
|
+
|
1165
|
+
You can decrease or almost entirely eliminate this overhead by setting
|
1166
|
+
'PassengerStatThrottleRate'. Setting this option to a value of 'x' means that
|
1167
|
+
the above list of filesystem checks will be performed at most once every 'x'
|
1168
|
+
seconds. Setting it to a value of '0' means that no throttling will take place,
|
1169
|
+
or in other words, that the above list of filesystem checks will be performed on
|
1170
|
+
every request.
|
1171
|
+
|
1172
|
+
This option may occur in the following places:
|
1173
|
+
|
1174
|
+
* In the global server configuration.
|
1175
|
+
* In a virtual host configuration block.
|
1176
|
+
* In a `<Directory>` or `<Location>` block.
|
1177
|
+
* In '.htaccess', if `AllowOverride Limits` is on.
|
1178
|
+
|
1179
|
+
In each place, it may be specified at most once. The default value is '0'.
|
1180
|
+
|
1181
|
+
[[PassengerPreStart]]
|
1182
|
+
==== PassengerPreStart <url> ====
|
1183
|
+
By default, Phusion Passenger does not start any application instances until said
|
1184
|
+
web application is first accessed. The result is that the first visitor of said
|
1185
|
+
web application might experience a small delay as Phusion Passenger is starting
|
1186
|
+
the web application on demand. If that is undesirable, then this directive can be
|
1187
|
+
used to pre-started application instances during Apache startup.
|
1188
|
+
|
1189
|
+
A few things to be careful of:
|
1190
|
+
|
1191
|
+
- This directive accepts the *URL* of the web application you want to pre-start,
|
1192
|
+
not a on/off value! This might seem a bit weird, but read on for rationale. As
|
1193
|
+
for the specifics of the URL:
|
1194
|
+
* The domain part of the URL must be equal to the value of the 'ServerName'
|
1195
|
+
directive of the VirtualHost block that defines the web application.
|
1196
|
+
* Unless the web application is deployed on port 80, the URL should contain
|
1197
|
+
the web application's port number too.
|
1198
|
+
* The path part of the URL must point to some URI that the web application
|
1199
|
+
handles.
|
1200
|
+
- You will probably want to combine this option with
|
1201
|
+
<<PassengerMinInstances,PassengerMinInstances>> because application instances
|
1202
|
+
started with 'PassengerPreStart' are subject to the usual idle timeout rules.
|
1203
|
+
See the example below for an explanation.
|
1204
|
+
|
1205
|
+
This option may occur in the following places:
|
1206
|
+
|
1207
|
+
* In the global server configuration.
|
1208
|
+
* In a virtual host configuration block.
|
1209
|
+
|
1210
|
+
In each place, it may be specified any number of times.
|
1211
|
+
|
1212
|
+
===== Example 1: basic usage =====
|
1213
|
+
|
1214
|
+
Suppose that you have the following web applications.
|
1215
|
+
|
1216
|
+
---------------------------
|
1217
|
+
<VirtualHost *:80>
|
1218
|
+
ServerName foo.com
|
1219
|
+
DocumentRoot /webapps/foo/public
|
1220
|
+
</VirtualHost>
|
1221
|
+
|
1222
|
+
<VirtualHost *:3500>
|
1223
|
+
ServerName bar.com
|
1224
|
+
DocumentRoot /webapps/bar/public
|
1225
|
+
</VirtualHost>
|
1226
|
+
---------------------------
|
1227
|
+
|
1228
|
+
You want both of them to be pre-started during Apache startup. The URL for
|
1229
|
+
foo.com is 'http://foo.com/' (or, equivalently, 'http://foo.com:80/') and
|
1230
|
+
the URL for bar.com is 'http://bar.com:3500/'. So we add two PassengerPreStart
|
1231
|
+
directives, like this:
|
1232
|
+
|
1233
|
+
---------------------------
|
1234
|
+
<VirtualHost *:80>
|
1235
|
+
ServerName foo.com
|
1236
|
+
DocumentRoot /webapps/foo/public
|
1237
|
+
</VirtualHost>
|
1238
|
+
|
1239
|
+
<VirtualHost *:3500>
|
1240
|
+
ServerName bar.com
|
1241
|
+
DocumentRoot /webapps/bar/public
|
1242
|
+
</VirtualHost>
|
1243
|
+
|
1244
|
+
PassengerPreStart http://foo.com/ # <--- added
|
1245
|
+
PassengerPreStart http://bar.com:3500/ # <--- added
|
1246
|
+
---------------------------
|
1247
|
+
|
1248
|
+
===== Example 2: pre-starting apps that are deployed in sub-URIs =====
|
1249
|
+
|
1250
|
+
Suppose that you have a web application deployed in a sub-URI '/store', like this:
|
1251
|
+
|
1252
|
+
---------------------------
|
1253
|
+
<VirtualHost *:80>
|
1254
|
+
ServerName myblog.com
|
1255
|
+
DocumentRoot /webapps/wordpress
|
1256
|
+
RailsBaseURI /store
|
1257
|
+
</VirtualHost>
|
1258
|
+
---------------------------
|
1259
|
+
|
1260
|
+
Then specify the domain name of its containing virtual host followed by the sub-URI,
|
1261
|
+
like this:
|
1262
|
+
|
1263
|
+
---------------------------
|
1264
|
+
<VirtualHost *:80>
|
1265
|
+
ServerName myblog.com
|
1266
|
+
DocumentRoot /webapps/wordpress
|
1267
|
+
RailsBaseURI /store
|
1268
|
+
</VirtualHost>
|
1269
|
+
|
1270
|
+
PassengerPreStart http://myblog.com/store # <----- added
|
1271
|
+
---------------------------
|
1272
|
+
|
1273
|
+
The sub-URI *must* be included; if you don't then the directive will have no effect.
|
1274
|
+
The following example is wrong and won't pre-start the store web application:
|
1275
|
+
|
1276
|
+
---------------------------
|
1277
|
+
PassengerPreStart http://myblog.com/ # <----- WRONG! Missing "/store" part.
|
1278
|
+
---------------------------
|
1279
|
+
|
1280
|
+
===== Example 3: combining with PassengerMinInstances =====
|
1281
|
+
|
1282
|
+
Application instances started with PassengerPreStart are
|
1283
|
+
also subject to the idle timeout rules as specified by
|
1284
|
+
<<PassengerPoolIdleTime,PassengerPoolIdleTime>>! That means that by default,
|
1285
|
+
the pre-started application instances for foo.com are bar.com are shut down
|
1286
|
+
after a few minutes of inactivity. If you don't want that to happen, then
|
1287
|
+
you should combine PassengerPreStart with
|
1288
|
+
<<PassengerMinInstances,PassengerMinInstances>>, like this:
|
1289
|
+
|
1290
|
+
---------------------------
|
1291
|
+
<VirtualHost *:80>
|
1292
|
+
ServerName foo.com
|
1293
|
+
DocumentRoot /webapps/foo/public
|
1294
|
+
PassengerMinInstances 1 # <--- added
|
1295
|
+
</VirtualHost>
|
1296
|
+
|
1297
|
+
<VirtualHost *:3500>
|
1298
|
+
ServerName bar.com
|
1299
|
+
DocumentRoot /webapps/bar/public
|
1300
|
+
PassengerMinInstances 1 # <--- added
|
1301
|
+
</VirtualHost>
|
1302
|
+
|
1303
|
+
PassengerPreStart http://foo.com/
|
1304
|
+
PassengerPreStart http://bar.com:3500/
|
1305
|
+
---------------------------
|
1306
|
+
|
1307
|
+
===== So why a URL? Why not just an on/off flag? =====
|
1308
|
+
|
1309
|
+
A directive that accepts a simple on/off flag is definitely more intuitive,
|
1310
|
+
but due technical difficulties w.r.t. the way Apache works, it's very hard
|
1311
|
+
to implement it like that:
|
1312
|
+
|
1313
|
+
- It is very hard to obtain a full list of web applications defined in the
|
1314
|
+
Apache configuration file(s). In other words, it's hard for Phusion Passenger
|
1315
|
+
to know which web applications are deployed on Apache until a web application
|
1316
|
+
is first accessed, and without such a list Phusion Passenger wouldn't know
|
1317
|
+
which web applications to pre-start. It's probably not completely impossible
|
1318
|
+
to obtain such a list, but this brings us to the following point;
|
1319
|
+
- Users expect things like 'mod_env' to work even in combination with Phusion
|
1320
|
+
Passenger. For example some people put ``SetEnv PATH=....'' in their virtual
|
1321
|
+
host block and they expect the web application to pick that environment variable
|
1322
|
+
up when it's started. Information like this is stored in module-specific
|
1323
|
+
locations that Phusion Passenger cannot access directly. Even if the previous
|
1324
|
+
bullet point is solved and we can obtain a list of web applications,
|
1325
|
+
we cannot start the application with the correct mod_env information.
|
1326
|
+
mod_env is just one such example; there are probably many other Apache modules,
|
1327
|
+
all of which people expect to work, but we cannot answer to those expectations
|
1328
|
+
if PassengerPreStart is implemented as a simple on/off flag.
|
1329
|
+
|
1330
|
+
So as a compromise, we made it accept a URL. This is easier to implement for
|
1331
|
+
us and altough it looks weird, it behaves consistently w.r.t. cooperation
|
1332
|
+
with other Apache modules.
|
1333
|
+
|
1334
|
+
===== What does Phusion Passenger do with the URL? =====
|
1335
|
+
|
1336
|
+
During Apache startup, Phusion Passenger will send a dummy HEAD request to the
|
1337
|
+
given URL and discard the result. In other words, Phusion Passenger simulates a
|
1338
|
+
web access at the given URL. However this simulated request is always sent to
|
1339
|
+
localhost, *not* to the IP that the domain resolves to. Suppose that bar.com
|
1340
|
+
in example 1 resolves to 209.85.227.99; Phusion Passenger will
|
1341
|
+
send the following HTTP request to 127.0.0.1 port 3500 (and not to 209.85.227.99
|
1342
|
+
port 3500):
|
1343
|
+
|
1344
|
+
----------------------
|
1345
|
+
HEAD / HTTP/1.1
|
1346
|
+
Host: bar.com
|
1347
|
+
Connection: close
|
1348
|
+
----------------------
|
1349
|
+
|
1350
|
+
Similarly, for example 2, Phusion Passenger will send the following HTTP request
|
1351
|
+
to 127.0.0.1 port 80:
|
1352
|
+
|
1353
|
+
----------------------
|
1354
|
+
HEAD /store HTTP/1.1
|
1355
|
+
Host: myblog.com
|
1356
|
+
Connection: close
|
1357
|
+
----------------------
|
1358
|
+
|
1359
|
+
===== Do I need to edit /etc/hosts and point the domain in the URL to 127.0.0.1? =====
|
1360
|
+
|
1361
|
+
No. See previous subsection.
|
1362
|
+
|
1363
|
+
===== My web application consists of multiple web servers. What URL do I need to specify, and in which web server's Apache config file? =====
|
1364
|
+
|
1365
|
+
Put the web application's virtual host's ServerName value and the virtual host's
|
1366
|
+
port in the URL, and put
|
1367
|
+
PassengerPreStart on all machines that you want to pre-start the web application
|
1368
|
+
on. The simulated web request is always sent to 127.0.0.1, with the domain name
|
1369
|
+
in the URL as value for the 'Host' HTTP header, so you don't need to worry about
|
1370
|
+
the request ending up at a different web server in the cluster.
|
1371
|
+
|
1372
|
+
===== Does PassengerPreStart support https:// URLs? =====
|
1373
|
+
|
1374
|
+
Yes. And it does not perform any certificate validation.
|
1375
|
+
|
1376
|
+
[[PassengerHighPerformance]]
|
1377
|
+
==== PassengerHighPerformance <on|off> ====
|
1378
|
+
By default, Phusion Passenger is compatible with mod_rewrite and most other
|
1379
|
+
Apache modules. However, a lot of effort is required in order to be compatible.
|
1380
|
+
If you turn 'PassengerHighPerformance' to 'on', then Phusion Passenger will be
|
1381
|
+
a little faster, in return for reduced compatibility with other Apache modules.
|
1382
|
+
|
1383
|
+
In places where 'PassengerHighPerformance' is turned on, mod_rewrite rules will
|
1384
|
+
likely not work. mod_autoindex (the module which displays a directory index)
|
1385
|
+
will also not work. Other Apache modules may or may not work, depending on what
|
1386
|
+
they exactly do. We recommend you to find out how other modules behave in high
|
1387
|
+
performance mode via testing.
|
1388
|
+
|
1389
|
+
This option is *not* an all-or-nothing global option: you can enable high
|
1390
|
+
performance mode for certain virtual hosts or certain URLs only.
|
1391
|
+
The 'PassengerHighPerformance' option may occur in the following places:
|
1392
|
+
|
1393
|
+
* In the global server configuration.
|
1394
|
+
* In a virtual host configuration block.
|
1395
|
+
* In a `<Directory>` or `<Location>` block.
|
1396
|
+
* In '.htaccess'.
|
1397
|
+
|
1398
|
+
In each place, it may be specified at most once. The default value is 'off',
|
1399
|
+
so high performance mode is disabled by default, and you have to explicitly
|
1400
|
+
enable it.
|
1401
|
+
|
1402
|
+
.When to enable high performance mode?
|
1403
|
+
|
1404
|
+
If you do not use mod_rewrite or other Apache modules then it might make
|
1405
|
+
sense to enable high performance mode.
|
1406
|
+
|
1407
|
+
It's likely that some of your applications depend on mod_rewrite or other
|
1408
|
+
Apache modules, while some do not. In that case you can enable high performance
|
1409
|
+
for only those applications that don't use other Apache modules. For example:
|
1410
|
+
|
1411
|
+
------------------------------------
|
1412
|
+
<VirtualHost *:80>
|
1413
|
+
ServerName www.foo.com
|
1414
|
+
DocumentRoot /apps/foo/public
|
1415
|
+
.... mod_rewrite rules or options for other Apache modules here ...
|
1416
|
+
</VirtualHost>
|
1417
|
+
|
1418
|
+
<VirtualHost *:80>
|
1419
|
+
ServerName www.bar.com
|
1420
|
+
DocumentRoot /apps/bar/public
|
1421
|
+
PassengerHighPerformance on
|
1422
|
+
</VirtualHost>
|
1423
|
+
------------------------------------
|
1424
|
+
|
1425
|
+
In the above example, high performance mode is only enabled for www.bar.com.
|
1426
|
+
It is disabled for everything else.
|
1427
|
+
|
1428
|
+
If your application generally depends on mod_rewrite or other Apache modules,
|
1429
|
+
but a certain URL that's accessed often doesn't depend on those other modules,
|
1430
|
+
then you can enable high performance mode for a certain URL only. For example:
|
1431
|
+
|
1432
|
+
------------------------------------
|
1433
|
+
<VirtualHost *:80>
|
1434
|
+
ServerName www.foo.com
|
1435
|
+
DocumentRoot /apps/foo/public
|
1436
|
+
.... mod_rewrite rules or options for other Apache modules here ...
|
1437
|
+
|
1438
|
+
<Location /chatroom/ajax_update_poll>
|
1439
|
+
PassengerHighPerformance on
|
1440
|
+
</Location>
|
1441
|
+
</VirtualHost>
|
1442
|
+
------------------------------------
|
1443
|
+
|
1444
|
+
This enables high performance mode for
|
1445
|
+
http://www.foo.com/chatroom/ajax_update_poll only.
|
1446
|
+
|
1447
|
+
|
1448
|
+
/////////////////////////////////////////
|
1449
|
+
/////////////////////////////////////////
|
1450
|
+
|
1451
|
+
|
1452
|
+
=== Compatibility options ===
|
1453
|
+
|
1454
|
+
[[PassengerResolveSymlinksInDocumentRoot]]
|
1455
|
+
==== PassengerResolveSymlinksInDocumentRoot <on|off> ====
|
1456
|
+
Configures whether Phusion Passenger should resolve symlinks in the document root.
|
1457
|
+
Please refer to <<application_detection,How Phusion Passenger detects whether a
|
1458
|
+
virtual host is a web application>> for more information.
|
1459
|
+
|
1460
|
+
This option may occur in the following places:
|
1461
|
+
|
1462
|
+
* In the global server configuration.
|
1463
|
+
* In a virtual host configuration block.
|
1464
|
+
* In a `<Directory>` or `<Location>` block.
|
1465
|
+
* In '.htaccess', if `AllowOverride Options` is on.
|
1466
|
+
|
1467
|
+
In each place, it may be specified at most once. It is off by default.
|
1468
|
+
|
1469
|
+
==== PassengerAllowEncodedSlashes <on|off> ====
|
1470
|
+
By default, Apache doesn't support URLs with encoded slashes (%2f), e.g. URLs like
|
1471
|
+
this: `/users/fujikura%2fyuu`. If you access such an URL then Apache will return a
|
1472
|
+
404 Not Found error. This can be solved by turning on PassengerAllowEncodedSlashes
|
1473
|
+
as well as Apache's
|
1474
|
+
link:http://httpd.apache.org/docs/2.0/mod/core.html#allowencodedslashes[AllowEncodedSlashes].
|
1475
|
+
|
1476
|
+
Is it important that you turn on both AllowEncodedSlashes *and* PassengerAllowEncodedSlashes,
|
1477
|
+
otherwise this feature will not work properly.
|
1478
|
+
|
1479
|
+
PassengerAllowEncodedSlashes may occur in the following places:
|
1480
|
+
|
1481
|
+
* In the global server configuration.
|
1482
|
+
* In a virtual host configuration block.
|
1483
|
+
* In a `<Directory>` or `<Location>` block.
|
1484
|
+
* In '.htaccess', if `AllowOverride Options` is on.
|
1485
|
+
|
1486
|
+
In each place, it may be specified at most once. It is off by default.
|
1487
|
+
|
1488
|
+
Please note however that turning on support for encoded slashes will break support for
|
1489
|
+
mod_rewrite passthrough rules. Because of bugs/limitations in Apache, Phusion Passenger
|
1490
|
+
can support either encoded slashes or mod_rewrite passthrough rules, but not both at the
|
1491
|
+
same time. Luckily this option can be specified anywhere, so you can enable it only for
|
1492
|
+
virtual hosts or URLs that need it:
|
1493
|
+
|
1494
|
+
----------------------------------
|
1495
|
+
<VirtualHost *:80>
|
1496
|
+
ServerName www.example.com
|
1497
|
+
DocumentRoot /webapps/example/public
|
1498
|
+
AllowEncodedSlashes on
|
1499
|
+
RewriteEngine on
|
1500
|
+
|
1501
|
+
# Check for maintenance file and redirect all requests
|
1502
|
+
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
|
1503
|
+
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
|
1504
|
+
RewriteRule ^.*$ /system/maintenance.html [L]
|
1505
|
+
|
1506
|
+
# Make /about an alias for /info/about.
|
1507
|
+
RewriteRule ^/about$ /info/about [PT,L]
|
1508
|
+
|
1509
|
+
<Location ~ "^/users/">
|
1510
|
+
# In a location block so that it doesn't interfere with the
|
1511
|
+
# above /about mod_rewrite rule.
|
1512
|
+
PassengerAllowEncodedSlashes on
|
1513
|
+
</Location>
|
1514
|
+
</VirtualHost>
|
1515
|
+
----------------------------------
|
1516
|
+
|
1517
|
+
With this, http://www.example.com/users/fujikura%2fyuu will work properly, and
|
1518
|
+
accessing http://www.example.com/about will properly display the result of
|
1519
|
+
http://www.example.com/info/about. Notice that PassengerAllowEncodedSlashes only
|
1520
|
+
interferes with passthrough rules, not with any other mod_rewrite rules. The rules for
|
1521
|
+
displaying maintenance.html will work fine even for URLs starting with "/users".
|
1522
|
+
|
1523
|
+
|
1524
|
+
=== Logging and debugging options ===
|
1525
|
+
|
1526
|
+
==== PassengerLogLevel <integer> ====
|
1527
|
+
This option allows one to specify how much information Phusion Passenger should
|
1528
|
+
write to the Apache error log file. A higher log level value means that more
|
1529
|
+
information will be logged.
|
1530
|
+
|
1531
|
+
Possible values are:
|
1532
|
+
|
1533
|
+
- '0': Show only errors and warnings.
|
1534
|
+
- '1': Show the most important debugging information. This might be useful for
|
1535
|
+
system administrators who are trying to figure out the cause of a
|
1536
|
+
problem.
|
1537
|
+
- '2': Show more debugging information. This is typically only useful for developers.
|
1538
|
+
- '3': Show even more debugging information.
|
1539
|
+
|
1540
|
+
This option may only occur once, in the global server configuration.
|
1541
|
+
The default is '0'.
|
1542
|
+
|
1543
|
+
==== PassengerDebugLogFile <filename> ====
|
1544
|
+
By default Phusion Passenger debugging and error messages are written to the global
|
1545
|
+
web server error log. This option allows one to specify the file that debugging and
|
1546
|
+
error messages should be written to instead.
|
1547
|
+
|
1548
|
+
This option may only occur once, in the global server configuration.
|
1549
|
+
|
1550
|
+
|
1551
|
+
=== Ruby on Rails-specific options ===
|
1552
|
+
|
1553
|
+
==== RailsAutoDetect <on|off> ====
|
1554
|
+
Whether Phusion Passenger should automatically detect whether a virtual host's
|
1555
|
+
document root is a Ruby on Rails application. The default is 'on'.
|
1556
|
+
|
1557
|
+
This option may occur in the global server configuration or in a virtual host
|
1558
|
+
configuration block.
|
1559
|
+
|
1560
|
+
For example, consider the following configuration:
|
1561
|
+
|
1562
|
+
-----------------------------
|
1563
|
+
RailsAutoDetect off
|
1564
|
+
<VirtualHost *:80>
|
1565
|
+
ServerName www.mycook.com
|
1566
|
+
DocumentRoot /webapps/mycook/public
|
1567
|
+
</VirtualHost>
|
1568
|
+
-----------------------------
|
1569
|
+
|
1570
|
+
If one goes to 'http://www.mycook.com/', the visitor will see the contents of
|
1571
|
+
the '/webapps/mycook/public' folder, instead of the output of the Ruby on Rails
|
1572
|
+
application.
|
1573
|
+
|
1574
|
+
It is possible to explicitly specify that the host is a Ruby on Rails
|
1575
|
+
application by using the <<RailsBaseURI,RailsBaseURI>> configuration option:
|
1576
|
+
|
1577
|
+
-----------------------------
|
1578
|
+
RailsAutoDetect off
|
1579
|
+
<VirtualHost *:80>
|
1580
|
+
ServerName www.mycook.com
|
1581
|
+
DocumentRoot /webapps/mycook/public
|
1582
|
+
RailsBaseURI / # This line has been added.
|
1583
|
+
</VirtualHost>
|
1584
|
+
-----------------------------
|
1585
|
+
|
1586
|
+
[[RailsBaseURI]]
|
1587
|
+
==== RailsBaseURI <uri> ====
|
1588
|
+
Used to specify that the given URI is a Rails application. See
|
1589
|
+
<<deploying_rails_to_sub_uri,Deploying Rails to a sub URI>> for an example.
|
1590
|
+
|
1591
|
+
It is allowed to specify this option multiple times. Do this to deploy multiple
|
1592
|
+
Rails applications in different sub-URIs under the same virtual host.
|
1593
|
+
|
1594
|
+
This option may occur in the following places:
|
1595
|
+
|
1596
|
+
* In the global server configuration.
|
1597
|
+
* In a virtual host configuration block.
|
1598
|
+
* In a `<Directory>` or `<Location>` block.
|
1599
|
+
* In '.htaccess', if `AllowOverride Options` is on.
|
1600
|
+
|
1601
|
+
[[rails_env]]
|
1602
|
+
==== RailsEnv <string> ====
|
1603
|
+
This option allows one to specify the default `RAILS_ENV` value.
|
1604
|
+
|
1605
|
+
This option may occur in the following places:
|
1606
|
+
|
1607
|
+
* In the global server configuration.
|
1608
|
+
* In a virtual host configuration block.
|
1609
|
+
* In a `<Directory>` or `<Location>` block.
|
1610
|
+
* In '.htaccess', if `AllowOverride Options` is on.
|
1611
|
+
|
1612
|
+
In each place, it may be specified at most once. The default value is 'production'.
|
1613
|
+
|
1614
|
+
==== RailsFrameworkSpawnerIdleTime <integer> ====
|
1615
|
+
The FrameworkSpawner server (explained in <<spawning_methods_explained,Spawning
|
1616
|
+
methods explained>>) has an idle timeout, just like the backend processes spawned by
|
1617
|
+
Phusion Passenger do. That is, it will automatically shutdown if it hasn't done
|
1618
|
+
anything for a given period.
|
1619
|
+
|
1620
|
+
This option allows you to set the FrameworkSpawner server's idle timeout, in
|
1621
|
+
seconds. A value of '0' means that it should never idle timeout.
|
1622
|
+
|
1623
|
+
Setting a higher value will mean that the FrameworkSpawner server is kept around
|
1624
|
+
longer, which may slightly increase memory usage. But as long as the
|
1625
|
+
FrameworkSpawner server is running, the time to spawn a Ruby on Rails backend
|
1626
|
+
process only takes about 40% of the time that is normally needed, assuming that
|
1627
|
+
you're using the 'smart' <<PassengerSpawnMethod,spawning method>>. So if your
|
1628
|
+
system has enough memory, is it recommended that you set this option to a high
|
1629
|
+
value or to '0'.
|
1630
|
+
|
1631
|
+
This option may occur in the following places:
|
1632
|
+
|
1633
|
+
* In the global server configuration.
|
1634
|
+
* In a virtual host configuration block.
|
1635
|
+
|
1636
|
+
In each place, it may be specified at most once. The default value is '1800' (30 minutes).
|
1637
|
+
|
1638
|
+
==== RailsAppSpawnerIdleTime <integer> ====
|
1639
|
+
The ApplicationSpawner server (explained in <<spawning_methods_explained,Spawning
|
1640
|
+
methods explained>>) has an idle timeout, just like the backend processes spawned by
|
1641
|
+
Phusion Passenger do. That is, it will automatically shutdown if it hasn't done
|
1642
|
+
anything for a given period.
|
1643
|
+
|
1644
|
+
This option allows you to set the ApplicationSpawner server's idle timeout, in
|
1645
|
+
seconds. A value of '0' means that it should never idle timeout.
|
1646
|
+
|
1647
|
+
Setting a higher value will mean that the ApplicationSpawner server is kept around
|
1648
|
+
longer, which may slightly increase memory usage. But as long as the
|
1649
|
+
ApplicationSpawner server is running, the time to spawn a Ruby on Rails backend
|
1650
|
+
process only takes about 10% of the time that is normally needed, assuming that
|
1651
|
+
you're using the 'smart' or 'smart-lv2' <<PassengerSpawnMethod,spawning method>>. So if your
|
1652
|
+
system has enough memory, is it recommended that you set this option to a high
|
1653
|
+
value or to '0'.
|
1654
|
+
|
1655
|
+
This option may occur in the following places:
|
1656
|
+
|
1657
|
+
* In the global server configuration.
|
1658
|
+
* In a virtual host configuration block.
|
1659
|
+
|
1660
|
+
In each place, it may be specified at most once. The default value is '600' (10 minutes).
|
1661
|
+
|
1662
|
+
=== Rack-specific options ===
|
1663
|
+
|
1664
|
+
==== RackAutoDetect <on|off> ====
|
1665
|
+
Whether Phusion Passenger should automatically detect whether a virtual host's
|
1666
|
+
document root is a Rack application. The default is 'on'.
|
1667
|
+
|
1668
|
+
This option may occur in the global server configuration or in a virtual host
|
1669
|
+
configuration block.
|
1670
|
+
|
1671
|
+
For example, consider the following configuration:
|
1672
|
+
|
1673
|
+
-----------------------------
|
1674
|
+
RackAutoDetect off
|
1675
|
+
<VirtualHost *:80>
|
1676
|
+
ServerName www.rackapp.com
|
1677
|
+
DocumentRoot /webapps/my_rack_app/public
|
1678
|
+
</VirtualHost>
|
1679
|
+
-----------------------------
|
1680
|
+
|
1681
|
+
If one goes to 'http://www.rackapp.com/', the visitor will see the contents of
|
1682
|
+
the '/webapps/my_rack_app/public' folder, instead of the output of the Rack
|
1683
|
+
application.
|
1684
|
+
|
1685
|
+
It is possible to explicitly specify that the host is a Rack
|
1686
|
+
application by using the <<RackBaseURI,RackBaseURI>> configuration option:
|
1687
|
+
|
1688
|
+
-----------------------------
|
1689
|
+
RackAutoDetect off
|
1690
|
+
<VirtualHost *:80>
|
1691
|
+
ServerName www.rackapp.com
|
1692
|
+
DocumentRoot /webapps/my_rack_app/public
|
1693
|
+
RackBaseURI / # This line was added
|
1694
|
+
</VirtualHost>
|
1695
|
+
-----------------------------
|
1696
|
+
|
1697
|
+
[[RackBaseURI]]
|
1698
|
+
==== RackBaseURI <uri> ====
|
1699
|
+
Used to specify that the given URI is a Rack application. See
|
1700
|
+
<<deploying_rack_to_sub_uri,Deploying Rack to a sub URI>> for an example.
|
1701
|
+
|
1702
|
+
It is allowed to specify this option multiple times. Do this to deploy multiple
|
1703
|
+
Rack applications in different sub-URIs under the same virtual host.
|
1704
|
+
|
1705
|
+
This option may occur in the following places:
|
1706
|
+
|
1707
|
+
* In the global server configuration.
|
1708
|
+
* In a virtual host configuration block.
|
1709
|
+
* In a `<Directory>` or `<Location>` block.
|
1710
|
+
* In '.htaccess', if `AllowOverride Options` is on.
|
1711
|
+
|
1712
|
+
[[rack_env]]
|
1713
|
+
==== RackEnv <string> ====
|
1714
|
+
The given value will be accessible in Rack applications in the `RACK_ENV`
|
1715
|
+
environment variable. This allows one to define the environment in which
|
1716
|
+
Rack applications are run, very similar to `RAILS_ENV`.
|
1717
|
+
|
1718
|
+
This option may occur in the following places:
|
1719
|
+
|
1720
|
+
* In the global server configuration.
|
1721
|
+
* In a virtual host configuration block.
|
1722
|
+
* In a `<Directory>` or `<Location>` block.
|
1723
|
+
* In '.htaccess', if `AllowOverride Options` is on.
|
1724
|
+
|
1725
|
+
In each place, it may be specified at most once. The default value is 'production'.
|
1726
|
+
|
1727
|
+
=== Deprecated options ===
|
1728
|
+
|
1729
|
+
The following options have been deprecated, but are still supported for backwards
|
1730
|
+
compatibility reasons.
|
1731
|
+
|
1732
|
+
==== RailsRuby ====
|
1733
|
+
Deprecated in favor of <<PassengerRuby,PassengerRuby>>.
|
1734
|
+
|
1735
|
+
==== RailsUserSwitching ====
|
1736
|
+
Deprecated in favor of <<PassengerUserSwitching,PassengerUserSwitching>>.
|
1737
|
+
|
1738
|
+
==== RailsDefaultUser ====
|
1739
|
+
Deprecated in favor of <<PassengerDefaultUser,PassengerDefaultUser>>.
|
1740
|
+
|
1741
|
+
==== RailsAllowModRewrite ====
|
1742
|
+
This option doesn't do anything anymore in recent versions of Phusion Passenger.
|
1743
|
+
|
1744
|
+
==== RailsSpawnMethod ====
|
1745
|
+
Deprecated in favor of <<PassengerSpawnMethod,PassengerSpawnMethod>>.
|
1746
|
+
|
1747
|
+
|
1748
|
+
== Troubleshooting ==
|
1749
|
+
|
1750
|
+
=== Operating system-specific problems ===
|
1751
|
+
|
1752
|
+
==== MacOS X: The installer cannot locate MAMP's Apache ====
|
1753
|
+
|
1754
|
+
.Symptoms
|
1755
|
+
*******************************************************************************
|
1756
|
+
The installer finds Apache 2 development headers at `/Applications/MAMP/Library/bin/apxs`.
|
1757
|
+
However, Apache cannot be found. The installer also outputs the following error:
|
1758
|
+
------------------------------------
|
1759
|
+
cannot open /Applications/MAMP/Library/build/config_vars.mk:
|
1760
|
+
No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.
|
1761
|
+
------------------------------------
|
1762
|
+
*******************************************************************************
|
1763
|
+
|
1764
|
+
Your MAMP installation seems to be broken. In particular, 'config_vars.mk' is missing.
|
1765
|
+
Please read link:http://forum.mamp.info/viewtopic.php?t=1866[this forum topic] to learn how
|
1766
|
+
to fix this problem.
|
1767
|
+
|
1768
|
+
See also link:http://code.google.com/p/phusion-passenger/issues/detail?id=12[this bug report].
|
1769
|
+
|
1770
|
+
|
1771
|
+
=== Problems during installation ===
|
1772
|
+
|
1773
|
+
[[installing_ruby_dev]]
|
1774
|
+
==== Ruby development headers aren't installed ====
|
1775
|
+
|
1776
|
+
.Symptoms
|
1777
|
+
*******************************************************************************
|
1778
|
+
Installing Phusion Passenger fails because of one of the following errors:
|
1779
|
+
|
1780
|
+
- The Phusion Passenger installer tells you that the Ruby development headers
|
1781
|
+
aren't installed.
|
1782
|
+
- The error message ``'no such file to load -- mkmf''' occurs.
|
1783
|
+
- The error message ``'ruby.h: No such file or directory''' occurs.
|
1784
|
+
*******************************************************************************
|
1785
|
+
|
1786
|
+
Phusion Passenger makes use of a native extension, so the Ruby development headers
|
1787
|
+
must be installed. On most Linux systems, Ruby and the Ruby development headers
|
1788
|
+
are contained in separate packages, so having Ruby installed does not
|
1789
|
+
automatically imply having the development headers installed.
|
1790
|
+
|
1791
|
+
Here's how you can install the development headers:
|
1792
|
+
|
1793
|
+
Ubuntu/Debian::
|
1794
|
+
Please type:
|
1795
|
+
+
|
1796
|
+
-----------------------------------------
|
1797
|
+
sudo apt-get install ruby1.8-dev
|
1798
|
+
-----------------------------------------
|
1799
|
+
|
1800
|
+
Fedora/CentOS/RHEL::
|
1801
|
+
Please type:
|
1802
|
+
+
|
1803
|
+
-----------------------------------------
|
1804
|
+
su -c 'yum install ruby-devel'
|
1805
|
+
-----------------------------------------
|
1806
|
+
|
1807
|
+
FreeBSD::
|
1808
|
+
Please install Ruby from 'ports' or with `pkg_add`. If that fails,
|
1809
|
+
please install Ruby from source.
|
1810
|
+
|
1811
|
+
MacOS X::
|
1812
|
+
Please install Ruby from source.
|
1813
|
+
|
1814
|
+
Other operating systems::
|
1815
|
+
Please consult your operating system's native package database.
|
1816
|
+
There should be a package containing the Ruby development headers.
|
1817
|
+
If that fails, please install Ruby from source.
|
1818
|
+
|
1819
|
+
NOTE: If you've installed a new Ruby version (i.e. your system now contains
|
1820
|
+
multiple Ruby installations), then you will need to tell Phusion Passenger
|
1821
|
+
which Ruby installation you want to use. Please read
|
1822
|
+
<<specifying_ruby_installation,Specifying the correct Ruby installation>>.
|
1823
|
+
|
1824
|
+
==== Apache development headers aren't installed ====
|
1825
|
+
|
1826
|
+
.Symptoms
|
1827
|
+
*******************************************************************************
|
1828
|
+
Installing Phusion Passenger fails because of one of the following errors:
|
1829
|
+
|
1830
|
+
- The installer says that the Apache development headers aren't installed.
|
1831
|
+
- The error message ``'httpd.h: No such file or directory''' occurs.
|
1832
|
+
+
|
1833
|
+
(Instead of 'httpd.h', the message might also be 'http_config.h' or something
|
1834
|
+
else similar to 'http_*.h'.)
|
1835
|
+
*******************************************************************************
|
1836
|
+
|
1837
|
+
Ubuntu::
|
1838
|
+
Please type:
|
1839
|
+
+
|
1840
|
+
-----------------------------------------
|
1841
|
+
sudo apt-get install apache2-prefork-dev
|
1842
|
+
-----------------------------------------
|
1843
|
+
|
1844
|
+
Debian::
|
1845
|
+
Please type:
|
1846
|
+
+
|
1847
|
+
-----------------------------------------
|
1848
|
+
sudo apt-get install apache2-dev
|
1849
|
+
-----------------------------------------
|
1850
|
+
|
1851
|
+
Fedora/CentOS/RHEL::
|
1852
|
+
Please type:
|
1853
|
+
+
|
1854
|
+
--------------------------------
|
1855
|
+
su -c 'yum install httpd-devel'
|
1856
|
+
--------------------------------
|
1857
|
+
|
1858
|
+
FreeBSD::
|
1859
|
+
Please install Apache from 'ports' or with `pkg_add`. If that fails,
|
1860
|
+
please install Apache from source.
|
1861
|
+
|
1862
|
+
MacOS X::
|
1863
|
+
Please install Apache from source.
|
1864
|
+
|
1865
|
+
Other operating systems::
|
1866
|
+
Please consult your operating system's native package database.
|
1867
|
+
There should be a package containing the Apache development headers.
|
1868
|
+
If that fails, please install Apache from source.
|
1869
|
+
|
1870
|
+
|
1871
|
+
==== APR development headers aren't installed ====
|
1872
|
+
|
1873
|
+
.Symptoms
|
1874
|
+
*******************************************************************************
|
1875
|
+
Installing Phusion Passenger fails because one of the following errors:
|
1876
|
+
|
1877
|
+
- The installer tells you that APR development headers aren't installed.
|
1878
|
+
- The error message ``'apr_pools.h: No such file or directory''' occurs.
|
1879
|
+
- The error message ``'apr_strings.h: No such file or directory''' occurs.
|
1880
|
+
*******************************************************************************
|
1881
|
+
|
1882
|
+
Ubuntu::
|
1883
|
+
Please type:
|
1884
|
+
+
|
1885
|
+
-----------------------------------------
|
1886
|
+
sudo apt-get install libapr1-dev
|
1887
|
+
-----------------------------------------
|
1888
|
+
|
1889
|
+
Debian::
|
1890
|
+
Please type:
|
1891
|
+
+
|
1892
|
+
-----------------------------------------
|
1893
|
+
sudo apt-get install libapr1-dev
|
1894
|
+
-----------------------------------------
|
1895
|
+
|
1896
|
+
Fedora/CentOS/RHEL::
|
1897
|
+
Please type:
|
1898
|
+
+
|
1899
|
+
--------------------------------
|
1900
|
+
su -c 'yum install apr-devel'
|
1901
|
+
--------------------------------
|
1902
|
+
|
1903
|
+
Other Linux distributions::
|
1904
|
+
Please consult your distribution's package database. There should be a
|
1905
|
+
package which provides APR development headers.
|
1906
|
+
|
1907
|
+
Other operating systems::
|
1908
|
+
The APR development are bundled with Apache. If the APR headers aren't,
|
1909
|
+
then it probably means that they have been removed after Apache's been
|
1910
|
+
installed. Please reinstall Apache to get back the APR headers.
|
1911
|
+
|
1912
|
+
|
1913
|
+
==== Phusion Passenger is using the wrong Apache during installation ====
|
1914
|
+
|
1915
|
+
Please <<specifying_correct_apache_install,Specifying the correct Apache
|
1916
|
+
installation>>, and re-run the Phusion Passenger installer.
|
1917
|
+
|
1918
|
+
|
1919
|
+
==== Phusion Passenger is using the wrong Ruby during installation ====
|
1920
|
+
|
1921
|
+
Please <<specifying_ruby_installation,Specifying the correct Ruby
|
1922
|
+
installation>>, and re-run the Phusion Passenger installer.
|
1923
|
+
|
1924
|
+
|
1925
|
+
=== Problems after installation ===
|
1926
|
+
|
1927
|
+
[TIP]
|
1928
|
+
.The golden tip: read your Apache error logs!
|
1929
|
+
=====================================================
|
1930
|
+
'mod_passenger' will write all errors to the Apache error log. So if
|
1931
|
+
you're experiencing post-installation problems, please look
|
1932
|
+
inside the Apache error logs. It will tell you what exactly went wrong.
|
1933
|
+
=====================================================
|
1934
|
+
|
1935
|
+
==== My Rails application works on Mongrel, but not on Phusion Passenger ====
|
1936
|
+
|
1937
|
+
Please try setting <<PassengerSpawnMethod,PassengerSpawnMethod>> to 'conservative'.
|
1938
|
+
|
1939
|
+
==== Phusion Passenger has been compiled against the wrong Apache installation ====
|
1940
|
+
|
1941
|
+
.Symptoms
|
1942
|
+
*******************************************************************************
|
1943
|
+
Apache crashes during startup (after being daemonized). The Apache error log
|
1944
|
+
says ``'seg fault or similar nasty error detected in the parent process'''.
|
1945
|
+
*******************************************************************************
|
1946
|
+
|
1947
|
+
This problem is most likely to occur on MacOS X. Most OS X users have multiple
|
1948
|
+
Apache installations on their system.
|
1949
|
+
|
1950
|
+
To solve this problem, please <<specifying_correct_apache_install,specify the
|
1951
|
+
correct Apache installation>>, and <<install_passenger,reinstall Phusion
|
1952
|
+
Passenger>>.
|
1953
|
+
|
1954
|
+
==== I get a "304 Forbidden" error ====
|
1955
|
+
|
1956
|
+
See next subsection.
|
1957
|
+
|
1958
|
+
==== Static assets such as images and stylesheets aren't being displayed ====
|
1959
|
+
|
1960
|
+
Static assets are accelerated, i.e. they are served directly by Apache and do not
|
1961
|
+
go through the Rails stack. There are two reasons why Apache doesn't serve static
|
1962
|
+
assets correctly:
|
1963
|
+
|
1964
|
+
1. Your Apache configuration is too strict, and does not allow HTTP clients to
|
1965
|
+
access static assets. This can be achieved with an `Allow from all` directive
|
1966
|
+
in the correct place. For example:
|
1967
|
+
+
|
1968
|
+
-----------------------------------------
|
1969
|
+
<Directory "/webapps/mycook/public">
|
1970
|
+
Options FollowSymLinks
|
1971
|
+
AllowOverride None
|
1972
|
+
Order allow,deny
|
1973
|
+
Allow from all
|
1974
|
+
</Directory>
|
1975
|
+
-----------------------------------------
|
1976
|
+
+
|
1977
|
+
See also link:http://groups.google.com/group/phusion-passenger/browse_thread/thread/9699a639a87f85f4/b9d71a03bf2670a5[this discussion].
|
1978
|
+
|
1979
|
+
2. The Apache process doesn't have permission to access your Rails application's folder.
|
1980
|
+
Please make sure that the Rails application's folder, as well as all of its parent folders,
|
1981
|
+
have the correct permissions and/or ownerships.
|
1982
|
+
|
1983
|
+
==== The Apache error log says that the spawn manager script does not exist, or that it does not have permission to execute it ====
|
1984
|
+
|
1985
|
+
If you are sure that the 'PassengerRoot' configuration option is set correctly,
|
1986
|
+
then this problem is most likely caused by the fact that you're running Apache
|
1987
|
+
with SELinux. On Fedora, CentOS and RedHat Enterprise Linux, Apache is locked
|
1988
|
+
down by SELinux policies.
|
1989
|
+
|
1990
|
+
To solve this problem, you must set some permissions on the Phusion Passenger files
|
1991
|
+
and folders, so that Apache can access them.
|
1992
|
+
|
1993
|
+
- If you've installed Phusion Passenger via a gem, then run this command to determine
|
1994
|
+
Phusion Passenger's root folder:
|
1995
|
+
+
|
1996
|
+
------------------------------------------------------------------
|
1997
|
+
passenger-config --root
|
1998
|
+
------------------------------------------------------------------
|
1999
|
+
+
|
2000
|
+
Next, run the following command:
|
2001
|
+
+
|
2002
|
+
------------------------------------------------------------------
|
2003
|
+
chcon -R -h -t httpd_sys_content_t /path-to-passenger-root
|
2004
|
+
------------------------------------------------------------------
|
2005
|
+
+
|
2006
|
+
where '/path-to-passenger-root' should be replaced with whatever
|
2007
|
+
`passenger-config --root` printed.
|
2008
|
+
|
2009
|
+
- If you've installed Phusion Passenger via the source tarball, then run the following
|
2010
|
+
command:
|
2011
|
+
+
|
2012
|
+
------------------------------------------------------------------
|
2013
|
+
chcon -R -h -t httpd_sys_content_t /path/to/passenger/folder
|
2014
|
+
------------------------------------------------------------------
|
2015
|
+
|
2016
|
+
Once the permissions are fixed, restart Apache.
|
2017
|
+
|
2018
|
+
==== The Rails application reports that it's unable to start because of a permission error ====
|
2019
|
+
|
2020
|
+
Please check whether your Rails application's folder has the correct
|
2021
|
+
permissions. By default, Rails applications are started as the owner of the
|
2022
|
+
file 'config/environment.rb', except if the file is owned by root. If the
|
2023
|
+
file is owned by root, then the Rails application will be started as 'nobody'
|
2024
|
+
(or as the user specify by <<RailsDefaultUser,RailsDefaultUser>>, if that's
|
2025
|
+
specified).
|
2026
|
+
|
2027
|
+
Please read <<user_switching,User switching (security)>> for details.
|
2028
|
+
|
2029
|
+
==== My Rails application's log file is not being written to ====
|
2030
|
+
|
2031
|
+
There are a couple things that you should be aware of:
|
2032
|
+
|
2033
|
+
- By default, Phusion Passenger runs Rails applications in 'production' mode,
|
2034
|
+
so please be sure to check 'production.log' instead of 'development.log'. See
|
2035
|
+
<<RailsEnv,RailsEnv>> for configuration.
|
2036
|
+
- By default, Phusion Passenger runs Rails applications as the owner of 'environment.rb'.
|
2037
|
+
So the log file can only be written to if that user has write permission to the
|
2038
|
+
log file. Please 'chmod' or 'chown' your log file accordingly.
|
2039
|
+
+
|
2040
|
+
See <<User_switching,User switching (security)>> for details.
|
2041
|
+
|
2042
|
+
If you're using a RedHat-derived Linux distribution (such as Fedora or CentOS)
|
2043
|
+
then it is link:http://code.google.com/p/phusion-passenger/issues/detail?id=4[possible
|
2044
|
+
that SELinux is interfering]. RedHat's SELinux policy only allows Apache to read/write
|
2045
|
+
directories that have the 'httpd_sys_content_t' security context. Please run the
|
2046
|
+
following command to give your Rails application folder that context:
|
2047
|
+
|
2048
|
+
-----------------------------------------------------------
|
2049
|
+
chcon -R -h -t httpd_sys_content_t /path/to/your/rails/app
|
2050
|
+
-----------------------------------------------------------
|
2051
|
+
|
2052
|
+
==== I've deployed my app on SSL, but the app thinks its not on SSL ====
|
2053
|
+
|
2054
|
+
Rails and many other frameworks infers whether it's running on SSL through the CGI
|
2055
|
+
environment variable `HTTPS`. Apache always sets this variable when on SSL,
|
2056
|
+
except when SSL is incorrectly configured.
|
2057
|
+
|
2058
|
+
Most Apache installations already configure SSL by default on port 443
|
2059
|
+
(conf/extra/httpd-ssl.conf). Some people think they can save some typing in
|
2060
|
+
subsequent SSL vhost blocks, and omit important options like 'SSLEngine on',
|
2061
|
+
like this:
|
2062
|
+
|
2063
|
+
--------------------------------------
|
2064
|
+
# httpd-ssl.conf contains something like:
|
2065
|
+
# <VirtualHost _default_:443>
|
2066
|
+
# SSLEngine on
|
2067
|
+
# ...
|
2068
|
+
# </VirtualHost>
|
2069
|
+
Include conf/extra/httpd-ssl.conf
|
2070
|
+
|
2071
|
+
<VirtualHost *:443>
|
2072
|
+
ServerName www.example.com
|
2073
|
+
DocumentRoot /webapps/example/public
|
2074
|
+
</Virtualhost>
|
2075
|
+
--------------------------------------
|
2076
|
+
|
2077
|
+
*This is wrong!* In each SSL vhost block you must re-specify all the SSL options.
|
2078
|
+
Otherwise Apache won't properly detect the vhost as an SSL vhost block. Here's
|
2079
|
+
the corrected example:
|
2080
|
+
|
2081
|
+
--------------------------------------
|
2082
|
+
Include conf/extra/httpd-ssl.conf
|
2083
|
+
|
2084
|
+
<VirtualHost *:443>
|
2085
|
+
ServerName www.example.com
|
2086
|
+
DocumentRoot /webapps/example/public
|
2087
|
+
SSLEngine on
|
2088
|
+
...more SSL options here...
|
2089
|
+
</Virtualhost>
|
2090
|
+
--------------------------------------
|
2091
|
+
|
2092
|
+
|
2093
|
+
[[conflicting_apache_modules]]
|
2094
|
+
=== Conflicting Apache modules ===
|
2095
|
+
|
2096
|
+
==== mod_userdir ====
|
2097
|
+
|
2098
|
+
'mod_userdir' is not compatible with Phusion Passenger at the moment.
|
2099
|
+
|
2100
|
+
==== MultiViews (mod_negotiation) ====
|
2101
|
+
|
2102
|
+
MultiViews is not compatible with Phusion Passenger. You should disable MultiViews
|
2103
|
+
for all Phusion Passenger hosts.
|
2104
|
+
|
2105
|
+
==== VirtualDocumentRoot ====
|
2106
|
+
|
2107
|
+
VirtualDocumentRoot is not compatible with Phusion Passenger at the moment.
|
2108
|
+
|
2109
|
+
|
2110
|
+
== Analysis and system maintenance ==
|
2111
|
+
|
2112
|
+
include::users_guide_snippets/analysis_and_system_maintenance.txt[]
|
2113
|
+
|
2114
|
+
|
2115
|
+
== Tips ==
|
2116
|
+
|
2117
|
+
include::users_guide_snippets/tips.txt[]
|
2118
|
+
|
2119
|
+
=== X-Sendfile support ===
|
2120
|
+
|
2121
|
+
Phusion Passenger does not provide X-Sendfile support by itself. Please install
|
2122
|
+
link:http://tn123.ath.cx/mod_xsendfile/[mod_xsendfile] for X-Sendfile support.
|
2123
|
+
|
2124
|
+
=== Upload progress ===
|
2125
|
+
|
2126
|
+
Phusion Passenger does not provide upload progress support by itself. Please
|
2127
|
+
try drogus's link:http://github.com/drogus/apache-upload-progress-module/tree/master[
|
2128
|
+
Apache upload progress module] instead.
|
2129
|
+
|
2130
|
+
|
2131
|
+
== Under the hood ==
|
2132
|
+
Phusion Passenger hides a lot of complexity for the end user (i.e. the web server
|
2133
|
+
system administrator), but sometimes it is desirable to know what is going on.
|
2134
|
+
This section describes a few things that Phusion Passenger does under the hood.
|
2135
|
+
|
2136
|
+
=== Static assets serving ===
|
2137
|
+
Phusion Passenger accelerates serving of static files. This means that, if an URI
|
2138
|
+
maps to a file that exists, then Phusion Passenger will let Apache serve that file
|
2139
|
+
directly, without hitting the web application.
|
2140
|
+
|
2141
|
+
Phusion Passenger does all this without the need for any mod_rewrite rules. People
|
2142
|
+
who are switching from an old Mongrel-based setup might have mod_rewrite rules such
|
2143
|
+
as these:
|
2144
|
+
|
2145
|
+
------------------------------------------------------------
|
2146
|
+
# Check whether this request has a corresponding file; if that
|
2147
|
+
# exists, let Apache serve it, otherwise forward the request to
|
2148
|
+
# Mongrel.
|
2149
|
+
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
2150
|
+
RewriteRule ^(.*)$ balancer://mongrel%{REQUEST_URI} [P,QSA,L]
|
2151
|
+
------------------------------------------------------------
|
2152
|
+
|
2153
|
+
These kind of mod_rewrite rules are no longer required, and you can safely remove
|
2154
|
+
them.
|
2155
|
+
|
2156
|
+
=== Page caching support ===
|
2157
|
+
include::users_guide_snippets/under_the_hood/page_caching_support.txt[]
|
2158
|
+
|
2159
|
+
[[application_detection]]
|
2160
|
+
=== How Phusion Passenger detects whether a virtual host is a web application ===
|
2161
|
+
After you've read the deployment instructions you might wonder how Phusion Passenger
|
2162
|
+
knows that the DocumentRoot points to a web application that Phusion Passenger is
|
2163
|
+
able to serve, and how it knows what kind of web application it is (e.g. Rails or Rack).
|
2164
|
+
|
2165
|
+
Phusion Passenger checks whether the virtual host is a Rails application by checking
|
2166
|
+
whether the following file exists:
|
2167
|
+
|
2168
|
+
------------------------------------------------
|
2169
|
+
dirname(DocumentRoot) + "/config/environment.rb"
|
2170
|
+
------------------------------------------------
|
2171
|
+
|
2172
|
+
If you're not a programmer and don't understand the above pseudo-code snippet, it means
|
2173
|
+
that Phusion Passenger will:
|
2174
|
+
|
2175
|
+
1. Extract the parent directory filename from the value of the DocumentRoot directory.
|
2176
|
+
2. Append the text "/config/environment.rb" to the result, and check whether the resulting
|
2177
|
+
filename exists.
|
2178
|
+
|
2179
|
+
So suppose that your document root is '/webapps/foo/public'. Phusion Passenger will check
|
2180
|
+
whether the file '/webapps/foo/config/environment.rb' exists.
|
2181
|
+
|
2182
|
+
Note that Phusion Passenger does *not* resolve any symlinks in the document root path by
|
2183
|
+
default since version 2.2.0 -- in contrast to versions earlier than 2.2.0, which do resolve
|
2184
|
+
symlinks.
|
2185
|
+
So for example, suppose that your DocumentRoot points to '/home/www/example.com', which in
|
2186
|
+
turn is a symlink to '/webapps/example.com/public'. In versions earlier than 2.2.0, Phusion
|
2187
|
+
Passenger will check whether '/webapps/example.com/config/environment.rb' exists because it
|
2188
|
+
resolves all symlinks. Phusion Passenger 2.2.0 and later however will check for
|
2189
|
+
'/home/www/config/environment.rb'. This file of course doesn't exist, and as a result Phusion
|
2190
|
+
Passenger will not activate itself for this virtual host, and you'll most likely see an Apache
|
2191
|
+
mod_dirindex directory listing.
|
2192
|
+
|
2193
|
+
If you need the old symlink-resolving behavior for whatever reason, then you can turn on
|
2194
|
+
<<PassengerResolveSymlinksInDocumentRoot,PassengerResolveSymlinksInDocumentRoot>>.
|
2195
|
+
|
2196
|
+
Another way to solve this situation is to explicitly tell Phusion Passenger what the
|
2197
|
+
correct application root is through the <<PassengerAppRoot,PassengerAppRoot>> configuration
|
2198
|
+
directive.
|
2199
|
+
|
2200
|
+
Autodetection of Rack applications happens through the same mechanism, exception that
|
2201
|
+
Phusion Passenger will look for 'config.ru' instead of 'config/environment.rb'.
|
2202
|
+
|
2203
|
+
|
2204
|
+
include::users_guide_snippets/appendix_a_about.txt[]
|
2205
|
+
|
2206
|
+
include::users_guide_snippets/appendix_b_terminology.txt[]
|
2207
|
+
|
2208
|
+
include::users_guide_snippets/appendix_c_spawning_methods.txt[]
|