passenger 2.2.9 → 2.2.10
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data/NEWS +10 -0
- data/doc/Architectural overview.html +202 -65
- data/doc/Security of user switching support.html +200 -63
- data/doc/Users guide Apache.html +266 -129
- data/doc/Users guide Nginx.html +234 -97
- data/doc/cxxapi/AbstractSpawnManager_8h-source.html +138 -0
- data/doc/cxxapi/Account_8h-source.html +202 -0
- data/doc/cxxapi/AccountsDatabase_8h-source.html +158 -0
- data/doc/cxxapi/AgentsStarter_8h-source.html +79 -0
- data/doc/cxxapi/BCrypt_8h-source.html +101 -0
- data/doc/cxxapi/BacktracesServer_8h-source.html +87 -0
- data/doc/cxxapi/Base64_8h-source.html +85 -0
- data/doc/cxxapi/Blowfish_8h-source.html +131 -0
- data/doc/cxxapi/Bucket_8h-source.html +1 -1
- data/doc/cxxapi/CachedFileStat_8h-source.html +49 -157
- data/doc/cxxapi/Configuration_8h-source.html +1 -1
- data/doc/cxxapi/Constants_8h-source.html +71 -0
- data/doc/cxxapi/ContentHandler_8h-source.html +92 -0
- data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
- data/doc/cxxapi/Exceptions_8h-source.html +332 -236
- data/doc/cxxapi/FileChangeChecker_8h-source.html +237 -0
- data/doc/cxxapi/FileDescriptor_8h-source.html +206 -0
- data/doc/cxxapi/Hooks_8h-source.html +1 -1
- data/doc/cxxapi/HttpStatusExtractor_8h-source.html +378 -0
- data/doc/cxxapi/LoggingServer_8h-source.html +165 -0
- data/doc/cxxapi/Logging_8h-source.html +580 -112
- data/doc/cxxapi/MessageChannel_8h-source.html +789 -599
- data/doc/cxxapi/MessageClient_8h-source.html +297 -0
- data/doc/cxxapi/MessageServer_8h-source.html +607 -0
- data/doc/cxxapi/PoolOptions_8h-source.html +471 -278
- data/doc/cxxapi/Process_8h-source.html +272 -0
- data/doc/cxxapi/RandomGenerator_8h-source.html +156 -0
- data/doc/cxxapi/ResourceLocator_8h-source.html +104 -0
- data/doc/cxxapi/ScgiRequestParser_8h-source.html +399 -0
- data/doc/cxxapi/ServerInstanceDir_8h-source.html +356 -0
- data/doc/cxxapi/Session_8h-source.html +483 -0
- data/doc/cxxapi/SpawnManager_8h-source.html +590 -546
- data/doc/cxxapi/StaticContentHandler_8h-source.html +65 -0
- data/doc/cxxapi/StaticString_8h-source.html +214 -0
- data/doc/cxxapi/StringListCreator_8h-source.html +111 -0
- data/doc/cxxapi/SystemTime_8h-source.html +191 -78
- data/doc/cxxapi/Timer_8h-source.html +157 -0
- data/doc/cxxapi/Utils_8h-source.html +621 -434
- data/doc/cxxapi/Version_8h-source.html +59 -0
- data/doc/cxxapi/annotated.html +1 -1
- data/doc/cxxapi/apache2_2Configuration_8h-source.html +79 -0
- data/doc/cxxapi/classAgentWatcher-members.html +50 -0
- data/doc/cxxapi/classAgentWatcher.html +445 -0
- data/doc/cxxapi/classClient-members.html +4 -3
- data/doc/cxxapi/classClient.html +50 -46
- data/doc/cxxapi/classHooks-members.html +1 -1
- data/doc/cxxapi/classHooks.html +1 -1
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager-members.html +37 -0
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager.html +191 -0
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.png +0 -0
- data/doc/cxxapi/{classPassenger_1_1DummySpawnManager-members.html → classPassenger_1_1ArgumentException-members.html} +3 -2
- data/doc/cxxapi/classPassenger_1_1ArgumentException.html +52 -0
- data/doc/cxxapi/classPassenger_1_1BacktracesServer-members.html +36 -0
- data/doc/cxxapi/classPassenger_1_1BacktracesServer.html +107 -0
- data/doc/cxxapi/classPassenger_1_1BacktracesServer__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1BacktracesServer__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1BacktracesServer__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1BufferedUpload-members.html +3 -3
- data/doc/cxxapi/classPassenger_1_1BufferedUpload.html +18 -34
- data/doc/cxxapi/classPassenger_1_1BusyException-members.html +2 -1
- data/doc/cxxapi/classPassenger_1_1BusyException.html +3 -2
- data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +2 -1
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +3 -2
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
- data/doc/cxxapi/{classPassenger_1_1FileChecker-members.html → classPassenger_1_1EOFException-members.html} +3 -4
- data/doc/cxxapi/classPassenger_1_1EOFException.html +57 -0
- data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1EventFd-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1EventFd.html +49 -0
- data/doc/cxxapi/classPassenger_1_1FileChangeChecker-members.html +37 -0
- data/doc/cxxapi/classPassenger_1_1FileChangeChecker.html +166 -0
- data/doc/cxxapi/classPassenger_1_1FileDescriptor-members.html +37 -0
- data/doc/cxxapi/classPassenger_1_1FileDescriptor.html +159 -0
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +2 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +3 -2
- data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +2 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException.html +3 -2
- data/doc/cxxapi/{classPassenger_1_1ApplicationPoolServer-members.html → classPassenger_1_1HttpStatusExtractor-members.html} +6 -5
- data/doc/cxxapi/classPassenger_1_1HttpStatusExtractor.html +128 -0
- data/doc/cxxapi/classPassenger_1_1IOException-members.html +2 -1
- data/doc/cxxapi/classPassenger_1_1IOException.html +4 -3
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +2 -1
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MemZeroGuard-members.html +36 -0
- data/doc/cxxapi/classPassenger_1_1MemZeroGuard.html +147 -0
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +12 -5
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +267 -34
- data/doc/cxxapi/classPassenger_1_1MessageServer-members.html +46 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer.html +438 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext.html +56 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext-members.html +38 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext.html +175 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler-members.html +36 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler.html +176 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1Process-members.html +40 -0
- data/doc/cxxapi/classPassenger_1_1Process.html +266 -0
- data/doc/cxxapi/classPassenger_1_1RandomGenerator-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1RandomGenerator.html +51 -0
- data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +2 -1
- data/doc/cxxapi/classPassenger_1_1RuntimeException.html +3 -2
- data/doc/cxxapi/classPassenger_1_1ScgiRequestParser-members.html +47 -0
- data/doc/cxxapi/classPassenger_1_1ScgiRequestParser.html +302 -0
- data/doc/cxxapi/classPassenger_1_1SecurityException-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1SecurityException.html +52 -0
- data/doc/cxxapi/classPassenger_1_1Session-members.html +50 -0
- data/doc/cxxapi/classPassenger_1_1Session.html +577 -0
- data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +2 -1
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +5 -4
- data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +8 -5
- data/doc/cxxapi/classPassenger_1_1SpawnManager.html +127 -45
- data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1StandardSession-members.html +51 -0
- data/doc/cxxapi/classPassenger_1_1StandardSession.html +415 -0
- data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1StaticString-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1StaticString.html +54 -0
- data/doc/cxxapi/classPassenger_1_1SystemException-members.html +2 -1
- data/doc/cxxapi/classPassenger_1_1SystemException.html +4 -3
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +1 -1
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SystemTime-members.html +9 -1
- data/doc/cxxapi/classPassenger_1_1SystemTime.html +92 -8
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException-members.html +37 -0
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException.html +57 -0
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.map +1 -0
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.md5 +1 -0
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1TimeoutException-members.html +33 -0
- data/doc/cxxapi/classPassenger_1_1TimeoutException.html +50 -0
- data/doc/cxxapi/{classPassenger_1_1Application-members.html → classPassenger_1_1Timer-members.html} +8 -7
- data/doc/cxxapi/classPassenger_1_1Timer.html +163 -0
- data/doc/cxxapi/classServer-members.html +33 -0
- data/doc/cxxapi/classServer.html +46 -0
- data/doc/cxxapi/classServerInstanceDirToucher-members.html +33 -0
- data/doc/cxxapi/classServerInstanceDirToucher.html +43 -0
- data/doc/cxxapi/classes.html +1 -1
- data/doc/cxxapi/definitions_8h-source.html +1 -1
- data/doc/cxxapi/files.html +1 -1
- data/doc/cxxapi/functions.html +1 -1
- data/doc/cxxapi/{functions_type.html → functions_enum.html} +7 -5
- data/doc/cxxapi/functions_eval.html +55 -0
- data/doc/cxxapi/functions_func.html +1 -1
- data/doc/cxxapi/functions_vars.html +106 -9
- data/doc/cxxapi/graph_legend.html +1 -1
- data/doc/cxxapi/group__Configuration.html +1 -1
- data/doc/cxxapi/group__Core.html +1 -1
- data/doc/cxxapi/group__Exceptions.html +17 -1
- data/doc/cxxapi/group__Hooks.html +1 -1
- data/doc/cxxapi/group__Support.html +1 -1
- data/doc/cxxapi/hierarchy.html +34 -12
- data/doc/cxxapi/inherit__graph__0.map +1 -1
- data/doc/cxxapi/inherit__graph__0.md5 +1 -1
- data/doc/cxxapi/inherit__graph__0.png +0 -0
- data/doc/cxxapi/inherit__graph__1.map +1 -1
- data/doc/cxxapi/inherit__graph__1.md5 +1 -1
- data/doc/cxxapi/inherit__graph__1.png +0 -0
- data/doc/cxxapi/inherit__graph__10.map +1 -1
- data/doc/cxxapi/inherit__graph__10.md5 +1 -1
- data/doc/cxxapi/inherit__graph__10.png +0 -0
- data/doc/cxxapi/inherit__graph__11.map +1 -1
- data/doc/cxxapi/inherit__graph__11.md5 +1 -1
- data/doc/cxxapi/inherit__graph__11.png +0 -0
- data/doc/cxxapi/inherit__graph__12.map +1 -1
- data/doc/cxxapi/inherit__graph__12.md5 +1 -1
- data/doc/cxxapi/inherit__graph__12.png +0 -0
- data/doc/cxxapi/inherit__graph__13.map +1 -1
- data/doc/cxxapi/inherit__graph__13.md5 +1 -1
- data/doc/cxxapi/inherit__graph__13.png +0 -0
- data/doc/cxxapi/inherit__graph__14.map +3 -2
- data/doc/cxxapi/inherit__graph__14.md5 +1 -1
- data/doc/cxxapi/inherit__graph__14.png +0 -0
- data/doc/cxxapi/inherit__graph__15.map +1 -1
- data/doc/cxxapi/inherit__graph__15.md5 +1 -1
- data/doc/cxxapi/inherit__graph__15.png +0 -0
- data/doc/cxxapi/inherit__graph__16.map +1 -1
- data/doc/cxxapi/inherit__graph__16.md5 +1 -1
- data/doc/cxxapi/inherit__graph__16.png +0 -0
- data/doc/cxxapi/inherit__graph__17.map +1 -1
- data/doc/cxxapi/inherit__graph__17.md5 +1 -1
- data/doc/cxxapi/inherit__graph__17.png +0 -0
- data/doc/cxxapi/inherit__graph__18.map +2 -1
- data/doc/cxxapi/inherit__graph__18.md5 +1 -1
- data/doc/cxxapi/inherit__graph__18.png +0 -0
- data/doc/cxxapi/inherit__graph__19.map +1 -1
- data/doc/cxxapi/inherit__graph__19.md5 +1 -1
- data/doc/cxxapi/inherit__graph__19.png +0 -0
- data/doc/cxxapi/inherit__graph__2.map +1 -1
- data/doc/cxxapi/inherit__graph__2.md5 +1 -1
- data/doc/cxxapi/inherit__graph__2.png +0 -0
- data/doc/cxxapi/inherit__graph__20.map +1 -2
- data/doc/cxxapi/inherit__graph__20.md5 +1 -1
- data/doc/cxxapi/inherit__graph__20.png +0 -0
- data/doc/cxxapi/inherit__graph__21.map +1 -1
- data/doc/cxxapi/inherit__graph__21.md5 +1 -1
- data/doc/cxxapi/inherit__graph__21.png +0 -0
- data/doc/cxxapi/inherit__graph__22.map +1 -0
- data/doc/cxxapi/inherit__graph__22.md5 +1 -0
- data/doc/cxxapi/inherit__graph__22.png +0 -0
- data/doc/cxxapi/inherit__graph__23.map +1 -0
- data/doc/cxxapi/inherit__graph__23.md5 +1 -0
- data/doc/cxxapi/inherit__graph__23.png +0 -0
- data/doc/cxxapi/inherit__graph__24.map +1 -0
- data/doc/cxxapi/inherit__graph__24.md5 +1 -0
- data/doc/cxxapi/inherit__graph__24.png +0 -0
- data/doc/cxxapi/inherit__graph__25.map +1 -0
- data/doc/cxxapi/inherit__graph__25.md5 +1 -0
- data/doc/cxxapi/inherit__graph__25.png +0 -0
- data/doc/cxxapi/inherit__graph__26.map +1 -0
- data/doc/cxxapi/inherit__graph__26.md5 +1 -0
- data/doc/cxxapi/inherit__graph__26.png +0 -0
- data/doc/cxxapi/inherit__graph__27.map +2 -0
- data/doc/cxxapi/inherit__graph__27.md5 +1 -0
- data/doc/cxxapi/inherit__graph__27.png +0 -0
- data/doc/cxxapi/inherit__graph__28.map +1 -0
- data/doc/cxxapi/inherit__graph__28.md5 +1 -0
- data/doc/cxxapi/inherit__graph__28.png +0 -0
- data/doc/cxxapi/inherit__graph__29.map +1 -0
- data/doc/cxxapi/inherit__graph__29.md5 +1 -0
- data/doc/cxxapi/inherit__graph__29.png +0 -0
- data/doc/cxxapi/inherit__graph__3.map +2 -1
- data/doc/cxxapi/inherit__graph__3.md5 +1 -1
- data/doc/cxxapi/inherit__graph__3.png +0 -0
- data/doc/cxxapi/inherit__graph__30.map +1 -0
- data/doc/cxxapi/inherit__graph__30.md5 +1 -0
- data/doc/cxxapi/inherit__graph__30.png +0 -0
- data/doc/cxxapi/inherit__graph__31.map +3 -0
- data/doc/cxxapi/inherit__graph__31.md5 +1 -0
- data/doc/cxxapi/inherit__graph__31.png +0 -0
- data/doc/cxxapi/inherit__graph__32.map +1 -0
- data/doc/cxxapi/inherit__graph__32.md5 +1 -0
- data/doc/cxxapi/inherit__graph__32.png +0 -0
- data/doc/cxxapi/inherit__graph__33.map +1 -0
- data/doc/cxxapi/inherit__graph__33.md5 +1 -0
- data/doc/cxxapi/inherit__graph__33.png +0 -0
- data/doc/cxxapi/inherit__graph__34.map +1 -0
- data/doc/cxxapi/inherit__graph__34.md5 +1 -0
- data/doc/cxxapi/inherit__graph__34.png +0 -0
- data/doc/cxxapi/inherit__graph__35.map +1 -0
- data/doc/cxxapi/inherit__graph__35.md5 +1 -0
- data/doc/cxxapi/inherit__graph__35.png +0 -0
- data/doc/cxxapi/inherit__graph__36.map +1 -0
- data/doc/cxxapi/inherit__graph__36.md5 +1 -0
- data/doc/cxxapi/inherit__graph__36.png +0 -0
- data/doc/cxxapi/inherit__graph__4.map +1 -1
- data/doc/cxxapi/inherit__graph__4.md5 +1 -1
- data/doc/cxxapi/inherit__graph__4.png +0 -0
- data/doc/cxxapi/inherit__graph__5.map +1 -1
- data/doc/cxxapi/inherit__graph__5.md5 +1 -1
- data/doc/cxxapi/inherit__graph__5.png +0 -0
- data/doc/cxxapi/inherit__graph__6.map +1 -2
- data/doc/cxxapi/inherit__graph__6.md5 +1 -1
- data/doc/cxxapi/inherit__graph__6.png +0 -0
- data/doc/cxxapi/inherit__graph__7.map +1 -1
- data/doc/cxxapi/inherit__graph__7.md5 +1 -1
- data/doc/cxxapi/inherit__graph__7.png +0 -0
- data/doc/cxxapi/inherit__graph__8.map +1 -1
- data/doc/cxxapi/inherit__graph__8.md5 +1 -1
- data/doc/cxxapi/inherit__graph__8.png +0 -0
- data/doc/cxxapi/inherit__graph__9.map +1 -1
- data/doc/cxxapi/inherit__graph__9.md5 +1 -1
- data/doc/cxxapi/inherit__graph__9.png +0 -0
- data/doc/cxxapi/inherits.html +81 -41
- data/doc/cxxapi/main.html +1 -1
- data/doc/cxxapi/md5_8h-source.html +121 -0
- data/doc/cxxapi/modules.html +1 -1
- data/doc/cxxapi/namespacePassenger.html +651 -0
- data/doc/cxxapi/namespacemembers.html +155 -0
- data/doc/cxxapi/namespacemembers_enum.html +46 -0
- data/doc/cxxapi/namespacemembers_eval.html +52 -0
- data/doc/cxxapi/namespacemembers_func.html +139 -0
- data/doc/cxxapi/namespacemembers_type.html +50 -0
- data/doc/cxxapi/namespaces.html +34 -0
- data/doc/cxxapi/nginx_2Configuration_8h-source.html +114 -0
- data/doc/cxxapi/ngx__http__passenger__module_8h-source.html +91 -0
- data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +2 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString.html +3 -2
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +2 -1
- data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +3 -2
- data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard-members.html +33 -0
- data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard.html +49 -0
- data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +19 -7
- data/doc/cxxapi/structPassenger_1_1PoolOptions.html +323 -53
- data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash-members.html +33 -0
- data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash.html +49 -0
- data/ext/common/MessageChannel.h +48 -4
- data/ext/common/Version.h +1 -1
- data/ext/nginx/HttpStatusExtractor.h +1 -0
- data/ext/nginx/ScgiRequestParser.h +1 -0
- data/ext/phusion_passenger/native_support.c +5 -1
- data/lib/phusion_passenger/constants.rb +1 -1
- data/lib/phusion_passenger/message_channel.rb +45 -3
- data/lib/phusion_passenger/rack/application_spawner.rb +4 -0
- data/lib/phusion_passenger/railz/application_spawner.rb +19 -1
- data/lib/phusion_passenger/utils.rb +3 -3
- data/lib/phusion_passenger/utils/rewindable_input.rb +5 -0
- data/test/MessageChannelTest.cpp +9 -1
- data/test/stub/message_channel.rb +1 -1
- data/test/stub/message_channel_2.rb +1 -1
- data/test/stub/message_channel_3.rb +2 -2
- metadata +173 -113
- data/doc/cxxapi/ApplicationPoolServer_8h-source.html +0 -833
- data/doc/cxxapi/ApplicationPool_8h-source.html +0 -226
- data/doc/cxxapi/Application_8h-source.html +0 -553
- data/doc/cxxapi/DummySpawnManager_8h-source.html +0 -130
- data/doc/cxxapi/FileChecker_8h-source.html +0 -134
- data/doc/cxxapi/StandardApplicationPool_8h-source.html +0 -842
- data/doc/cxxapi/classPassenger_1_1Application.html +0 -231
- data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +0 -41
- data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +0 -323
- data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +0 -227
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.map +0 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +0 -44
- data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +0 -403
- data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +0 -53
- data/doc/cxxapi/classPassenger_1_1FileChecker.html +0 -124
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +0 -44
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +0 -342
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.map +0 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
- data/doc/rdoc/classes/ConditionVariable.html +0 -194
- data/doc/rdoc/classes/Exception.html +0 -120
- data/doc/rdoc/classes/GC.html +0 -113
- data/doc/rdoc/classes/IO.html +0 -169
- data/doc/rdoc/classes/PhusionPassenger.html +0 -239
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -153
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -517
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -719
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -598
- data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -140
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +0 -317
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess/Instance.html +0 -138
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -154
- data/doc/rdoc/classes/PhusionPassenger/Application.html +0 -283
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -175
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
- data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -489
- data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +0 -350
- data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -188
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -199
- data/doc/rdoc/classes/PhusionPassenger/Railz.html +0 -95
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +0 -438
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +0 -200
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +0 -436
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +0 -155
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -402
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -805
- data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -169
- data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +0 -247
- data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +0 -120
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
- data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
- data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -188
- data/doc/rdoc/classes/PlatformInfo.html +0 -866
- data/doc/rdoc/classes/RakeExtensions.html +0 -197
- data/doc/rdoc/classes/Signal.html +0 -139
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -255
- data/doc/rdoc/files/README.html +0 -157
- data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +0 -92
- data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -129
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -129
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +0 -130
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -134
- data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
- data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -133
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
- data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +0 -140
- data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +0 -145
- data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +0 -125
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -159
- data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +0 -100
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -174
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -129
- data/doc/rdoc/files/misc/rake/extensions_rb.html +0 -130
- data/doc/rdoc/fr_class_index.html +0 -93
- data/doc/rdoc/fr_file_index.html +0 -77
- data/doc/rdoc/fr_method_index.html +0 -212
- data/doc/rdoc/index.html +0 -26
- data/doc/rdoc/rdoc-style.css +0 -187
@@ -3,7 +3,7 @@
|
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
-
<meta name="generator" content="AsciiDoc 8.
|
6
|
+
<meta name="generator" content="AsciiDoc 8.5.2" />
|
7
7
|
<title>Security of user switching support in Passenger</title>
|
8
8
|
<style type="text/css">
|
9
9
|
/* Debug borders */
|
@@ -91,7 +91,7 @@ span#author {
|
|
91
91
|
}
|
92
92
|
span#email {
|
93
93
|
}
|
94
|
-
span#
|
94
|
+
span#revnumber, span#revdate, span#revremark {
|
95
95
|
font-family: sans-serif;
|
96
96
|
}
|
97
97
|
|
@@ -118,12 +118,14 @@ div#preamble {
|
|
118
118
|
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
|
119
119
|
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
|
120
120
|
div.admonitionblock {
|
121
|
-
margin-top: 1.
|
121
|
+
margin-top: 1.0em;
|
122
122
|
margin-bottom: 1.5em;
|
123
123
|
}
|
124
124
|
div.admonitionblock {
|
125
|
-
margin-top: 2.
|
126
|
-
margin-bottom: 2.
|
125
|
+
margin-top: 2.0em;
|
126
|
+
margin-bottom: 2.0em;
|
127
|
+
margin-right: 10%;
|
128
|
+
color: #606060;
|
127
129
|
}
|
128
130
|
|
129
131
|
div.content { /* Block element content. */
|
@@ -165,19 +167,19 @@ div.listingblock > div.content {
|
|
165
167
|
padding: 0.5em;
|
166
168
|
}
|
167
169
|
|
168
|
-
div.quoteblock {
|
169
|
-
padding-left:
|
170
|
+
div.quoteblock, div.verseblock {
|
171
|
+
padding-left: 1.0em;
|
172
|
+
margin-left: 1.0em;
|
170
173
|
margin-right: 10%;
|
174
|
+
border-left: 5px solid #dddddd;
|
175
|
+
color: #777777;
|
171
176
|
}
|
177
|
+
|
172
178
|
div.quoteblock > div.attribution {
|
173
179
|
padding-top: 0.5em;
|
174
180
|
text-align: right;
|
175
181
|
}
|
176
182
|
|
177
|
-
div.verseblock {
|
178
|
-
padding-left: 2.0em;
|
179
|
-
margin-right: 10%;
|
180
|
-
}
|
181
183
|
div.verseblock > div.content {
|
182
184
|
white-space: pre;
|
183
185
|
}
|
@@ -200,17 +202,17 @@ div.admonitionblock .icon {
|
|
200
202
|
}
|
201
203
|
div.admonitionblock td.content {
|
202
204
|
padding-left: 0.5em;
|
203
|
-
border-left:
|
205
|
+
border-left: 3px solid #dddddd;
|
204
206
|
}
|
205
207
|
|
206
208
|
div.exampleblock > div.content {
|
207
|
-
border-left:
|
208
|
-
padding: 0.5em;
|
209
|
+
border-left: 3px solid #dddddd;
|
210
|
+
padding-left: 0.5em;
|
209
211
|
}
|
210
212
|
|
211
213
|
div.imageblock div.content { padding-left: 0; }
|
212
|
-
div.imageblock img { border: 1px solid silver; }
|
213
214
|
span.image img { border-style: none; }
|
215
|
+
a.image:visited { color: white; }
|
214
216
|
|
215
217
|
dl {
|
216
218
|
margin-top: 0.8em;
|
@@ -255,7 +257,7 @@ div.compact div, div.compact div {
|
|
255
257
|
div.tableblock > table {
|
256
258
|
border: 3px solid #527bbd;
|
257
259
|
}
|
258
|
-
thead {
|
260
|
+
thead, p.table.header {
|
259
261
|
font-family: sans-serif;
|
260
262
|
font-weight: bold;
|
261
263
|
}
|
@@ -310,10 +312,42 @@ div.hdlist.compact tr {
|
|
310
312
|
background: yellow;
|
311
313
|
}
|
312
314
|
|
315
|
+
.footnote, .footnoteref {
|
316
|
+
font-size: 0.8em;
|
317
|
+
}
|
318
|
+
|
319
|
+
span.footnote, span.footnoteref {
|
320
|
+
vertical-align: super;
|
321
|
+
}
|
322
|
+
|
323
|
+
#footnotes {
|
324
|
+
margin: 20px 0 20px 0;
|
325
|
+
padding: 7px 0 0 0;
|
326
|
+
}
|
327
|
+
|
328
|
+
#footnotes div.footnote {
|
329
|
+
margin: 0 0 5px 0;
|
330
|
+
}
|
331
|
+
|
332
|
+
#footnotes hr {
|
333
|
+
border: none;
|
334
|
+
border-top: 1px solid silver;
|
335
|
+
height: 1px;
|
336
|
+
text-align: left;
|
337
|
+
margin-left: 0;
|
338
|
+
width: 20%;
|
339
|
+
min-width: 100px;
|
340
|
+
}
|
341
|
+
|
342
|
+
|
313
343
|
@media print {
|
314
344
|
div#footer-badges { display: none; }
|
315
345
|
}
|
316
346
|
|
347
|
+
div#toc {
|
348
|
+
margin-bottom: 2.5em;
|
349
|
+
}
|
350
|
+
|
317
351
|
div#toctitle {
|
318
352
|
color: #527bbd;
|
319
353
|
font-family: sans-serif;
|
@@ -339,10 +373,57 @@ div.toclevel4 {
|
|
339
373
|
margin-left: 6em;
|
340
374
|
font-size: 0.9em;
|
341
375
|
}
|
376
|
+
/* Workarounds for IE6's broken and incomplete CSS2. */
|
377
|
+
|
378
|
+
div.sidebar-content {
|
379
|
+
background: #ffffee;
|
380
|
+
border: 1px solid silver;
|
381
|
+
padding: 0.5em;
|
382
|
+
}
|
383
|
+
div.sidebar-title, div.image-title {
|
384
|
+
color: #527bbd;
|
385
|
+
font-family: sans-serif;
|
386
|
+
font-weight: bold;
|
387
|
+
margin-top: 0.0em;
|
388
|
+
margin-bottom: 0.5em;
|
389
|
+
}
|
390
|
+
|
391
|
+
div.listingblock div.content {
|
392
|
+
border: 1px solid silver;
|
393
|
+
background: #f4f4f4;
|
394
|
+
padding: 0.5em;
|
395
|
+
}
|
396
|
+
|
397
|
+
div.quoteblock-attribution {
|
398
|
+
padding-top: 0.5em;
|
399
|
+
text-align: right;
|
400
|
+
}
|
401
|
+
|
402
|
+
div.verseblock-content {
|
403
|
+
white-space: pre;
|
404
|
+
}
|
405
|
+
div.verseblock-attribution {
|
406
|
+
padding-top: 0.75em;
|
407
|
+
text-align: left;
|
408
|
+
}
|
409
|
+
|
410
|
+
div.exampleblock-content {
|
411
|
+
border-left: 3px solid #dddddd;
|
412
|
+
padding-left: 0.5em;
|
413
|
+
}
|
414
|
+
|
415
|
+
/* IE6 sets dynamically generated links as visited. */
|
416
|
+
div#toc a:visited { color: blue; }
|
342
417
|
</style>
|
343
418
|
<script type="text/javascript">
|
344
419
|
/*<![CDATA[*/
|
345
|
-
window.onload = function(){
|
420
|
+
window.onload = function(){asciidoc.footnotes(); asciidoc.toc(3);}
|
421
|
+
var asciidoc = { // Namespace.
|
422
|
+
|
423
|
+
/////////////////////////////////////////////////////////////////////
|
424
|
+
// Table Of Contents generator
|
425
|
+
/////////////////////////////////////////////////////////////////////
|
426
|
+
|
346
427
|
/* Author: Mihai Bazon, September 2002
|
347
428
|
* http://students.infoiasi.ro/~mishoo
|
348
429
|
*
|
@@ -354,53 +435,55 @@ window.onload = function(){generateToc(3)}
|
|
354
435
|
*/
|
355
436
|
|
356
437
|
/* modified by Troy D. Hanson, September 2006. License: GPL */
|
357
|
-
/* modified by Stuart Rackham,
|
358
|
-
|
359
|
-
function getText(el) {
|
360
|
-
var text = "";
|
361
|
-
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
362
|
-
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
|
363
|
-
text += i.data;
|
364
|
-
else if (i.firstChild != null)
|
365
|
-
text += getText(i);
|
366
|
-
}
|
367
|
-
return text;
|
368
|
-
}
|
438
|
+
/* modified by Stuart Rackham, 2006, 2009. License: GPL */
|
369
439
|
|
370
|
-
|
371
|
-
|
372
|
-
this.text = text;
|
373
|
-
this.toclevel = toclevel;
|
374
|
-
}
|
440
|
+
// toclevels = 1..4.
|
441
|
+
toc: function (toclevels) {
|
375
442
|
|
376
|
-
function
|
377
|
-
|
378
|
-
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
|
379
|
-
// Function that scans the DOM tree for header elements (the DOM2
|
380
|
-
// nodeIterator API would be a better technique but not supported by all
|
381
|
-
// browsers).
|
382
|
-
var iterate = function (el) {
|
443
|
+
function getText(el) {
|
444
|
+
var text = "";
|
383
445
|
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
384
|
-
if (i.nodeType ==
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
446
|
+
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
|
447
|
+
text += i.data;
|
448
|
+
else if (i.firstChild != null)
|
449
|
+
text += getText(i);
|
450
|
+
}
|
451
|
+
return text;
|
452
|
+
}
|
453
|
+
|
454
|
+
function TocEntry(el, text, toclevel) {
|
455
|
+
this.element = el;
|
456
|
+
this.text = text;
|
457
|
+
this.toclevel = toclevel;
|
458
|
+
}
|
459
|
+
|
460
|
+
function tocEntries(el, toclevels) {
|
461
|
+
var result = new Array;
|
462
|
+
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
|
463
|
+
// Function that scans the DOM tree for header elements (the DOM2
|
464
|
+
// nodeIterator API would be a better technique but not supported by all
|
465
|
+
// browsers).
|
466
|
+
var iterate = function (el) {
|
467
|
+
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
468
|
+
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
|
469
|
+
var mo = re.exec(i.tagName);
|
470
|
+
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
|
471
|
+
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
|
472
|
+
}
|
473
|
+
iterate(i);
|
474
|
+
}
|
389
475
|
}
|
390
476
|
}
|
477
|
+
iterate(el);
|
478
|
+
return result;
|
391
479
|
}
|
392
|
-
iterate(el);
|
393
|
-
return result;
|
394
|
-
}
|
395
480
|
|
396
|
-
// This function does the work. toclevels = 1..4.
|
397
|
-
function generateToc(toclevels) {
|
398
481
|
var toc = document.getElementById("toc");
|
399
|
-
var entries = tocEntries(document.
|
482
|
+
var entries = tocEntries(document.getElementById("content"), toclevels);
|
400
483
|
for (var i = 0; i < entries.length; ++i) {
|
401
484
|
var entry = entries[i];
|
402
485
|
if (entry.element.id == "")
|
403
|
-
entry.element.id = "
|
486
|
+
entry.element.id = "_toc_" + i;
|
404
487
|
var a = document.createElement("a");
|
405
488
|
a.href = "#" + entry.element.id;
|
406
489
|
a.appendChild(document.createTextNode(entry.text));
|
@@ -410,7 +493,58 @@ function generateToc(toclevels) {
|
|
410
493
|
toc.appendChild(div);
|
411
494
|
}
|
412
495
|
if (entries.length == 0)
|
413
|
-
|
496
|
+
toc.parentNode.removeChild(toc);
|
497
|
+
},
|
498
|
+
|
499
|
+
|
500
|
+
/////////////////////////////////////////////////////////////////////
|
501
|
+
// Footnotes generator
|
502
|
+
/////////////////////////////////////////////////////////////////////
|
503
|
+
|
504
|
+
/* Based on footnote generation code from:
|
505
|
+
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
|
506
|
+
*/
|
507
|
+
|
508
|
+
footnotes: function () {
|
509
|
+
var cont = document.getElementById("content");
|
510
|
+
var noteholder = document.getElementById("footnotes");
|
511
|
+
var spans = cont.getElementsByTagName("span");
|
512
|
+
var refs = {};
|
513
|
+
var n = 0;
|
514
|
+
for (i=0; i<spans.length; i++) {
|
515
|
+
if (spans[i].className == "footnote") {
|
516
|
+
n++;
|
517
|
+
// Use [\s\S] in place of . so multi-line matches work.
|
518
|
+
// Because JavaScript has no s (dotall) regex flag.
|
519
|
+
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
|
520
|
+
noteholder.innerHTML +=
|
521
|
+
"<div class='footnote' id='_footnote_" + n + "'>" +
|
522
|
+
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
|
523
|
+
n + "</a>. " + note + "</div>";
|
524
|
+
spans[i].innerHTML =
|
525
|
+
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
|
526
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
527
|
+
var id =spans[i].getAttribute("id");
|
528
|
+
if (id != null) refs["#"+id] = n;
|
529
|
+
}
|
530
|
+
}
|
531
|
+
if (n == 0)
|
532
|
+
noteholder.parentNode.removeChild(noteholder);
|
533
|
+
else {
|
534
|
+
// Process footnoterefs.
|
535
|
+
for (i=0; i<spans.length; i++) {
|
536
|
+
if (spans[i].className == "footnoteref") {
|
537
|
+
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
|
538
|
+
href = href.match(/#.*/)[0]; // Because IE return full URL.
|
539
|
+
n = refs[href];
|
540
|
+
spans[i].innerHTML =
|
541
|
+
"[<a href='#_footnote_" + n +
|
542
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
543
|
+
}
|
544
|
+
}
|
545
|
+
}
|
546
|
+
}
|
547
|
+
|
414
548
|
}
|
415
549
|
/*]]>*/
|
416
550
|
</script>
|
@@ -423,6 +557,7 @@ function generateToc(toclevels) {
|
|
423
557
|
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
|
424
558
|
</div>
|
425
559
|
</div>
|
560
|
+
<div id="content">
|
426
561
|
<h2 id="_problem_description">1. Problem description</h2>
|
427
562
|
<div class="sectionbody">
|
428
563
|
<div class="admonitionblock">
|
@@ -485,7 +620,7 @@ Using <em>sudo</em>.
|
|
485
620
|
</li>
|
486
621
|
</ol></div>
|
487
622
|
<div class="paragraph"><p>Let us take a look at each method in detail.</p></div>
|
488
|
-
<h3 id="apache_root">2.1. Apache must already be running as root</h3>
|
623
|
+
<h3 id="apache_root">2.1. Apache must already be running as root</h3><div style="clear:left"></div>
|
489
624
|
<div class="paragraph"><p>First, let us take a look at the typical Apache setup, in which Apache is bound
|
490
625
|
to port 80, and uses the prefork MPM. Binding to any port lower than 1024
|
491
626
|
requires root privileges, so Apache is typically run as root. This poses an
|
@@ -501,7 +636,7 @@ control process) is run as root. This is also true for
|
|
501
636
|
Passenger can already launch Rails applications as a different user. But now we
|
502
637
|
have to ask this question:</p></div>
|
503
638
|
<div class="exampleblock">
|
504
|
-
<div class="content">
|
639
|
+
<div class="exampleblock-content">
|
505
640
|
<div class="paragraph"><p>If Apache is not running as root, are there still any Passenger users who
|
506
641
|
want to run Rails applications as different users?</p></div>
|
507
642
|
</div></div>
|
@@ -510,7 +645,7 @@ want to run Rails applications as different users?</p></div>
|
|
510
645
|
incredibly easy, and requires no new framework to be written. However, testing
|
511
646
|
this method in automated unit tests will require running the unit test suit as
|
512
647
|
root.</p></div>
|
513
|
-
<h3 id="_using_apache_8217_s_suexec">2.2. Using Apache’s suEXEC</h3>
|
648
|
+
<h3 id="_using_apache_8217_s_suexec">2.2. Using Apache’s suEXEC</h3><div style="clear:left"></div>
|
514
649
|
<div class="paragraph"><p>Apache’s <a href="http://httpd.apache.org/docs/2.0/suexec.html">suEXEC</a> allows one to
|
515
650
|
run CGI processes as different users. But it seems that suEXEC can only be
|
516
651
|
used for CGI, and is not a general-purpose mechanism. The
|
@@ -518,7 +653,7 @@ used for CGI, and is not a general-purpose mechanism. The
|
|
518
653
|
PHP applications via suEXEC, but it requires patching suEXEC. If Passenger is
|
519
654
|
to use suEXEC, then it is likely that we’ll have to patch suEXEC. The suEXEC
|
520
655
|
website strongly discourages patching.</p></div>
|
521
|
-
<h3 id="_using_a_setuid_root_wrapper_application">2.3. Using a setuid root wrapper application</h3>
|
656
|
+
<h3 id="_using_a_setuid_root_wrapper_application">2.3. Using a setuid root wrapper application</h3><div style="clear:left"></div>
|
522
657
|
<div class="paragraph"><p>If we use this method, we must be extremely careful. It must not be possible
|
523
658
|
for arbitrary processes to gain root privileges. We want Passenger, and only
|
524
659
|
Passenger, to be able to gain root privileges.</p></div>
|
@@ -559,7 +694,7 @@ allowed to use the wrapper. The wrapper can then check whether the calling
|
|
559
694
|
process’s user is in the whitelist.</p></div>
|
560
695
|
<div class="paragraph"><p>Writing a wrapper is not too hard. Furthermore, unit tests do not have to be
|
561
696
|
run as root, in contrast to the run-Apache-as-root method.</p></div>
|
562
|
-
<h3 id="setuid_root">2.4. Using a setuid $X wrapper application</h3>
|
697
|
+
<h3 id="setuid_root">2.4. Using a setuid $X wrapper application</h3><div style="clear:left"></div>
|
563
698
|
<div class="paragraph"><p>A setuid $X wrapper will work in a fashion similar to the setuid root wrapper,
|
564
699
|
i.e. it will use a password file for authorization.</p></div>
|
565
700
|
<div class="paragraph"><p>Passenger does not spawn Rails applications itself, but does so via the spawn
|
@@ -575,10 +710,10 @@ memory with each other, so a lot of memory is wasted compared to the other
|
|
575
710
|
methods.</p></div>
|
576
711
|
<div class="paragraph"><p>Implementing this will also take more work. One has to create a different
|
577
712
|
wrapper for each user, and to install it.</p></div>
|
578
|
-
<h3 id="_using_em_su_em">2.5. Using <em>su</em></h3>
|
713
|
+
<h3 id="_using_em_su_em">2.5. Using <em>su</em></h3><div style="clear:left"></div>
|
579
714
|
<div class="paragraph"><p>The standard Unix <em>su</em> tool asks for the root password. It’s a bad idea for
|
580
715
|
Apache to know the root password, so using <em>su</em> is not a viable alternative.</p></div>
|
581
|
-
<h3 id="_using_em_sudo_em">2.6. Using <em>sudo</em></h3>
|
716
|
+
<h3 id="_using_em_sudo_em">2.6. Using <em>sudo</em></h3><div style="clear:left"></div>
|
582
717
|
<div class="paragraph"><p>It might be possible to use the <em>sudo</em> utility. sudo can be configured in
|
583
718
|
such a way that the user Apache runs as can use sudo without having to enter a
|
584
719
|
password.</p></div>
|
@@ -591,7 +726,7 @@ potential security problems. Note that passing information via program arguments
|
|
591
726
|
is not secure: it is possible to view that information with tools like <em>ps</em>,
|
592
727
|
or (on Linux) by reading the file <tt>/proc/$PID/cmdline</tt>.</p></div>
|
593
728
|
<div class="paragraph"><p>So it seems <em>sudo</em> is not a viable alternative.</p></div>
|
594
|
-
<h3 id="_common_security_issues">2.7. Common security issues</h3>
|
729
|
+
<h3 id="_common_security_issues">2.7. Common security issues</h3><div style="clear:left"></div>
|
595
730
|
<div class="paragraph"><p>Whatever method Passenger will use, the following security principles must be
|
596
731
|
honored:</p></div>
|
597
732
|
<div class="ulist"><ul>
|
@@ -634,9 +769,11 @@ convinced that implementing suEXEC’s full security model will provide
|
|
634
769
|
significant benefits, but if you have good reasons to think otherwise, please
|
635
770
|
feel free to discuss it with us.</p></div>
|
636
771
|
</div>
|
772
|
+
</div>
|
773
|
+
<div id="footnotes"><hr /></div>
|
637
774
|
<div id="footer">
|
638
775
|
<div id="footer-text">
|
639
|
-
Last updated 2009-11-24
|
776
|
+
Last updated 2009-11-24 13:33:45 CEST
|
640
777
|
</div>
|
641
778
|
</div>
|
642
779
|
</body>
|
data/doc/Users guide Apache.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
-
<meta name="generator" content="AsciiDoc 8.
|
6
|
+
<meta name="generator" content="AsciiDoc 8.5.2" />
|
7
7
|
<title>Phusion Passenger users guide</title>
|
8
8
|
<style type="text/css">
|
9
9
|
/* Debug borders */
|
@@ -91,7 +91,7 @@ span#author {
|
|
91
91
|
}
|
92
92
|
span#email {
|
93
93
|
}
|
94
|
-
span#
|
94
|
+
span#revnumber, span#revdate, span#revremark {
|
95
95
|
font-family: sans-serif;
|
96
96
|
}
|
97
97
|
|
@@ -118,12 +118,14 @@ div#preamble {
|
|
118
118
|
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
|
119
119
|
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
|
120
120
|
div.admonitionblock {
|
121
|
-
margin-top: 1.
|
121
|
+
margin-top: 1.0em;
|
122
122
|
margin-bottom: 1.5em;
|
123
123
|
}
|
124
124
|
div.admonitionblock {
|
125
|
-
margin-top: 2.
|
126
|
-
margin-bottom: 2.
|
125
|
+
margin-top: 2.0em;
|
126
|
+
margin-bottom: 2.0em;
|
127
|
+
margin-right: 10%;
|
128
|
+
color: #606060;
|
127
129
|
}
|
128
130
|
|
129
131
|
div.content { /* Block element content. */
|
@@ -165,19 +167,19 @@ div.listingblock > div.content {
|
|
165
167
|
padding: 0.5em;
|
166
168
|
}
|
167
169
|
|
168
|
-
div.quoteblock {
|
169
|
-
padding-left:
|
170
|
+
div.quoteblock, div.verseblock {
|
171
|
+
padding-left: 1.0em;
|
172
|
+
margin-left: 1.0em;
|
170
173
|
margin-right: 10%;
|
174
|
+
border-left: 5px solid #dddddd;
|
175
|
+
color: #777777;
|
171
176
|
}
|
177
|
+
|
172
178
|
div.quoteblock > div.attribution {
|
173
179
|
padding-top: 0.5em;
|
174
180
|
text-align: right;
|
175
181
|
}
|
176
182
|
|
177
|
-
div.verseblock {
|
178
|
-
padding-left: 2.0em;
|
179
|
-
margin-right: 10%;
|
180
|
-
}
|
181
183
|
div.verseblock > div.content {
|
182
184
|
white-space: pre;
|
183
185
|
}
|
@@ -200,17 +202,17 @@ div.admonitionblock .icon {
|
|
200
202
|
}
|
201
203
|
div.admonitionblock td.content {
|
202
204
|
padding-left: 0.5em;
|
203
|
-
border-left:
|
205
|
+
border-left: 3px solid #dddddd;
|
204
206
|
}
|
205
207
|
|
206
208
|
div.exampleblock > div.content {
|
207
|
-
border-left:
|
208
|
-
padding: 0.5em;
|
209
|
+
border-left: 3px solid #dddddd;
|
210
|
+
padding-left: 0.5em;
|
209
211
|
}
|
210
212
|
|
211
213
|
div.imageblock div.content { padding-left: 0; }
|
212
|
-
div.imageblock img { border: 1px solid silver; }
|
213
214
|
span.image img { border-style: none; }
|
215
|
+
a.image:visited { color: white; }
|
214
216
|
|
215
217
|
dl {
|
216
218
|
margin-top: 0.8em;
|
@@ -255,7 +257,7 @@ div.compact div, div.compact div {
|
|
255
257
|
div.tableblock > table {
|
256
258
|
border: 3px solid #527bbd;
|
257
259
|
}
|
258
|
-
thead {
|
260
|
+
thead, p.table.header {
|
259
261
|
font-family: sans-serif;
|
260
262
|
font-weight: bold;
|
261
263
|
}
|
@@ -310,10 +312,42 @@ div.hdlist.compact tr {
|
|
310
312
|
background: yellow;
|
311
313
|
}
|
312
314
|
|
315
|
+
.footnote, .footnoteref {
|
316
|
+
font-size: 0.8em;
|
317
|
+
}
|
318
|
+
|
319
|
+
span.footnote, span.footnoteref {
|
320
|
+
vertical-align: super;
|
321
|
+
}
|
322
|
+
|
323
|
+
#footnotes {
|
324
|
+
margin: 20px 0 20px 0;
|
325
|
+
padding: 7px 0 0 0;
|
326
|
+
}
|
327
|
+
|
328
|
+
#footnotes div.footnote {
|
329
|
+
margin: 0 0 5px 0;
|
330
|
+
}
|
331
|
+
|
332
|
+
#footnotes hr {
|
333
|
+
border: none;
|
334
|
+
border-top: 1px solid silver;
|
335
|
+
height: 1px;
|
336
|
+
text-align: left;
|
337
|
+
margin-left: 0;
|
338
|
+
width: 20%;
|
339
|
+
min-width: 100px;
|
340
|
+
}
|
341
|
+
|
342
|
+
|
313
343
|
@media print {
|
314
344
|
div#footer-badges { display: none; }
|
315
345
|
}
|
316
346
|
|
347
|
+
div#toc {
|
348
|
+
margin-bottom: 2.5em;
|
349
|
+
}
|
350
|
+
|
317
351
|
div#toctitle {
|
318
352
|
color: #527bbd;
|
319
353
|
font-family: sans-serif;
|
@@ -339,10 +373,57 @@ div.toclevel4 {
|
|
339
373
|
margin-left: 6em;
|
340
374
|
font-size: 0.9em;
|
341
375
|
}
|
376
|
+
/* Workarounds for IE6's broken and incomplete CSS2. */
|
377
|
+
|
378
|
+
div.sidebar-content {
|
379
|
+
background: #ffffee;
|
380
|
+
border: 1px solid silver;
|
381
|
+
padding: 0.5em;
|
382
|
+
}
|
383
|
+
div.sidebar-title, div.image-title {
|
384
|
+
color: #527bbd;
|
385
|
+
font-family: sans-serif;
|
386
|
+
font-weight: bold;
|
387
|
+
margin-top: 0.0em;
|
388
|
+
margin-bottom: 0.5em;
|
389
|
+
}
|
390
|
+
|
391
|
+
div.listingblock div.content {
|
392
|
+
border: 1px solid silver;
|
393
|
+
background: #f4f4f4;
|
394
|
+
padding: 0.5em;
|
395
|
+
}
|
396
|
+
|
397
|
+
div.quoteblock-attribution {
|
398
|
+
padding-top: 0.5em;
|
399
|
+
text-align: right;
|
400
|
+
}
|
401
|
+
|
402
|
+
div.verseblock-content {
|
403
|
+
white-space: pre;
|
404
|
+
}
|
405
|
+
div.verseblock-attribution {
|
406
|
+
padding-top: 0.75em;
|
407
|
+
text-align: left;
|
408
|
+
}
|
409
|
+
|
410
|
+
div.exampleblock-content {
|
411
|
+
border-left: 3px solid #dddddd;
|
412
|
+
padding-left: 0.5em;
|
413
|
+
}
|
414
|
+
|
415
|
+
/* IE6 sets dynamically generated links as visited. */
|
416
|
+
div#toc a:visited { color: blue; }
|
342
417
|
</style>
|
343
418
|
<script type="text/javascript">
|
344
419
|
/*<![CDATA[*/
|
345
|
-
window.onload = function(){
|
420
|
+
window.onload = function(){asciidoc.footnotes(); asciidoc.toc(3);}
|
421
|
+
var asciidoc = { // Namespace.
|
422
|
+
|
423
|
+
/////////////////////////////////////////////////////////////////////
|
424
|
+
// Table Of Contents generator
|
425
|
+
/////////////////////////////////////////////////////////////////////
|
426
|
+
|
346
427
|
/* Author: Mihai Bazon, September 2002
|
347
428
|
* http://students.infoiasi.ro/~mishoo
|
348
429
|
*
|
@@ -354,53 +435,55 @@ window.onload = function(){generateToc(3)}
|
|
354
435
|
*/
|
355
436
|
|
356
437
|
/* modified by Troy D. Hanson, September 2006. License: GPL */
|
357
|
-
/* modified by Stuart Rackham,
|
358
|
-
|
359
|
-
function getText(el) {
|
360
|
-
var text = "";
|
361
|
-
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
362
|
-
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
|
363
|
-
text += i.data;
|
364
|
-
else if (i.firstChild != null)
|
365
|
-
text += getText(i);
|
366
|
-
}
|
367
|
-
return text;
|
368
|
-
}
|
438
|
+
/* modified by Stuart Rackham, 2006, 2009. License: GPL */
|
369
439
|
|
370
|
-
|
371
|
-
|
372
|
-
this.text = text;
|
373
|
-
this.toclevel = toclevel;
|
374
|
-
}
|
440
|
+
// toclevels = 1..4.
|
441
|
+
toc: function (toclevels) {
|
375
442
|
|
376
|
-
function
|
377
|
-
|
378
|
-
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
|
379
|
-
// Function that scans the DOM tree for header elements (the DOM2
|
380
|
-
// nodeIterator API would be a better technique but not supported by all
|
381
|
-
// browsers).
|
382
|
-
var iterate = function (el) {
|
443
|
+
function getText(el) {
|
444
|
+
var text = "";
|
383
445
|
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
384
|
-
if (i.nodeType ==
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
446
|
+
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
|
447
|
+
text += i.data;
|
448
|
+
else if (i.firstChild != null)
|
449
|
+
text += getText(i);
|
450
|
+
}
|
451
|
+
return text;
|
452
|
+
}
|
453
|
+
|
454
|
+
function TocEntry(el, text, toclevel) {
|
455
|
+
this.element = el;
|
456
|
+
this.text = text;
|
457
|
+
this.toclevel = toclevel;
|
458
|
+
}
|
459
|
+
|
460
|
+
function tocEntries(el, toclevels) {
|
461
|
+
var result = new Array;
|
462
|
+
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
|
463
|
+
// Function that scans the DOM tree for header elements (the DOM2
|
464
|
+
// nodeIterator API would be a better technique but not supported by all
|
465
|
+
// browsers).
|
466
|
+
var iterate = function (el) {
|
467
|
+
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
468
|
+
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
|
469
|
+
var mo = re.exec(i.tagName);
|
470
|
+
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
|
471
|
+
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
|
472
|
+
}
|
473
|
+
iterate(i);
|
474
|
+
}
|
389
475
|
}
|
390
476
|
}
|
477
|
+
iterate(el);
|
478
|
+
return result;
|
391
479
|
}
|
392
|
-
iterate(el);
|
393
|
-
return result;
|
394
|
-
}
|
395
480
|
|
396
|
-
// This function does the work. toclevels = 1..4.
|
397
|
-
function generateToc(toclevels) {
|
398
481
|
var toc = document.getElementById("toc");
|
399
|
-
var entries = tocEntries(document.
|
482
|
+
var entries = tocEntries(document.getElementById("content"), toclevels);
|
400
483
|
for (var i = 0; i < entries.length; ++i) {
|
401
484
|
var entry = entries[i];
|
402
485
|
if (entry.element.id == "")
|
403
|
-
entry.element.id = "
|
486
|
+
entry.element.id = "_toc_" + i;
|
404
487
|
var a = document.createElement("a");
|
405
488
|
a.href = "#" + entry.element.id;
|
406
489
|
a.appendChild(document.createTextNode(entry.text));
|
@@ -410,7 +493,58 @@ function generateToc(toclevels) {
|
|
410
493
|
toc.appendChild(div);
|
411
494
|
}
|
412
495
|
if (entries.length == 0)
|
413
|
-
|
496
|
+
toc.parentNode.removeChild(toc);
|
497
|
+
},
|
498
|
+
|
499
|
+
|
500
|
+
/////////////////////////////////////////////////////////////////////
|
501
|
+
// Footnotes generator
|
502
|
+
/////////////////////////////////////////////////////////////////////
|
503
|
+
|
504
|
+
/* Based on footnote generation code from:
|
505
|
+
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
|
506
|
+
*/
|
507
|
+
|
508
|
+
footnotes: function () {
|
509
|
+
var cont = document.getElementById("content");
|
510
|
+
var noteholder = document.getElementById("footnotes");
|
511
|
+
var spans = cont.getElementsByTagName("span");
|
512
|
+
var refs = {};
|
513
|
+
var n = 0;
|
514
|
+
for (i=0; i<spans.length; i++) {
|
515
|
+
if (spans[i].className == "footnote") {
|
516
|
+
n++;
|
517
|
+
// Use [\s\S] in place of . so multi-line matches work.
|
518
|
+
// Because JavaScript has no s (dotall) regex flag.
|
519
|
+
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
|
520
|
+
noteholder.innerHTML +=
|
521
|
+
"<div class='footnote' id='_footnote_" + n + "'>" +
|
522
|
+
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
|
523
|
+
n + "</a>. " + note + "</div>";
|
524
|
+
spans[i].innerHTML =
|
525
|
+
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
|
526
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
527
|
+
var id =spans[i].getAttribute("id");
|
528
|
+
if (id != null) refs["#"+id] = n;
|
529
|
+
}
|
530
|
+
}
|
531
|
+
if (n == 0)
|
532
|
+
noteholder.parentNode.removeChild(noteholder);
|
533
|
+
else {
|
534
|
+
// Process footnoterefs.
|
535
|
+
for (i=0; i<spans.length; i++) {
|
536
|
+
if (spans[i].className == "footnoteref") {
|
537
|
+
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
|
538
|
+
href = href.match(/#.*/)[0]; // Because IE return full URL.
|
539
|
+
n = refs[href];
|
540
|
+
spans[i].innerHTML =
|
541
|
+
"[<a href='#_footnote_" + n +
|
542
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
543
|
+
}
|
544
|
+
}
|
545
|
+
}
|
546
|
+
}
|
547
|
+
|
414
548
|
}
|
415
549
|
/*]]>*/
|
416
550
|
</script>
|
@@ -423,6 +557,7 @@ function generateToc(toclevels) {
|
|
423
557
|
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
|
424
558
|
</div>
|
425
559
|
</div>
|
560
|
+
<div id="content">
|
426
561
|
<div id="preamble">
|
427
562
|
<div class="sectionbody">
|
428
563
|
<div class="paragraph"><p><span class="image">
|
@@ -483,7 +618,7 @@ or
|
|
483
618
|
</div>
|
484
619
|
<h2 id="_installing_upgrading_and_uninstalling_phusion_passenger">2. Installing, upgrading and uninstalling Phusion Passenger</h2>
|
485
620
|
<div class="sectionbody">
|
486
|
-
<h3 id="_generic_installation_instructions">2.1. Generic installation instructions</h3>
|
621
|
+
<h3 id="_generic_installation_instructions">2.1. Generic installation instructions</h3><div style="clear:left"></div>
|
487
622
|
<h4 id="install_passenger">2.1.1. Overview of installation methods</h4>
|
488
623
|
<div class="paragraph"><p>There are three ways to install Phusion Passenger:</p></div>
|
489
624
|
<div class="olist arabic"><ol class="arabic">
|
@@ -664,7 +799,7 @@ configuration file, but it doesn’t copy any files around.</p></div>
|
|
664
799
|
<div class="paragraph"><p><tt>passenger-install-apache2-module</tt> is actually just a user-friendly frontend
|
665
800
|
around the command <tt>rake apache2</tt>, which performs the actual compilation of
|
666
801
|
Phusion Passenger.</p></div>
|
667
|
-
<h3 id="_operating_system_specific_instructions_and_information">2.2. Operating system-specific instructions and information</h3>
|
802
|
+
<h3 id="_operating_system_specific_instructions_and_information">2.2. Operating system-specific instructions and information</h3><div style="clear:left"></div>
|
668
803
|
<h4 id="_macos_x">2.2.1. MacOS X</h4>
|
669
804
|
<div class="paragraph"><p>Ben Ruebenstein has written an excellent
|
670
805
|
<a href="http://benr75.com/articles/2008/04/12/setup-mod_rails-phusion-mac-os-x-leopard">tutorial
|
@@ -674,7 +809,7 @@ on installing Phusion Passenger on OS X</a>.</p></div>
|
|
674
809
|
<h4 id="_opensolaris">2.2.3. OpenSolaris</h4>
|
675
810
|
<div class="paragraph"><p>J Aaron Farr has written a <a href="http://cubiclemuses.com/cm/articles/2009/04/09/rails-passenger-open-solaris-ec2/">guide</a>
|
676
811
|
about setting up Ruby on Rails and Phusion Passenger on OpenSolaris and EC2.</p></div>
|
677
|
-
<h3 id="_upgrading_or_downgrading_phusion_passenger">2.3. Upgrading or downgrading Phusion Passenger</h3>
|
812
|
+
<h3 id="_upgrading_or_downgrading_phusion_passenger">2.3. Upgrading or downgrading Phusion Passenger</h3><div style="clear:left"></div>
|
678
813
|
<h4 id="_via_a_gem_or_a_source_tarball">2.3.1. Via a gem or a source tarball</h4>
|
679
814
|
<div class="paragraph"><p>To ugrade or downgrade Phusion Passenger via the gem or the source tarball, install the newer
|
680
815
|
or older version as you normally would; that is, install the gem or unpack the tarball, and
|
@@ -694,7 +829,7 @@ the new ones that the installer outputs.</p></div>
|
|
694
829
|
<h4 id="_via_a_native_linux_package">2.3.2. Via a native Linux package</h4>
|
695
830
|
<div class="paragraph"><p>There are no special instructions required to upgrade or downgrade Phusion Passenger
|
696
831
|
via a native Linux package.</p></div>
|
697
|
-
<h3 id="_unloading_disabling_phusion_passenger_from_apache_without_uninstalling_it">2.4. Unloading (disabling) Phusion Passenger from Apache without uninstalling it</h3>
|
832
|
+
<h3 id="_unloading_disabling_phusion_passenger_from_apache_without_uninstalling_it">2.4. Unloading (disabling) Phusion Passenger from Apache without uninstalling it</h3><div style="clear:left"></div>
|
698
833
|
<div class="paragraph"><p>You can temporarily unload (disable) Phusion Passenger from Apache, without
|
699
834
|
uninstalling the Phusion Passenger files, so that Apache behaves as if Phusion
|
700
835
|
Passenger was never installed in the first place. This might be useful to you if,
|
@@ -754,7 +889,7 @@ NameVirtualHosts *:80
|
|
754
889
|
</VirtualHost></tt></pre>
|
755
890
|
</div></div>
|
756
891
|
<div class="paragraph"><p>After you’ve done this, save the file and restart Apache.</p></div>
|
757
|
-
<h3 id="_uninstalling_phusion_passenger">2.5. Uninstalling Phusion Passenger</h3>
|
892
|
+
<h3 id="_uninstalling_phusion_passenger">2.5. Uninstalling Phusion Passenger</h3><div style="clear:left"></div>
|
758
893
|
<div class="paragraph"><p>To uninstall Phusion Passenger, please first remove all Phusion Passenger
|
759
894
|
configuration directives from your Apache configuration file(s). After you’ve
|
760
895
|
done this, you need to remove the Phusion Passenger files.</p></div>
|
@@ -797,7 +932,7 @@ are run, is “production”. You can change this by changing the
|
|
797
932
|
<a href="#rails_env"><em>RailsEnv</em></a> configuration option.</td>
|
798
933
|
</tr></table>
|
799
934
|
</div>
|
800
|
-
<h3 id="_deploying_to_a_virtual_host_8217_s_root">3.1. Deploying to a virtual host’s root</h3>
|
935
|
+
<h3 id="_deploying_to_a_virtual_host_8217_s_root">3.1. Deploying to a virtual host’s root</h3><div style="clear:left"></div>
|
801
936
|
<div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
|
802
937
|
following conditions are met:</p></div>
|
803
938
|
<div class="ulist"><ul>
|
@@ -850,7 +985,7 @@ all parent folders. That is, /webapps/mycook and /webapps must also be readable
|
|
850
985
|
</li>
|
851
986
|
</ul></div>
|
852
987
|
<div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
|
853
|
-
<h3 id="deploying_rails_to_sub_uri">3.2. Deploying to a sub URI</h3>
|
988
|
+
<h3 id="deploying_rails_to_sub_uri">3.2. Deploying to a sub URI</h3><div style="clear:left"></div>
|
854
989
|
<div class="paragraph"><p>Suppose that you already have a virtual host:</p></div>
|
855
990
|
<div class="listingblock">
|
856
991
|
<div class="content">
|
@@ -933,7 +1068,7 @@ for more information.</td>
|
|
933
1068
|
</td>
|
934
1069
|
</tr></table>
|
935
1070
|
</div>
|
936
|
-
<h3 id="_redeploying_restarting_the_ruby_on_rails_application">3.3. Redeploying (restarting the Ruby on Rails application)</h3>
|
1071
|
+
<h3 id="_redeploying_restarting_the_ruby_on_rails_application">3.3. Redeploying (restarting the Ruby on Rails application)</h3><div style="clear:left"></div>
|
937
1072
|
<div class="paragraph"><p>Deploying a new version of a Ruby on Rails application is as simple as
|
938
1073
|
re-uploading the application files, and restarting the application.</p></div>
|
939
1074
|
<div class="paragraph"><p>There are two ways to restart the application:</p></div>
|
@@ -961,12 +1096,12 @@ command line:</p></div>
|
|
961
1096
|
is not automatically deleted. Phusion Passenger checks whether the timestamp
|
962
1097
|
of this file has changed in order to determine whether the application should
|
963
1098
|
be restarted.</p></div>
|
964
|
-
<h3 id="_migrations">3.4. Migrations</h3>
|
1099
|
+
<h3 id="_migrations">3.4. Migrations</h3><div style="clear:left"></div>
|
965
1100
|
<div class="paragraph"><p>Phusion Passenger is not related to Ruby on Rails migrations in any way. To
|
966
1101
|
run migrations on your deployment server, please login to your deployment
|
967
1102
|
server (e.g. with <em>ssh</em>) and type <tt>rake db:migrate RAILS_ENV=production</tt> in
|
968
1103
|
a shell console, just like one would normally run migrations.</p></div>
|
969
|
-
<h3 id="_capistrano_integration">3.5. Capistrano integration</h3>
|
1104
|
+
<h3 id="_capistrano_integration">3.5. Capistrano integration</h3><div style="clear:left"></div>
|
970
1105
|
<div class="paragraph"><p>See <a href="#capistrano">Capistrano recipe</a>.</p></div>
|
971
1106
|
</div>
|
972
1107
|
<h2 id="_deploying_a_rack_based_ruby_application">4. Deploying a Rack-based Ruby application</h2>
|
@@ -1020,7 +1155,7 @@ are run, is “production”. You can change this by changing the
|
|
1020
1155
|
<a href="#rack_env"><em>RackEnv</em></a> configuration option.</td>
|
1021
1156
|
</tr></table>
|
1022
1157
|
</div>
|
1023
|
-
<h3 id="_tutorial_example_writing_and_deploying_a_hello_world_rack_application">4.1. Tutorial/example: writing and deploying a Hello World Rack application</h3>
|
1158
|
+
<h3 id="_tutorial_example_writing_and_deploying_a_hello_world_rack_application">4.1. Tutorial/example: writing and deploying a Hello World Rack application</h3><div style="clear:left"></div>
|
1024
1159
|
<div class="paragraph"><p>First we create a Phusion Passenger-compliant Rack directory structure:</p></div>
|
1025
1160
|
<div class="listingblock">
|
1026
1161
|
<div class="content">
|
@@ -1055,7 +1190,7 @@ the Apache configuration file:</p></div>
|
|
1055
1190
|
</div></div>
|
1056
1191
|
<div class="paragraph"><p>And we’re done! After an Apache restart, the above Rack application will be available
|
1057
1192
|
under the URL <em>http://www.rackexample.com/</em>.</p></div>
|
1058
|
-
<h3 id="_deploying_to_a_virtual_host_8217_s_root_2">4.2. Deploying to a virtual host’s root</h3>
|
1193
|
+
<h3 id="_deploying_to_a_virtual_host_8217_s_root_2">4.2. Deploying to a virtual host’s root</h3><div style="clear:left"></div>
|
1059
1194
|
<div class="paragraph"><p>Add a virtual host entry to your Apache configuration file. Make sure that the
|
1060
1195
|
following conditions are met:</p></div>
|
1061
1196
|
<div class="ulist"><ul>
|
@@ -1108,7 +1243,7 @@ all parent folders. That is, /webapps/rackapp and /webapps must also be readable
|
|
1108
1243
|
</li>
|
1109
1244
|
</ul></div>
|
1110
1245
|
<div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
|
1111
|
-
<h3 id="deploying_rack_to_sub_uri">4.3. Deploying to a sub URI</h3>
|
1246
|
+
<h3 id="deploying_rack_to_sub_uri">4.3. Deploying to a sub URI</h3><div style="clear:left"></div>
|
1112
1247
|
<div class="paragraph"><p>Suppose that you already have a virtual host:</p></div>
|
1113
1248
|
<div class="listingblock">
|
1114
1249
|
<div class="content">
|
@@ -1179,7 +1314,7 @@ MultiViews is disabled for this folder.
|
|
1179
1314
|
</td>
|
1180
1315
|
</tr></table>
|
1181
1316
|
</div>
|
1182
|
-
<h3 id="_redeploying_restarting_the_rack_application">4.4. Redeploying (restarting the Rack application)</h3>
|
1317
|
+
<h3 id="_redeploying_restarting_the_rack_application">4.4. Redeploying (restarting the Rack application)</h3><div style="clear:left"></div>
|
1183
1318
|
<div class="paragraph"><p>Deploying a new version of a Rack application is as simple as
|
1184
1319
|
re-uploading the application files, and restarting the application.</p></div>
|
1185
1320
|
<div class="paragraph"><p>There are two ways to restart the application:</p></div>
|
@@ -1203,7 +1338,7 @@ command line:</p></div>
|
|
1203
1338
|
<div class="content">
|
1204
1339
|
<pre><tt>touch /webapps/rackapp/tmp/restart.txt</tt></pre>
|
1205
1340
|
</div></div>
|
1206
|
-
<h3 id="_rackup_specifications_for_various_web_frameworks">4.5. Rackup specifications for various web frameworks</h3>
|
1341
|
+
<h3 id="_rackup_specifications_for_various_web_frameworks">4.5. Rackup specifications for various web frameworks</h3><div style="clear:left"></div>
|
1207
1342
|
<div class="paragraph"><p>This subsection shows example <em>config.ru</em> files for various web frameworks.</p></div>
|
1208
1343
|
<h4 id="_camping">4.5.1. Camping</h4>
|
1209
1344
|
<div class="listingblock">
|
@@ -1281,7 +1416,7 @@ run Sinatra::Application</tt></pre>
|
|
1281
1416
|
Nevertheless, the system administrator may be interested in changing
|
1282
1417
|
Phusion Passenger’s behavior. Phusion Passenger’s Apache module supports the
|
1283
1418
|
following configuration options:</p></div>
|
1284
|
-
<h3 id="_passengerroot_lt_directory_gt">5.1. PassengerRoot <directory></h3>
|
1419
|
+
<h3 id="_passengerroot_lt_directory_gt">5.1. PassengerRoot <directory></h3><div style="clear:left"></div>
|
1285
1420
|
<div class="paragraph"><p>The location to the Phusion Passenger root directory. This configuration option
|
1286
1421
|
is essential to Phusion Passenger, and allows Phusion Passenger to locate its own
|
1287
1422
|
data files. The correct value is given by the installer.</p></div>
|
@@ -1289,7 +1424,7 @@ data files. The correct value is given by the installer.</p></div>
|
|
1289
1424
|
this option as well. Please read
|
1290
1425
|
<a href="#moving_phusion_passenger">Moving Phusion Passenger to a different directory</a> for more information.</p></div>
|
1291
1426
|
<div class="paragraph"><p>This required option may only occur once, in the global server configuration.</p></div>
|
1292
|
-
<h3 id="_passengerloglevel_lt_integer_gt">5.2. PassengerLogLevel <integer></h3>
|
1427
|
+
<h3 id="_passengerloglevel_lt_integer_gt">5.2. PassengerLogLevel <integer></h3><div style="clear:left"></div>
|
1293
1428
|
<div class="paragraph"><p>This option allows one to specify how much information Phusion Passenger should
|
1294
1429
|
write to the Apache error log file. A higher log level value means that more
|
1295
1430
|
information will be logged.</p></div>
|
@@ -1320,11 +1455,11 @@ information will be logged.</p></div>
|
|
1320
1455
|
</ul></div>
|
1321
1456
|
<div class="paragraph"><p>This option may only occur once, in the global server configuration.
|
1322
1457
|
The default is <em>0</em>.</p></div>
|
1323
|
-
<h3 id="PassengerRuby">5.3. PassengerRuby <filename></h3>
|
1458
|
+
<h3 id="PassengerRuby">5.3. PassengerRuby <filename></h3><div style="clear:left"></div>
|
1324
1459
|
<div class="paragraph"><p>This option allows one to specify the Ruby interpreter to use.</p></div>
|
1325
1460
|
<div class="paragraph"><p>This option may only occur once, in the global server configuration.
|
1326
1461
|
The default is <em>ruby</em>.</p></div>
|
1327
|
-
<h3 id="PassengerAppRoot">5.4. PassengerAppRoot <path/to/root></h3>
|
1462
|
+
<h3 id="PassengerAppRoot">5.4. PassengerAppRoot <path/to/root></h3><div style="clear:left"></div>
|
1328
1463
|
<div class="paragraph"><p>By default, Phusion Passenger assumes that the application’s root directory
|
1329
1464
|
is the parent directory of the <em>public</em> directory. This option allows one to
|
1330
1465
|
specify the application’s root independently from the DocumentRoot, which
|
@@ -1363,7 +1498,7 @@ In <em>.htaccess</em>, if <tt>AllowOverride Options</tt> is on.
|
|
1363
1498
|
# root is "/var/rails/zena/sites/example.com"
|
1364
1499
|
</VirtualHost></tt></pre>
|
1365
1500
|
</div></div>
|
1366
|
-
<h3 id="PassengerUseGlobalQueue">5.5. PassengerUseGlobalQueue <on|off></h3>
|
1501
|
+
<h3 id="PassengerUseGlobalQueue">5.5. PassengerUseGlobalQueue <on|off></h3><div style="clear:left"></div>
|
1367
1502
|
<div class="paragraph"><p>Turns the use of global queuing on or off.</p></div>
|
1368
1503
|
<div class="paragraph"><p>This option may occur in the following places:</p></div>
|
1369
1504
|
<div class="ulist"><ul>
|
@@ -1452,17 +1587,17 @@ process that becomes available will take from the queue, and so this
|
|
1452
1587
|
<div class="paragraph"><p>Turning global queuing off will yield a minor performance improvement (about 5%,
|
1453
1588
|
depending on how fast/slow your web application is), which is why it’s off by
|
1454
1589
|
default.</p></div>
|
1455
|
-
<h3 id="PassengerUserSwitching">5.6. PassengerUserSwitching <on|off></h3>
|
1590
|
+
<h3 id="PassengerUserSwitching">5.6. PassengerUserSwitching <on|off></h3><div style="clear:left"></div>
|
1456
1591
|
<div class="paragraph"><p>Whether to enable <a href="#user_switching">user switching support</a>.</p></div>
|
1457
1592
|
<div class="paragraph"><p>This option may only occur once, in the global server configuration.
|
1458
1593
|
The default value is <em>on</em>.</p></div>
|
1459
|
-
<h3 id="PassengerDefaultUser">5.7. PassengerDefaultUser <username></h3>
|
1594
|
+
<h3 id="PassengerDefaultUser">5.7. PassengerDefaultUser <username></h3><div style="clear:left"></div>
|
1460
1595
|
<div class="paragraph"><p>Phusion Passenger enables <a href="#user_switching">user switching support</a> by default.
|
1461
1596
|
This configuration option allows one to specify which user Rails/Rack
|
1462
1597
|
applications must run as, if user switching fails or is disabled.</p></div>
|
1463
1598
|
<div class="paragraph"><p>This option may only occur once, in the global server configuration.
|
1464
1599
|
The default value is <em>nobody</em>.</p></div>
|
1465
|
-
<h3 id="_passengerenabled_lt_on_off_gt">5.8. PassengerEnabled <on|off></h3>
|
1600
|
+
<h3 id="_passengerenabled_lt_on_off_gt">5.8. PassengerEnabled <on|off></h3><div style="clear:left"></div>
|
1466
1601
|
<div class="paragraph"><p>You can set this option to <em>off</em> to completely disable Phusion Passenger for
|
1467
1602
|
a certain location. This is useful if, for example, you want to integrate a PHP
|
1468
1603
|
application into the same virtual host as a Rails application.</p></div>
|
@@ -1506,7 +1641,7 @@ In <em>.htaccess</em>.
|
|
1506
1641
|
</li>
|
1507
1642
|
</ul></div>
|
1508
1643
|
<div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>on</em>.</p></div>
|
1509
|
-
<h3 id="PassengerTempDir">5.9. PassengerTempDir <directory></h3>
|
1644
|
+
<h3 id="PassengerTempDir">5.9. PassengerTempDir <directory></h3><div style="clear:left"></div>
|
1510
1645
|
<div class="paragraph"><p>Specifies the directory that Phusion Passenger should use for storing temporary
|
1511
1646
|
files. This includes things such as Unix socket files, buffered file uploads
|
1512
1647
|
(see also <a href="#PassengerUploadBufferDir">PassengerUploadBufferDir</a>), etc.</p></div>
|
@@ -1529,7 +1664,7 @@ environment variable, like this:</p></div>
|
|
1529
1664
|
sudo -E passenger-status
|
1530
1665
|
# The -E option tells 'sudo' to preserve environment variables.</tt></pre>
|
1531
1666
|
</div></div>
|
1532
|
-
<h3 id="PassengerUploadBufferDir">5.10. PassengerUploadBufferDir <directory></h3>
|
1667
|
+
<h3 id="PassengerUploadBufferDir">5.10. PassengerUploadBufferDir <directory></h3><div style="clear:left"></div>
|
1533
1668
|
<div class="paragraph"><p>Phusion Passenger buffers large file uploads to disk in order prevent slow file
|
1534
1669
|
uploads from blocking web applications. By default, a subdirectory in the
|
1535
1670
|
system’s temporary files directory (or a subdirectory in the directory specified
|
@@ -1570,7 +1705,7 @@ In <em>.htaccess</em>, if <tt>AllowOverrides Options</tt> is enabled.
|
|
1570
1705
|
</li>
|
1571
1706
|
</ul></div>
|
1572
1707
|
<div class="paragraph"><p>In each place, it may be specified at most once.</p></div>
|
1573
|
-
<h3 id="_passengerrestartdir_lt_directory_gt">5.11. PassengerRestartDir <directory></h3>
|
1708
|
+
<h3 id="_passengerrestartdir_lt_directory_gt">5.11. PassengerRestartDir <directory></h3><div style="clear:left"></div>
|
1574
1709
|
<div class="paragraph"><p>As described in the deployment chapters of this document, Phusion Passenger
|
1575
1710
|
checks the file <em>tmp/restart.txt</em> in the applications'
|
1576
1711
|
<a href="#application_root">root directory</a> for restarting applications. Sometimes it
|
@@ -1638,7 +1773,7 @@ security flaw which allows an attacker to touch restart.txt, then that will
|
|
1638
1773
|
allow the attacker to cause a Denial-of-Service.</p></div>
|
1639
1774
|
<div class="paragraph"><p>You can prevent this from happening by pointing PassengerRestartDir to a
|
1640
1775
|
directory that’s readable by Apache, but only writable by administrators.</p></div>
|
1641
|
-
<h3 id="_resource_control_and_optimization_options">5.12. Resource control and optimization options</h3>
|
1776
|
+
<h3 id="_resource_control_and_optimization_options">5.12. Resource control and optimization options</h3><div style="clear:left"></div>
|
1642
1777
|
<h4 id="_passengermaxpoolsize_lt_integer_gt">5.12.1. PassengerMaxPoolSize <integer></h4>
|
1643
1778
|
<div class="paragraph"><p>The maximum number of Ruby on Rails or Rack application instances that may
|
1644
1779
|
be simultaneously active. A larger number results in higher memory usage,
|
@@ -1866,7 +2001,7 @@ then you can enable high performance mode for a certain URL only. For example:</
|
|
1866
2001
|
</div></div>
|
1867
2002
|
<div class="paragraph"><p>This enables high performance mode for
|
1868
2003
|
<a href="http://www.foo.com/chatroom/ajax_update_poll">http://www.foo.com/chatroom/ajax_update_poll</a> only.</p></div>
|
1869
|
-
<h3 id="_compatibility_options">5.13. Compatibility options</h3>
|
2004
|
+
<h3 id="_compatibility_options">5.13. Compatibility options</h3><div style="clear:left"></div>
|
1870
2005
|
<h4 id="PassengerResolveSymlinksInDocumentRoot">5.13.1. PassengerResolveSymlinksInDocumentRoot <on|off></h4>
|
1871
2006
|
<div class="paragraph"><p>Configures whether Phusion Passenger should resolve symlinks in the document root.
|
1872
2007
|
Please refer to <a href="#application_detection">How Phusion Passenger detects whether a virtual host is a web application</a> for more information.</p></div>
|
@@ -1959,7 +2094,7 @@ accessing <a href="http://www.example.com/about">http://www.example.com/about</a
|
|
1959
2094
|
<a href="http://www.example.com/info/about">http://www.example.com/info/about</a>. Notice that PassengerAllowEncodedSlashes only
|
1960
2095
|
interferes with passthrough rules, not with any other mod_rewrite rules. The rules for
|
1961
2096
|
displaying maintenance.html will work fine even for URLs starting with "/users".</p></div>
|
1962
|
-
<h3 id="_ruby_on_rails_specific_options">5.14. Ruby on Rails-specific options</h3>
|
2097
|
+
<h3 id="_ruby_on_rails_specific_options">5.14. Ruby on Rails-specific options</h3><div style="clear:left"></div>
|
1963
2098
|
<h4 id="_railsautodetect_lt_on_off_gt">5.14.1. RailsAutoDetect <on|off></h4>
|
1964
2099
|
<div class="paragraph"><p>Whether Phusion Passenger should automatically detect whether a virtual host’s
|
1965
2100
|
document root is a Ruby on Rails application. The default is <em>on</em>.</p></div>
|
@@ -2053,7 +2188,7 @@ In <em>.htaccess</em>, if <tt>AllowOverride Options</tt> is on.
|
|
2053
2188
|
<div class="paragraph"><p>This subsection attempts to describe spawn methods, but it’s okay if you don’t (want to)
|
2054
2189
|
understand it, as it’s mostly a technical detail. You can basically follow this rule of thumb:</p></div>
|
2055
2190
|
<div class="sidebarblock">
|
2056
|
-
<div class="content">
|
2191
|
+
<div class="sidebar-content">
|
2057
2192
|
<div class="paragraph"><p>If your application works on Mongrel, but not on Phusion Passenger, then set
|
2058
2193
|
<tt>RailsSpawnMethod</tt> to <em>conservative</em>. Otherwise, leave it at <em>smart-lv2</em> (the default).</p></div>
|
2059
2194
|
</div></div>
|
@@ -2189,7 +2324,7 @@ In a virtual host configuration block.
|
|
2189
2324
|
</li>
|
2190
2325
|
</ul></div>
|
2191
2326
|
<div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>600</em> (10 minutes).</p></div>
|
2192
|
-
<h3 id="_rack_specific_options">5.15. Rack-specific options</h3>
|
2327
|
+
<h3 id="_rack_specific_options">5.15. Rack-specific options</h3><div style="clear:left"></div>
|
2193
2328
|
<h4 id="_rackautodetect_lt_on_off_gt">5.15.1. RackAutoDetect <on|off></h4>
|
2194
2329
|
<div class="paragraph"><p>Whether Phusion Passenger should automatically detect whether a virtual host’s
|
2195
2330
|
document root is a Rack application. The default is <em>on</em>.</p></div>
|
@@ -2274,7 +2409,7 @@ In <em>.htaccess</em>, if <tt>AllowOverride Options</tt> is on.
|
|
2274
2409
|
</li>
|
2275
2410
|
</ul></div>
|
2276
2411
|
<div class="paragraph"><p>In each place, it may be specified at most once. The default value is <em>production</em>.</p></div>
|
2277
|
-
<h3 id="_deprecated_options">5.16. Deprecated options</h3>
|
2412
|
+
<h3 id="_deprecated_options">5.16. Deprecated options</h3><div style="clear:left"></div>
|
2278
2413
|
<div class="paragraph"><p>The following options have been deprecated, but are still supported for backwards
|
2279
2414
|
compatibility reasons.</p></div>
|
2280
2415
|
<h4 id="_railsruby">5.16.1. RailsRuby</h4>
|
@@ -2288,11 +2423,11 @@ compatibility reasons.</p></div>
|
|
2288
2423
|
</div>
|
2289
2424
|
<h2 id="_troubleshooting">6. Troubleshooting</h2>
|
2290
2425
|
<div class="sectionbody">
|
2291
|
-
<h3 id="_operating_system_specific_problems">6.1. Operating system-specific problems</h3>
|
2426
|
+
<h3 id="_operating_system_specific_problems">6.1. Operating system-specific problems</h3><div style="clear:left"></div>
|
2292
2427
|
<h4 id="_macos_x_the_installer_cannot_locate_mamp_8217_s_apache">6.1.1. MacOS X: The installer cannot locate MAMP’s Apache</h4>
|
2293
2428
|
<div class="sidebarblock">
|
2294
|
-
<div class="content">
|
2295
|
-
<div class="title">Symptoms</div>
|
2429
|
+
<div class="sidebar-content">
|
2430
|
+
<div class="sidebar-title">Symptoms</div>
|
2296
2431
|
<div class="paragraph"><p>The installer finds Apache 2 development headers at <tt>/Applications/MAMP/Library/bin/apxs</tt>.
|
2297
2432
|
However, Apache cannot be found. The installer also outputs the following error:</p></div>
|
2298
2433
|
<div class="listingblock">
|
@@ -2305,11 +2440,11 @@ No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.</tt><
|
|
2305
2440
|
Please read <a href="http://forum.mamp.info/viewtopic.php?t=1866">this forum topic</a> to learn how
|
2306
2441
|
to fix this problem.</p></div>
|
2307
2442
|
<div class="paragraph"><p>See also <a href="http://code.google.com/p/phusion-passenger/issues/detail?id=12">this bug report</a>.</p></div>
|
2308
|
-
<h3 id="_problems_during_installation">6.2. Problems during installation</h3>
|
2443
|
+
<h3 id="_problems_during_installation">6.2. Problems during installation</h3><div style="clear:left"></div>
|
2309
2444
|
<h4 id="installing_ruby_dev">6.2.1. Ruby development headers aren’t installed</h4>
|
2310
2445
|
<div class="sidebarblock">
|
2311
|
-
<div class="content">
|
2312
|
-
<div class="title">Symptoms</div>
|
2446
|
+
<div class="sidebar-content">
|
2447
|
+
<div class="sidebar-title">Symptoms</div>
|
2313
2448
|
<div class="paragraph"><p>Installing Phusion Passenger fails because of one of the following errors:</p></div>
|
2314
2449
|
<div class="ulist"><ul>
|
2315
2450
|
<li>
|
@@ -2320,12 +2455,12 @@ The Phusion Passenger installer tells you that the Ruby development headers
|
|
2320
2455
|
</li>
|
2321
2456
|
<li>
|
2322
2457
|
<p>
|
2323
|
-
The error message “
|
2458
|
+
The error message “'no such file to load — mkmf”' occurs.
|
2324
2459
|
</p>
|
2325
2460
|
</li>
|
2326
2461
|
<li>
|
2327
2462
|
<p>
|
2328
|
-
The error message “
|
2463
|
+
The error message “'ruby.h: No such file or directory”' occurs.
|
2329
2464
|
</p>
|
2330
2465
|
</li>
|
2331
2466
|
</ul></div>
|
@@ -2401,8 +2536,8 @@ which Ruby installation you want to use. Please read
|
|
2401
2536
|
</div>
|
2402
2537
|
<h4 id="_apache_development_headers_aren_8217_t_installed">6.2.2. Apache development headers aren’t installed</h4>
|
2403
2538
|
<div class="sidebarblock">
|
2404
|
-
<div class="content">
|
2405
|
-
<div class="title">Symptoms</div>
|
2539
|
+
<div class="sidebar-content">
|
2540
|
+
<div class="sidebar-title">Symptoms</div>
|
2406
2541
|
<div class="paragraph"><p>Installing Phusion Passenger fails because of one of the following errors:</p></div>
|
2407
2542
|
<div class="ulist"><ul>
|
2408
2543
|
<li>
|
@@ -2412,7 +2547,7 @@ The installer says that the Apache development headers aren’t installed.
|
|
2412
2547
|
</li>
|
2413
2548
|
<li>
|
2414
2549
|
<p>
|
2415
|
-
The error message “
|
2550
|
+
The error message “'httpd.h: No such file or directory”' occurs.
|
2416
2551
|
</p>
|
2417
2552
|
<div class="paragraph"><p>(Instead of <em>httpd.h</em>, the message might also be <em>http_config.h</em> or something
|
2418
2553
|
else similar to <em>http_*.h</em>.)</p></div>
|
@@ -2486,8 +2621,8 @@ Other operating systems
|
|
2486
2621
|
</dl></div>
|
2487
2622
|
<h4 id="_apr_development_headers_aren_8217_t_installed">6.2.3. APR development headers aren’t installed</h4>
|
2488
2623
|
<div class="sidebarblock">
|
2489
|
-
<div class="content">
|
2490
|
-
<div class="title">Symptoms</div>
|
2624
|
+
<div class="sidebar-content">
|
2625
|
+
<div class="sidebar-title">Symptoms</div>
|
2491
2626
|
<div class="paragraph"><p>Installing Phusion Passenger fails because one of the following errors:</p></div>
|
2492
2627
|
<div class="ulist"><ul>
|
2493
2628
|
<li>
|
@@ -2497,12 +2632,12 @@ The installer tells you that APR development headers aren’t installed.
|
|
2497
2632
|
</li>
|
2498
2633
|
<li>
|
2499
2634
|
<p>
|
2500
|
-
The error message “
|
2635
|
+
The error message “'apr_pools.h: No such file or directory”' occurs.
|
2501
2636
|
</p>
|
2502
2637
|
</li>
|
2503
2638
|
<li>
|
2504
2639
|
<p>
|
2505
|
-
The error message “
|
2640
|
+
The error message “'apr_strings.h: No such file or directory”' occurs.
|
2506
2641
|
</p>
|
2507
2642
|
</li>
|
2508
2643
|
</ul></div>
|
@@ -2568,7 +2703,7 @@ Other operating systems
|
|
2568
2703
|
<div class="paragraph"><p>Please <a href="#specifying_correct_apache_install">Specifying the correct Apache installation</a>, and re-run the Phusion Passenger installer.</p></div>
|
2569
2704
|
<h4 id="_phusion_passenger_is_using_the_wrong_ruby_during_installation">6.2.5. Phusion Passenger is using the wrong Ruby during installation</h4>
|
2570
2705
|
<div class="paragraph"><p>Please <a href="#specifying_ruby_installation">Specifying the correct Ruby installation</a>, and re-run the Phusion Passenger installer.</p></div>
|
2571
|
-
<h3 id="_problems_after_installation">6.3. Problems after installation</h3>
|
2706
|
+
<h3 id="_problems_after_installation">6.3. Problems after installation</h3><div style="clear:left"></div>
|
2572
2707
|
<div class="admonitionblock">
|
2573
2708
|
<table><tr>
|
2574
2709
|
<td class="icon">
|
@@ -2586,10 +2721,10 @@ inside the Apache error logs. It will tell you what exactly went wrong.</p></div
|
|
2586
2721
|
<div class="paragraph"><p>Please try setting <a href="#RailsSpawnMethod">RailsSpawnMethod</a> to <em>conservative</em>.</p></div>
|
2587
2722
|
<h4 id="_phusion_passenger_has_been_compiled_against_the_wrong_apache_installation">6.3.2. Phusion Passenger has been compiled against the wrong Apache installation</h4>
|
2588
2723
|
<div class="sidebarblock">
|
2589
|
-
<div class="content">
|
2590
|
-
<div class="title">Symptoms</div>
|
2724
|
+
<div class="sidebar-content">
|
2725
|
+
<div class="sidebar-title">Symptoms</div>
|
2591
2726
|
<div class="paragraph"><p>Apache crashes during startup (after being daemonized). The Apache error log
|
2592
|
-
says “
|
2727
|
+
says “'seg fault or similar nasty error detected in the parent process”'.</p></div>
|
2593
2728
|
</div></div>
|
2594
2729
|
<div class="paragraph"><p>This problem is most likely to occur on MacOS X. Most OS X users have multiple
|
2595
2730
|
Apache installations on their system.</p></div>
|
@@ -2699,7 +2834,7 @@ following command to give your Rails application folder that context:</p></div>
|
|
2699
2834
|
<div class="content">
|
2700
2835
|
<pre><tt>chcon -R -h -t httpd_sys_content_t /path/to/your/rails/app</tt></pre>
|
2701
2836
|
</div></div>
|
2702
|
-
<h3 id="conflicting_apache_modules">6.4. Conflicting Apache modules</h3>
|
2837
|
+
<h3 id="conflicting_apache_modules">6.4. Conflicting Apache modules</h3><div style="clear:left"></div>
|
2703
2838
|
<h4 id="_mod_userdir">6.4.1. mod_userdir</h4>
|
2704
2839
|
<div class="paragraph"><p><em>mod_userdir</em> is not compatible with Phusion Passenger at the moment.</p></div>
|
2705
2840
|
<h4 id="_multiviews_mod_negotiation">6.4.2. MultiViews (mod_negotiation)</h4>
|
@@ -2712,7 +2847,7 @@ for all Phusion Passenger hosts.</p></div>
|
|
2712
2847
|
<div class="sectionbody">
|
2713
2848
|
<div class="paragraph"><p>Phusion Passenger provides a set of tools, which are useful for system analysis,
|
2714
2849
|
maintenance and troubleshooting.</p></div>
|
2715
|
-
<h3 id="_inspecting_memory_usage">7.1. Inspecting memory usage</h3>
|
2850
|
+
<h3 id="_inspecting_memory_usage">7.1. Inspecting memory usage</h3><div style="clear:left"></div>
|
2716
2851
|
<div class="paragraph"><p>Process inspection tools such as <tt>ps</tt> and <tt>top</tt> are useful, but they
|
2717
2852
|
<a href="http://groups.google.com/group/phusion-passenger/msg/1fd1c233456d3180">rarely show the correct memory usage</a>.
|
2718
2853
|
The real memory usage is usually lower than what <tt>ps</tt> and <tt>top</tt> report.</p></div>
|
@@ -2762,7 +2897,7 @@ don’t provide facilities for determining processes' private dirty RSS. On
|
|
2762
2897
|
the Resident Set Size is reported instead.</td>
|
2763
2898
|
</tr></table>
|
2764
2899
|
</div>
|
2765
|
-
<h3 id="_inspecting_phusion_passenger_8217_s_internal_status">7.2. Inspecting Phusion Passenger’s internal status</h3>
|
2900
|
+
<h3 id="_inspecting_phusion_passenger_8217_s_internal_status">7.2. Inspecting Phusion Passenger’s internal status</h3><div style="clear:left"></div>
|
2766
2901
|
<div class="paragraph"><p>One can inspect Phusion Passenger’s internal status with the tool <tt>passenger-status</tt>.
|
2767
2902
|
This tool must typically be run as root. For example:</p></div>
|
2768
2903
|
<div class="listingblock">
|
@@ -2889,7 +3024,7 @@ Your application is frozen, i.e. has stopped responding. See
|
|
2889
3024
|
</p>
|
2890
3025
|
</li>
|
2891
3026
|
</ol></div>
|
2892
|
-
<h3 id="debugging_frozen">7.3. Debugging frozen applications</h3>
|
3027
|
+
<h3 id="debugging_frozen">7.3. Debugging frozen applications</h3><div style="clear:left"></div>
|
2893
3028
|
<div class="paragraph"><p>If one of your application instances is frozen (stopped responding), then you
|
2894
3029
|
can figure out where it is frozen by killing it with <em>SIGABRT</em>. This will cause the
|
2895
3030
|
application to raise an exception, with a backtrace.</p></div>
|
@@ -2912,7 +3047,7 @@ will restart killed application instances, as if nothing bad happened.</td>
|
|
2912
3047
|
</div>
|
2913
3048
|
<h2 id="_tips">8. Tips</h2>
|
2914
3049
|
<div class="sectionbody">
|
2915
|
-
<h3 id="user_switching">8.1. User switching (security)</h3>
|
3050
|
+
<h3 id="user_switching">8.1. User switching (security)</h3><div style="clear:left"></div>
|
2916
3051
|
<div class="paragraph"><p>There is a problem that plagues most PHP web hosts, namely the fact that all PHP
|
2917
3052
|
applications are run in the same user context as the web server. So for
|
2918
3053
|
example, Joe’s PHP application will be able to read Jane’s PHP application’s
|
@@ -2951,12 +3086,12 @@ Under no circumstances will applications be run as <em>root</em>. If
|
|
2951
3086
|
<div class="paragraph"><p>User switching can be disabled with the
|
2952
3087
|
<a href="#PassengerUserSwitching">PassengerUserSwitching (Apache)</a>/<a href="#PassengerUserSwitching">passenger_user_switching (Nginx)</a>
|
2953
3088
|
option.</p></div>
|
2954
|
-
<h3 id="reducing_memory_usage">8.2. Reducing memory consumption of Ruby on Rails applications by 33%</h3>
|
3089
|
+
<h3 id="reducing_memory_usage">8.2. Reducing memory consumption of Ruby on Rails applications by 33%</h3><div style="clear:left"></div>
|
2955
3090
|
<div class="paragraph"><p>Is it possible to reduce memory consumption of your Rails applications by 33% on average,
|
2956
3091
|
by using <a href="http://www.rubyenterpriseedition.com/">Ruby Enterprise Edition</a>.
|
2957
3092
|
Please visit the website for details.</p></div>
|
2958
3093
|
<div class="paragraph"><p>Note that this feature does not apply to Rack applications.</p></div>
|
2959
|
-
<h3 id="capistrano">8.3. Capistrano recipe</h3>
|
3094
|
+
<h3 id="capistrano">8.3. Capistrano recipe</h3><div style="clear:left"></div>
|
2960
3095
|
<div class="paragraph"><p>Phusion Passenger can be combined with <a href="http://capify.org/">Capistrano</a>.
|
2961
3096
|
The following Capistrano recipe demonstrates Phusion Passenger support.
|
2962
3097
|
It assumes that you’re using Git as version control system.</p></div>
|
@@ -2988,7 +3123,7 @@ namespace :deploy do
|
|
2988
3123
|
end
|
2989
3124
|
end</tt></pre>
|
2990
3125
|
</div></div>
|
2991
|
-
<h3 id="moving_phusion_passenger">8.4. Moving Phusion Passenger to a different directory</h3>
|
3126
|
+
<h3 id="moving_phusion_passenger">8.4. Moving Phusion Passenger to a different directory</h3><div style="clear:left"></div>
|
2992
3127
|
<div class="paragraph"><p>It is possible to relocate the Phusion Passenger files to a different directory. It
|
2993
3128
|
involves two steps:</p></div>
|
2994
3129
|
<div class="olist arabic"><ol class="arabic">
|
@@ -3025,7 +3160,7 @@ Edit your Apache configuration file, and set:
|
|
3025
3160
|
</div></div>
|
3026
3161
|
</li>
|
3027
3162
|
</ol></div>
|
3028
|
-
<h3 id="_installing_multiple_ruby_on_rails_versions">8.5. Installing multiple Ruby on Rails versions</h3>
|
3163
|
+
<h3 id="_installing_multiple_ruby_on_rails_versions">8.5. Installing multiple Ruby on Rails versions</h3><div style="clear:left"></div>
|
3029
3164
|
<div class="paragraph"><p>Each Ruby on Rails applications that are going to be deployed may require a
|
3030
3165
|
specific Ruby on Rails version. You can install a specific version with
|
3031
3166
|
this command:</p></div>
|
@@ -3036,7 +3171,7 @@ this command:</p></div>
|
|
3036
3171
|
<div class="paragraph"><p>where <em>X.X.X</em> is the version number of Ruby on Rails.</p></div>
|
3037
3172
|
<div class="paragraph"><p>All of these versions will exist in parallel, and will not conflict with each
|
3038
3173
|
other. Phusion Passenger will automatically make use of the correct version.</p></div>
|
3039
|
-
<h3 id="_making_the_application_restart_after_each_request">8.6. Making the application restart after each request</h3>
|
3174
|
+
<h3 id="_making_the_application_restart_after_each_request">8.6. Making the application restart after each request</h3><div style="clear:left"></div>
|
3040
3175
|
<div class="paragraph"><p>In some situations it might be desirable to restart the web application after
|
3041
3176
|
each request, for example when developing a non-Rails application that doesn’t
|
3042
3177
|
support code reloading, or when developing a web framework.</p></div>
|
@@ -3057,7 +3192,7 @@ or when you’re not developing a Rails application and your web framework
|
|
3057
3192
|
does not support code reloading.</td>
|
3058
3193
|
</tr></table>
|
3059
3194
|
</div>
|
3060
|
-
<h3 id="sub_uri_deployment_uri_fix">8.7. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments</h3>
|
3195
|
+
<h3 id="sub_uri_deployment_uri_fix">8.7. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments</h3><div style="clear:left"></div>
|
3061
3196
|
<div class="paragraph"><p>Some people experience broken images and other broken static assets when they
|
3062
3197
|
deploy their application to a sub-URI (i.e. <em>http://mysite.com/railsapp/</em>).
|
3063
3198
|
The reason for this usually is that you used a
|
@@ -3092,10 +3227,10 @@ so that your images will always work no matter what sub-URI you’ve deploye
|
|
3092
3227
|
append a timestamp to the URI to better facilitate HTTP caching. For more information,
|
3093
3228
|
please refer to
|
3094
3229
|
<a href="http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html">the Rails API docs</a>.</p></div>
|
3095
|
-
<h3 id="_x_sendfile_support">8.8. X-Sendfile support</h3>
|
3230
|
+
<h3 id="_x_sendfile_support">8.8. X-Sendfile support</h3><div style="clear:left"></div>
|
3096
3231
|
<div class="paragraph"><p>Phusion Passenger does not provide X-Sendfile support by itself. Please install
|
3097
3232
|
<a href="http://tn123.ath.cx/mod_xsendfile/">mod_xsendfile</a> for X-Sendfile support.</p></div>
|
3098
|
-
<h3 id="_upload_progress">8.9. Upload progress</h3>
|
3233
|
+
<h3 id="_upload_progress">8.9. Upload progress</h3><div style="clear:left"></div>
|
3099
3234
|
<div class="paragraph"><p>Phusion Passenger does not provide upload progress support by itself. Please
|
3100
3235
|
try drogus’s <a href="http://github.com/drogus/apache-upload-progress-module/tree/master">
|
3101
3236
|
Apache upload progress module</a> instead.</p></div>
|
@@ -3105,7 +3240,7 @@ Apache upload progress module</a> instead.</p></div>
|
|
3105
3240
|
<div class="paragraph"><p>Phusion Passenger hides a lot of complexity for the end user (i.e. the web server
|
3106
3241
|
system administrator), but sometimes it is desirable to know what is going on.
|
3107
3242
|
This section describes a few things that Phusion Passenger does under the hood.</p></div>
|
3108
|
-
<h3 id="_static_assets_serving">9.1. Static assets serving</h3>
|
3243
|
+
<h3 id="_static_assets_serving">9.1. Static assets serving</h3><div style="clear:left"></div>
|
3109
3244
|
<div class="paragraph"><p>Phusion Passenger accelerates serving of static files. This means that, if an URI
|
3110
3245
|
maps to a file that exists, then Phusion Passenger will let Apache serve that file
|
3111
3246
|
directly, without hitting the web application.</p></div>
|
@@ -3122,7 +3257,7 @@ RewriteRule ^(.*)$ balancer://mongrel%{REQUEST_URI} [P,QSA,L]</tt></pre>
|
|
3122
3257
|
</div></div>
|
3123
3258
|
<div class="paragraph"><p>These kind of mod_rewrite rules are no longer required, and you can safely remove
|
3124
3259
|
them.</p></div>
|
3125
|
-
<h3 id="_page_caching_support">9.2. Page caching support</h3>
|
3260
|
+
<h3 id="_page_caching_support">9.2. Page caching support</h3><div style="clear:left"></div>
|
3126
3261
|
<div class="paragraph"><p>For each HTTP request, Phusion Passenger will automatically look for a corresponding
|
3127
3262
|
page cache file, and serve that if it exists. It does this by appending ".html" to
|
3128
3263
|
the filename that the URI normally maps to, and checking whether that file exists.
|
@@ -3156,7 +3291,7 @@ If <em>foo/bar.html</em> doesn’t exist either, then Phusion Passenger will
|
|
3156
3291
|
application uses a non-standard page cache directory, i.e. if it doesn’t cache to
|
3157
3292
|
the <em>public</em> directory. In that case you’ll need to use mod_rewrite to serve such
|
3158
3293
|
page cache files.</p></div>
|
3159
|
-
<h3 id="application_detection">9.3. How Phusion Passenger detects whether a virtual host is a web application</h3>
|
3294
|
+
<h3 id="application_detection">9.3. How Phusion Passenger detects whether a virtual host is a web application</h3><div style="clear:left"></div>
|
3160
3295
|
<div class="paragraph"><p>After you’ve read the deployment instructions you might wonder how Phusion Passenger
|
3161
3296
|
knows that the DocumentRoot points to a web application that Phusion Passenger is
|
3162
3297
|
able to serve, and how it knows what kind of web application it is (e.g. Rails or Rack).</p></div>
|
@@ -3221,7 +3356,7 @@ Attribution-Share Alike 3.0 Unported License</a>.</p></div>
|
|
3221
3356
|
</div>
|
3222
3357
|
<h2 id="_appendix_b_terminology">11. Appendix B: Terminology</h2>
|
3223
3358
|
<div class="sectionbody">
|
3224
|
-
<h3 id="application_root">11.1. Application root</h3>
|
3359
|
+
<h3 id="application_root">11.1. Application root</h3><div style="clear:left"></div>
|
3225
3360
|
<div class="paragraph"><p>The root directory of an application that’s served by Phusion Passenger.</p></div>
|
3226
3361
|
<div class="paragraph"><p>In case of Ruby on Rails applications, this is the directory that contains
|
3227
3362
|
<em>Rakefile</em>, <em>app/</em>, <em>config/</em>, <em>public/</em>, etc. In other words, the directory
|
@@ -3288,7 +3423,7 @@ processes.</p></div>
|
|
3288
3423
|
<div class="paragraph"><p>While this may sound simple, there’s not just one way to spawn worker processes.
|
3289
3424
|
Let’s go over the different spawning methods. For simplicity’s sake, let’s
|
3290
3425
|
assume that we’re only talking about Ruby on Rails applications.</p></div>
|
3291
|
-
<h3 id="_the_most_straightforward_and_traditional_way_conservative_spawning">12.1. The most straightforward and traditional way: conservative spawning</h3>
|
3426
|
+
<h3 id="_the_most_straightforward_and_traditional_way_conservative_spawning">12.1. The most straightforward and traditional way: conservative spawning</h3><div style="clear:left"></div>
|
3292
3427
|
<div class="paragraph"><p>Phusion Passenger could create a new Ruby process, which will then load the
|
3293
3428
|
Rails application along with the entire Rails framework. This process will then
|
3294
3429
|
enter an request handling main loop.</p></div>
|
@@ -3303,7 +3438,7 @@ programmers jargon, mongrel_cluster creates new Ruby processes by forking the
|
|
3303
3438
|
current process and exec()-ing a new Ruby interpreter. Phusion Passenger on the
|
3304
3439
|
other hand creates processes that reuse the already loaded Ruby interpreter. In
|
3305
3440
|
programmers jargon, Phusion Passenger calls fork(), but not exec().</p></div>
|
3306
|
-
<h3 id="_the_smart_spawning_method">12.2. The smart spawning method</h3>
|
3441
|
+
<h3 id="_the_smart_spawning_method">12.2. The smart spawning method</h3><div style="clear:left"></div>
|
3307
3442
|
<div class="admonitionblock">
|
3308
3443
|
<table><tr>
|
3309
3444
|
<td class="icon">
|
@@ -3317,7 +3452,7 @@ programmers jargon, Phusion Passenger calls fork(), but not exec().</p></div>
|
|
3317
3452
|
because each worker process has its own private copy of the Rails application
|
3318
3453
|
as well as the Rails framework. This wastes memory as well as startup time.</p></div>
|
3319
3454
|
<div class="paragraph"><p><span class="image">
|
3320
|
-
<img src="images/conservative_spawning.png" alt="Worker processes and conservative spawning"
|
3455
|
+
<img src="images/conservative_spawning.png" alt="Worker processes and conservative spawning" />
|
3321
3456
|
</span><br />
|
3322
3457
|
<em>Figure: Worker processes and conservative spawning. Each worker process has its
|
3323
3458
|
own private copy of the application code and Rails framework code.</em></p></div>
|
@@ -3410,7 +3545,7 @@ process).</p></div>
|
|
3410
3545
|
assuming that your Ruby interpreter is <a href="#reducing_memory_usage">copy-on-write friendly</a>.</p></div>
|
3411
3546
|
<div class="paragraph"><p>Of course, smart spawning is not without gotchas. But if you understand the
|
3412
3547
|
gotchas you can easily reap the benefits of smart spawning.</p></div>
|
3413
|
-
<h3 id="_smart_spawning_gotcha_1_unintential_file_descriptor_sharing">12.3. Smart spawning gotcha #1: unintential file descriptor sharing</h3>
|
3548
|
+
<h3 id="_smart_spawning_gotcha_1_unintential_file_descriptor_sharing">12.3. Smart spawning gotcha #1: unintential file descriptor sharing</h3><div style="clear:left"></div>
|
3414
3549
|
<div class="paragraph"><p>Because worker processes are created by forking from an ApplicationSpawner
|
3415
3550
|
server, it will share all file descriptors that are opened by the
|
3416
3551
|
ApplicationSpawner server. (This is part of the semantics of the Unix
|
@@ -3541,7 +3676,7 @@ data in the log file is interleaved.</p></div>
|
|
3541
3676
|
must synchronize write access via an inter-process synchronization mechanism,
|
3542
3677
|
such as file locks. Reopening the log file, like you would have done in the
|
3543
3678
|
Memcached example, doesn’t help.</p></div>
|
3544
|
-
<h3 id="_smart_spawning_gotcha_2_the_need_to_revive_threads">12.4. Smart spawning gotcha #2: the need to revive threads</h3>
|
3679
|
+
<h3 id="_smart_spawning_gotcha_2_the_need_to_revive_threads">12.4. Smart spawning gotcha #2: the need to revive threads</h3><div style="clear:left"></div>
|
3545
3680
|
<div class="paragraph"><p>Another part of the <em>fork()</em> system call’s semantics is the fact that threads
|
3546
3681
|
disappear after a fork call. So if you’ve created any threads in environment.rb,
|
3547
3682
|
then those threads will no longer be running in newly created worker process.
|
@@ -3562,7 +3697,7 @@ http://www.gnu.org/software/src-highlite -->
|
|
3562
3697
|
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
|
3563
3698
|
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
|
3564
3699
|
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span></tt></pre></div></div>
|
3565
|
-
<h3 id="_smart_spawning_gotcha_3_code_load_order">12.5. Smart spawning gotcha #3: code load order</h3>
|
3700
|
+
<h3 id="_smart_spawning_gotcha_3_code_load_order">12.5. Smart spawning gotcha #3: code load order</h3><div style="clear:left"></div>
|
3566
3701
|
<div class="paragraph"><p>This gotcha is only applicable to the <em>smart</em> spawn method, not the <em>smart-lv2</em>
|
3567
3702
|
spawn method.</p></div>
|
3568
3703
|
<div class="paragraph"><p>If your application expects the Rails framework to be not loaded during the
|
@@ -3579,9 +3714,11 @@ spawning is used, the patched version of <em>base.rb</em> is properly loaded. Wh
|
|
3579
3714
|
because it was already loaded, so a subsequent <tt>require "active_record/base"</tt>
|
3580
3715
|
has no effect.</p></div>
|
3581
3716
|
</div>
|
3717
|
+
</div>
|
3718
|
+
<div id="footnotes"><hr /></div>
|
3582
3719
|
<div id="footer">
|
3583
3720
|
<div id="footer-text">
|
3584
|
-
Last updated 2010-
|
3721
|
+
Last updated 2010-02-22 13:16:14 CEST
|
3585
3722
|
</div>
|
3586
3723
|
</div>
|
3587
3724
|
</body>
|