passenger 3.0.7 → 3.0.8
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 +27 -0
- data/README +1 -1
- data/bin/passenger-install-nginx-module +3 -1
- data/build/config.rb +2 -1
- data/build/cxx_tests.rb +7 -3
- data/build/documentation.rb +5 -40
- data/build/nginx.rb +0 -1
- data/build/packaging.rb +0 -6
- data/build/rake_extensions.rb +5 -0
- data/doc/Architectural overview.html +344 -77
- data/doc/Security of user switching support.html +338 -71
- data/doc/Users guide Apache with comments.html +4830 -0
- data/doc/Users guide Apache.html +695 -428
- data/doc/Users guide Apache.idmap.txt +80 -0
- data/doc/Users guide Apache.txt +5 -5
- data/doc/Users guide Nginx.html +591 -313
- data/doc/Users guide Nginx.txt +9 -3
- data/doc/Users guide Standalone.html +344 -77
- data/ext/boost/src/pthread/thread.cpp +1 -1
- data/ext/common/AccountsDatabase.h +1 -1
- data/ext/common/Constants.h +2 -2
- data/ext/common/Logging.h +2 -1
- data/ext/common/LoggingAgent/FilterSupport.h +107 -3
- data/ext/common/Session.h +1 -1
- data/ext/common/Utils.cpp +2 -0
- data/ext/common/Utils/Dechunker.h +232 -0
- data/ext/common/Utils/HttpHeaderBufferer.h +165 -0
- data/ext/common/Utils/StrIntUtils.cpp +51 -15
- data/ext/common/Utils/StrIntUtils.h +3 -0
- data/ext/common/Utils/StreamBoyerMooreHorspool.h +506 -0
- data/ext/nginx/Configuration.c +36 -282
- data/ext/nginx/ContentHandler.c +17 -0
- data/ext/nginx/HelperAgent.cpp +397 -39
- data/ext/oxt/tracable_exception.cpp +3 -1
- data/ext/ruby/extconf.rb +1 -0
- data/ext/ruby/passenger_native_support.c +3 -0
- data/helper-scripts/prespawn +113 -31
- data/lib/phusion_passenger.rb +2 -2
- data/lib/phusion_passenger/standalone/runtime_installer.rb +3 -2
- data/lib/phusion_passenger/standalone/start_command.rb +12 -12
- data/test/cxx/DechunkerTest.cpp +216 -0
- data/test/cxx/FilterSupportTest.cpp +31 -4
- data/test/cxx/HttpHeaderBuffererTest.cpp +203 -0
- data/test/cxx/UtilsTest.cpp +46 -3
- data/test/integration_tests/hello_world_rack_spec.rb +7 -0
- data/test/stub/rack/config.ru +6 -1
- data/test/stub/rails_apps/1.2/empty/public/dispatch.cgi +1 -1
- data/test/stub/rails_apps/1.2/empty/public/dispatch.fcgi +1 -1
- data/test/stub/rails_apps/1.2/empty/public/dispatch.rb +1 -1
- data/test/stub/rails_apps/2.0/empty/public/dispatch.cgi +1 -1
- data/test/stub/rails_apps/2.0/empty/public/dispatch.fcgi +1 -1
- data/test/stub/rails_apps/2.0/empty/public/dispatch.rb +1 -1
- data/test/stub/rails_apps/2.2/empty/public/dispatch.cgi +1 -1
- data/test/stub/rails_apps/2.2/empty/public/dispatch.fcgi +1 -1
- data/test/stub/rails_apps/2.2/empty/public/dispatch.rb +1 -1
- metadata +20 -403
- data/doc/Doxyfile +0 -241
- data/doc/cxxapi/AbstractSpawnManager_8h_source.html +0 -141
- data/doc/cxxapi/Account_8h_source.html +0 -206
- data/doc/cxxapi/AccountsDatabase_8h_source.html +0 -161
- data/doc/cxxapi/AgentBase_8h_source.html +0 -70
- data/doc/cxxapi/AgentsStarter_8h_source.html +0 -112
- data/doc/cxxapi/BCrypt_8h_source.html +0 -104
- data/doc/cxxapi/Blowfish_8h_source.html +0 -134
- data/doc/cxxapi/Bucket_8h_source.html +0 -118
- data/doc/cxxapi/Constants_8h_source.html +0 -79
- data/doc/cxxapi/ContentHandler_8h_source.html +0 -95
- data/doc/cxxapi/DirectoryMapper_8h_source.html +0 -311
- data/doc/cxxapi/EventedClient_8h_source.html +0 -733
- data/doc/cxxapi/EventedMessageServer_8h_source.html +0 -358
- data/doc/cxxapi/EventedServer_8h_source.html +0 -326
- data/doc/cxxapi/Exceptions_8h_source.html +0 -393
- data/doc/cxxapi/FileDescriptor_8h_source.html +0 -324
- data/doc/cxxapi/Hooks_8h_source.html +0 -76
- data/doc/cxxapi/HttpStatusExtractor_8h_source.html +0 -382
- data/doc/cxxapi/IniFile_8h_source.html +0 -527
- data/doc/cxxapi/Logging_8h_source.html +0 -796
- data/doc/cxxapi/MessageChannel_8h_source.html +0 -776
- data/doc/cxxapi/MessageClient_8h_source.html +0 -328
- data/doc/cxxapi/MessageReadersWriters_8h_source.html +0 -539
- data/doc/cxxapi/MessageServer_8h_source.html +0 -612
- data/doc/cxxapi/PoolOptions_8h_source.html +0 -549
- data/doc/cxxapi/Process_8h_source.html +0 -286
- data/doc/cxxapi/RandomGenerator_8h_source.html +0 -191
- data/doc/cxxapi/ResourceLocator_8h_source.html +0 -166
- data/doc/cxxapi/SafeLibev_8h_source.html +0 -180
- data/doc/cxxapi/ScgiRequestParser_8h_source.html +0 -406
- data/doc/cxxapi/ServerInstanceDir_8h_source.html +0 -378
- data/doc/cxxapi/Session_8h_source.html +0 -501
- data/doc/cxxapi/SpawnManager_8h_source.html +0 -647
- data/doc/cxxapi/StaticContentHandler_8h_source.html +0 -69
- data/doc/cxxapi/StaticString_8h_source.html +0 -329
- data/doc/cxxapi/StringListCreator_8h_source.html +0 -114
- data/doc/cxxapi/Utils_8h_source.html +0 -469
- data/doc/cxxapi/annotated.html +0 -87
- data/doc/cxxapi/apache2_2Configuration_8h_source.html +0 -82
- data/doc/cxxapi/classAgentWatcher-members.html +0 -54
- data/doc/cxxapi/classAgentWatcher.html +0 -419
- data/doc/cxxapi/classClient-members.html +0 -38
- data/doc/cxxapi/classClient.html +0 -123
- data/doc/cxxapi/classHooks-members.html +0 -40
- data/doc/cxxapi/classHooks.html +0 -153
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager-members.html +0 -40
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager.html +0 -187
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1ArgumentException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1ArgumentException.html +0 -56
- data/doc/cxxapi/classPassenger_1_1ArrayMessage-members.html +0 -37
- data/doc/cxxapi/classPassenger_1_1ArrayMessage.html +0 -113
- data/doc/cxxapi/classPassenger_1_1BufferedUpload-members.html +0 -38
- data/doc/cxxapi/classPassenger_1_1BufferedUpload.html +0 -112
- data/doc/cxxapi/classPassenger_1_1BusyException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1BusyException.html +0 -54
- data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +0 -51
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +0 -41
- data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +0 -223
- data/doc/cxxapi/classPassenger_1_1EOFException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1EOFException.html +0 -61
- data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1EventFd-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1EventFd.html +0 -52
- data/doc/cxxapi/classPassenger_1_1EventedClient-members.html +0 -59
- data/doc/cxxapi/classPassenger_1_1EventedClient.html +0 -531
- data/doc/cxxapi/classPassenger_1_1EventedMessageServer-members.html +0 -37
- data/doc/cxxapi/classPassenger_1_1EventedMessageServer.html +0 -59
- data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1EventedServer-members.html +0 -37
- data/doc/cxxapi/classPassenger_1_1EventedServer.html +0 -93
- data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1FileDescriptor-members.html +0 -41
- data/doc/cxxapi/classPassenger_1_1FileDescriptor.html +0 -178
- data/doc/cxxapi/classPassenger_1_1FileDescriptorPair-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1FileDescriptorPair.html +0 -52
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +0 -58
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +0 -41
- data/doc/cxxapi/classPassenger_1_1FileSystemException.html +0 -66
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1HttpStatusExtractor-members.html +0 -39
- data/doc/cxxapi/classPassenger_1_1HttpStatusExtractor.html +0 -128
- data/doc/cxxapi/classPassenger_1_1IOException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1IOException.html +0 -61
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +0 -4
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +0 -57
- data/doc/cxxapi/classPassenger_1_1MessageChannel.html +0 -839
- data/doc/cxxapi/classPassenger_1_1MessageServer-members.html +0 -49
- data/doc/cxxapi/classPassenger_1_1MessageServer.html +0 -407
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext.html +0 -58
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext-members.html +0 -41
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext.html +0 -165
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler-members.html +0 -39
- data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler.html +0 -173
- data/doc/cxxapi/classPassenger_1_1Process-members.html +0 -44
- data/doc/cxxapi/classPassenger_1_1Process.html +0 -290
- data/doc/cxxapi/classPassenger_1_1RandomGenerator-members.html +0 -37
- data/doc/cxxapi/classPassenger_1_1RandomGenerator.html +0 -79
- data/doc/cxxapi/classPassenger_1_1ResourceLocator-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1ResourceLocator.html +0 -51
- data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1RuntimeException.html +0 -54
- data/doc/cxxapi/classPassenger_1_1SafeLibev-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1SafeLibev.html +0 -51
- data/doc/cxxapi/classPassenger_1_1ScalarMessage-members.html +0 -37
- data/doc/cxxapi/classPassenger_1_1ScalarMessage.html +0 -76
- data/doc/cxxapi/classPassenger_1_1ScgiRequestParser-members.html +0 -50
- data/doc/cxxapi/classPassenger_1_1ScgiRequestParser.html +0 -285
- data/doc/cxxapi/classPassenger_1_1SecurityException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1SecurityException.html +0 -56
- data/doc/cxxapi/classPassenger_1_1Session-members.html +0 -53
- data/doc/cxxapi/classPassenger_1_1Session.html +0 -556
- data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +0 -39
- data/doc/cxxapi/classPassenger_1_1SpawnException.html +0 -101
- data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +0 -42
- data/doc/cxxapi/classPassenger_1_1SpawnManager.html +0 -292
- data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1StandardSession-members.html +0 -54
- data/doc/cxxapi/classPassenger_1_1StandardSession.html +0 -394
- data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1StaticString-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1StaticString.html +0 -56
- data/doc/cxxapi/classPassenger_1_1SyntaxError-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1SyntaxError.html +0 -54
- data/doc/cxxapi/classPassenger_1_1SystemException-members.html +0 -40
- data/doc/cxxapi/classPassenger_1_1SystemException.html +0 -155
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +0 -4
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException-members.html +0 -40
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException.html +0 -61
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.map +0 -3
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.md5 +0 -1
- data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.png +0 -0
- data/doc/cxxapi/classPassenger_1_1TimeoutException-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1TimeoutException.html +0 -54
- data/doc/cxxapi/classPassenger_1_1Uint16Message-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1Uint16Message.html +0 -51
- data/doc/cxxapi/classPassenger_1_1Uint32Message-members.html +0 -36
- data/doc/cxxapi/classPassenger_1_1Uint32Message.html +0 -51
- data/doc/cxxapi/classServer-members.html +0 -36
- data/doc/cxxapi/classServer.html +0 -49
- data/doc/cxxapi/classServerInstanceDirToucher-members.html +0 -36
- data/doc/cxxapi/classServerInstanceDirToucher.html +0 -47
- data/doc/cxxapi/classes.html +0 -52
- data/doc/cxxapi/definitions_8h_source.html +0 -36
- data/doc/cxxapi/doxygen.css +0 -532
- data/doc/cxxapi/doxygen.png +0 -0
- data/doc/cxxapi/files.html +0 -76
- data/doc/cxxapi/ftv2blank.png +0 -0
- data/doc/cxxapi/ftv2doc.png +0 -0
- data/doc/cxxapi/ftv2folderclosed.png +0 -0
- data/doc/cxxapi/ftv2folderopen.png +0 -0
- data/doc/cxxapi/ftv2lastnode.png +0 -0
- data/doc/cxxapi/ftv2link.png +0 -0
- data/doc/cxxapi/ftv2mlastnode.png +0 -0
- data/doc/cxxapi/ftv2mnode.png +0 -0
- data/doc/cxxapi/ftv2node.png +0 -0
- data/doc/cxxapi/ftv2plastnode.png +0 -0
- data/doc/cxxapi/ftv2pnode.png +0 -0
- data/doc/cxxapi/ftv2vertline.png +0 -0
- data/doc/cxxapi/functions.html +0 -103
- data/doc/cxxapi/functions_0x62.html +0 -82
- data/doc/cxxapi/functions_0x63.html +0 -102
- data/doc/cxxapi/functions_0x64.html +0 -102
- data/doc/cxxapi/functions_0x65.html +0 -88
- data/doc/cxxapi/functions_0x66.html +0 -100
- data/doc/cxxapi/functions_0x67.html +0 -167
- data/doc/cxxapi/functions_0x68.html +0 -88
- data/doc/cxxapi/functions_0x69.html +0 -96
- data/doc/cxxapi/functions_0x6b.html +0 -80
- data/doc/cxxapi/functions_0x6c.html +0 -88
- data/doc/cxxapi/functions_0x6d.html +0 -88
- data/doc/cxxapi/functions_0x6e.html +0 -86
- data/doc/cxxapi/functions_0x6f.html +0 -94
- data/doc/cxxapi/functions_0x70.html +0 -94
- data/doc/cxxapi/functions_0x72.html +0 -110
- data/doc/cxxapi/functions_0x73.html +0 -171
- data/doc/cxxapi/functions_0x74.html +0 -85
- data/doc/cxxapi/functions_0x75.html +0 -85
- data/doc/cxxapi/functions_0x77.html +0 -92
- data/doc/cxxapi/functions_0x7e.html +0 -79
- data/doc/cxxapi/functions_enum.html +0 -49
- data/doc/cxxapi/functions_eval.html +0 -67
- data/doc/cxxapi/functions_func.html +0 -531
- data/doc/cxxapi/functions_vars.html +0 -278
- data/doc/cxxapi/graph_legend.dot +0 -22
- data/doc/cxxapi/graph_legend.html +0 -92
- data/doc/cxxapi/graph_legend.png +0 -0
- data/doc/cxxapi/group__Core.html +0 -46
- data/doc/cxxapi/group__Core.map +0 -3
- data/doc/cxxapi/group__Core.png +0 -0
- data/doc/cxxapi/group__Exceptions.html +0 -53
- data/doc/cxxapi/group__Hooks.html +0 -42
- data/doc/cxxapi/group__Hooks.map +0 -3
- data/doc/cxxapi/group__Hooks.png +0 -0
- data/doc/cxxapi/group__Support.html +0 -538
- data/doc/cxxapi/hierarchy.html +0 -101
- data/doc/cxxapi/index.html +0 -16
- data/doc/cxxapi/inherit__graph__0.map +0 -3
- data/doc/cxxapi/inherit__graph__0.md5 +0 -1
- data/doc/cxxapi/inherit__graph__0.png +0 -0
- data/doc/cxxapi/inherit__graph__1.map +0 -3
- data/doc/cxxapi/inherit__graph__1.md5 +0 -1
- data/doc/cxxapi/inherit__graph__1.png +0 -0
- data/doc/cxxapi/inherit__graph__10.map +0 -3
- data/doc/cxxapi/inherit__graph__10.md5 +0 -1
- data/doc/cxxapi/inherit__graph__10.png +0 -0
- data/doc/cxxapi/inherit__graph__11.map +0 -4
- data/doc/cxxapi/inherit__graph__11.md5 +0 -1
- data/doc/cxxapi/inherit__graph__11.png +0 -0
- data/doc/cxxapi/inherit__graph__12.map +0 -3
- data/doc/cxxapi/inherit__graph__12.md5 +0 -1
- data/doc/cxxapi/inherit__graph__12.png +0 -0
- data/doc/cxxapi/inherit__graph__13.map +0 -3
- data/doc/cxxapi/inherit__graph__13.md5 +0 -1
- data/doc/cxxapi/inherit__graph__13.png +0 -0
- data/doc/cxxapi/inherit__graph__14.map +0 -3
- data/doc/cxxapi/inherit__graph__14.md5 +0 -1
- data/doc/cxxapi/inherit__graph__14.png +0 -0
- data/doc/cxxapi/inherit__graph__15.map +0 -3
- data/doc/cxxapi/inherit__graph__15.md5 +0 -1
- data/doc/cxxapi/inherit__graph__15.png +0 -0
- data/doc/cxxapi/inherit__graph__16.map +0 -5
- data/doc/cxxapi/inherit__graph__16.md5 +0 -1
- data/doc/cxxapi/inherit__graph__16.png +0 -0
- data/doc/cxxapi/inherit__graph__17.map +0 -3
- data/doc/cxxapi/inherit__graph__17.md5 +0 -1
- data/doc/cxxapi/inherit__graph__17.png +0 -0
- data/doc/cxxapi/inherit__graph__18.map +0 -3
- data/doc/cxxapi/inherit__graph__18.md5 +0 -1
- data/doc/cxxapi/inherit__graph__18.png +0 -0
- data/doc/cxxapi/inherit__graph__19.map +0 -4
- data/doc/cxxapi/inherit__graph__19.md5 +0 -1
- data/doc/cxxapi/inherit__graph__19.png +0 -0
- data/doc/cxxapi/inherit__graph__2.map +0 -3
- data/doc/cxxapi/inherit__graph__2.md5 +0 -1
- data/doc/cxxapi/inherit__graph__2.png +0 -0
- data/doc/cxxapi/inherit__graph__20.map +0 -3
- data/doc/cxxapi/inherit__graph__20.md5 +0 -1
- data/doc/cxxapi/inherit__graph__20.png +0 -0
- data/doc/cxxapi/inherit__graph__21.map +0 -3
- data/doc/cxxapi/inherit__graph__21.md5 +0 -1
- data/doc/cxxapi/inherit__graph__21.png +0 -0
- data/doc/cxxapi/inherit__graph__22.map +0 -3
- data/doc/cxxapi/inherit__graph__22.md5 +0 -1
- data/doc/cxxapi/inherit__graph__22.png +0 -0
- data/doc/cxxapi/inherit__graph__23.map +0 -3
- data/doc/cxxapi/inherit__graph__23.md5 +0 -1
- data/doc/cxxapi/inherit__graph__23.png +0 -0
- data/doc/cxxapi/inherit__graph__24.map +0 -3
- data/doc/cxxapi/inherit__graph__24.md5 +0 -1
- data/doc/cxxapi/inherit__graph__24.png +0 -0
- data/doc/cxxapi/inherit__graph__25.map +0 -3
- data/doc/cxxapi/inherit__graph__25.md5 +0 -1
- data/doc/cxxapi/inherit__graph__25.png +0 -0
- data/doc/cxxapi/inherit__graph__26.map +0 -3
- data/doc/cxxapi/inherit__graph__26.md5 +0 -1
- data/doc/cxxapi/inherit__graph__26.png +0 -0
- data/doc/cxxapi/inherit__graph__27.map +0 -3
- data/doc/cxxapi/inherit__graph__27.md5 +0 -1
- data/doc/cxxapi/inherit__graph__27.png +0 -0
- data/doc/cxxapi/inherit__graph__28.map +0 -3
- data/doc/cxxapi/inherit__graph__28.md5 +0 -1
- data/doc/cxxapi/inherit__graph__28.png +0 -0
- data/doc/cxxapi/inherit__graph__29.map +0 -3
- data/doc/cxxapi/inherit__graph__29.md5 +0 -1
- data/doc/cxxapi/inherit__graph__29.png +0 -0
- data/doc/cxxapi/inherit__graph__3.map +0 -4
- data/doc/cxxapi/inherit__graph__3.md5 +0 -1
- data/doc/cxxapi/inherit__graph__3.png +0 -0
- data/doc/cxxapi/inherit__graph__30.map +0 -3
- data/doc/cxxapi/inherit__graph__30.md5 +0 -1
- data/doc/cxxapi/inherit__graph__30.png +0 -0
- data/doc/cxxapi/inherit__graph__31.map +0 -4
- data/doc/cxxapi/inherit__graph__31.md5 +0 -1
- data/doc/cxxapi/inherit__graph__31.png +0 -0
- data/doc/cxxapi/inherit__graph__32.map +0 -3
- data/doc/cxxapi/inherit__graph__32.md5 +0 -1
- data/doc/cxxapi/inherit__graph__32.png +0 -0
- data/doc/cxxapi/inherit__graph__33.map +0 -3
- data/doc/cxxapi/inherit__graph__33.md5 +0 -1
- data/doc/cxxapi/inherit__graph__33.png +0 -0
- data/doc/cxxapi/inherit__graph__34.map +0 -3
- data/doc/cxxapi/inherit__graph__34.md5 +0 -1
- data/doc/cxxapi/inherit__graph__34.png +0 -0
- data/doc/cxxapi/inherit__graph__35.map +0 -3
- data/doc/cxxapi/inherit__graph__35.md5 +0 -1
- data/doc/cxxapi/inherit__graph__35.png +0 -0
- data/doc/cxxapi/inherit__graph__36.map +0 -5
- data/doc/cxxapi/inherit__graph__36.md5 +0 -1
- data/doc/cxxapi/inherit__graph__36.png +0 -0
- data/doc/cxxapi/inherit__graph__37.map +0 -3
- data/doc/cxxapi/inherit__graph__37.md5 +0 -1
- data/doc/cxxapi/inherit__graph__37.png +0 -0
- data/doc/cxxapi/inherit__graph__38.map +0 -3
- data/doc/cxxapi/inherit__graph__38.md5 +0 -1
- data/doc/cxxapi/inherit__graph__38.png +0 -0
- data/doc/cxxapi/inherit__graph__39.map +0 -3
- data/doc/cxxapi/inherit__graph__39.md5 +0 -1
- data/doc/cxxapi/inherit__graph__39.png +0 -0
- data/doc/cxxapi/inherit__graph__4.map +0 -3
- data/doc/cxxapi/inherit__graph__4.md5 +0 -1
- data/doc/cxxapi/inherit__graph__4.png +0 -0
- data/doc/cxxapi/inherit__graph__40.map +0 -3
- data/doc/cxxapi/inherit__graph__40.md5 +0 -1
- data/doc/cxxapi/inherit__graph__40.png +0 -0
- data/doc/cxxapi/inherit__graph__41.map +0 -3
- data/doc/cxxapi/inherit__graph__41.md5 +0 -1
- data/doc/cxxapi/inherit__graph__41.png +0 -0
- data/doc/cxxapi/inherit__graph__5.map +0 -3
- data/doc/cxxapi/inherit__graph__5.md5 +0 -1
- data/doc/cxxapi/inherit__graph__5.png +0 -0
- data/doc/cxxapi/inherit__graph__6.map +0 -3
- data/doc/cxxapi/inherit__graph__6.md5 +0 -1
- data/doc/cxxapi/inherit__graph__6.png +0 -0
- data/doc/cxxapi/inherit__graph__7.map +0 -3
- data/doc/cxxapi/inherit__graph__7.md5 +0 -1
- data/doc/cxxapi/inherit__graph__7.png +0 -0
- data/doc/cxxapi/inherit__graph__8.map +0 -3
- data/doc/cxxapi/inherit__graph__8.md5 +0 -1
- data/doc/cxxapi/inherit__graph__8.png +0 -0
- data/doc/cxxapi/inherit__graph__9.map +0 -3
- data/doc/cxxapi/inherit__graph__9.md5 +0 -1
- data/doc/cxxapi/inherit__graph__9.png +0 -0
- data/doc/cxxapi/inherits.html +0 -165
- data/doc/cxxapi/main.html +0 -28
- data/doc/cxxapi/modules.html +0 -36
- data/doc/cxxapi/namespacePassenger.html +0 -585
- data/doc/cxxapi/namespacemembers.html +0 -190
- data/doc/cxxapi/namespacemembers_enum.html +0 -48
- data/doc/cxxapi/namespacemembers_eval.html +0 -57
- data/doc/cxxapi/namespacemembers_func.html +0 -114
- data/doc/cxxapi/namespacemembers_type.html +0 -54
- data/doc/cxxapi/namespaces.html +0 -37
- data/doc/cxxapi/nginx_2Configuration_8h_source.html +0 -126
- data/doc/cxxapi/ngx__http__passenger__module_8h_source.html +0 -95
- data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard-members.html +0 -36
- data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard.html +0 -51
- data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +0 -67
- data/doc/cxxapi/structPassenger_1_1PoolOptions.html +0 -647
- data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash-members.html +0 -36
- data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash.html +0 -51
- data/doc/cxxapi/tab_b.gif +0 -0
- data/doc/cxxapi/tab_l.gif +0 -0
- data/doc/cxxapi/tab_r.gif +0 -0
- data/doc/cxxapi/tabs.css +0 -105
- data/doc/cxxapi/tree.html +0 -249
- data/doc/template/horo.rb +0 -613
- data/ext/libev/config.h +0 -122
- data/ext/nginx/HttpStatusExtractor.h +0 -351
data/doc/Users guide Apache.html
CHANGED
@@ -1,16 +1,35 @@
|
|
1
|
-
<!DOCTYPE html
|
2
|
-
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
4
3
|
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="
|
6
|
-
<meta name="generator" content="AsciiDoc 8.6.
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
|
+
<meta name="generator" content="AsciiDoc 8.6.5">
|
7
6
|
<title>Phusion Passenger users guide</title>
|
8
7
|
<style type="text/css">
|
9
|
-
/* Debug borders */
|
10
|
-
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
|
11
8
|
/*
|
12
|
-
|
13
|
-
|
9
|
+
* AsciiDoc 'flask' theme for xhtml11 and html5 backends. A shameless knock-off
|
10
|
+
* of the Flask website styling (http://flask.pocoo.org/docs/).
|
11
|
+
*
|
12
|
+
* The implementation is straight-forward, consisting of the asciidoc.css file
|
13
|
+
* followed by theme specific overrides.
|
14
|
+
*
|
15
|
+
* */
|
16
|
+
|
17
|
+
|
18
|
+
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
|
19
|
+
|
20
|
+
/* Default font. */
|
21
|
+
body {
|
22
|
+
font-family: Georgia,serif;
|
23
|
+
}
|
24
|
+
|
25
|
+
/* Title font. */
|
26
|
+
h1, h2, h3, h4, h5, h6,
|
27
|
+
div.title, caption.title,
|
28
|
+
thead, p.table.header,
|
29
|
+
#toctitle,
|
30
|
+
#author, #revnumber, #revdate, #revremark,
|
31
|
+
#footer {
|
32
|
+
font-family: Arial,Helvetica,sans-serif;
|
14
33
|
}
|
15
34
|
|
16
35
|
body {
|
@@ -35,13 +54,8 @@ strong {
|
|
35
54
|
color: #083194;
|
36
55
|
}
|
37
56
|
|
38
|
-
tt {
|
39
|
-
color: navy;
|
40
|
-
}
|
41
|
-
|
42
57
|
h1, h2, h3, h4, h5, h6 {
|
43
58
|
color: #527bbd;
|
44
|
-
font-family: sans-serif;
|
45
59
|
margin-top: 1.2em;
|
46
60
|
margin-bottom: 0.5em;
|
47
61
|
line-height: 1.3;
|
@@ -59,9 +73,11 @@ h3 {
|
|
59
73
|
h3 + * {
|
60
74
|
clear: left;
|
61
75
|
}
|
76
|
+
h5 {
|
77
|
+
font-size: 1.0em;
|
78
|
+
}
|
62
79
|
|
63
80
|
div.sectionbody {
|
64
|
-
font-family: serif;
|
65
81
|
margin-left: 0;
|
66
82
|
}
|
67
83
|
|
@@ -77,45 +93,44 @@ p {
|
|
77
93
|
ul, ol, li > p {
|
78
94
|
margin-top: 0;
|
79
95
|
}
|
96
|
+
ul > li { color: #aaa; }
|
97
|
+
ul > li > * { color: black; }
|
80
98
|
|
81
99
|
pre {
|
82
100
|
padding: 0;
|
83
101
|
margin: 0;
|
84
102
|
}
|
85
103
|
|
86
|
-
|
104
|
+
#author {
|
87
105
|
color: #527bbd;
|
88
|
-
font-family: sans-serif;
|
89
106
|
font-weight: bold;
|
90
107
|
font-size: 1.1em;
|
91
108
|
}
|
92
|
-
|
109
|
+
#email {
|
93
110
|
}
|
94
|
-
|
95
|
-
font-family: sans-serif;
|
111
|
+
#revnumber, #revdate, #revremark {
|
96
112
|
}
|
97
113
|
|
98
|
-
|
99
|
-
font-family: sans-serif;
|
114
|
+
#footer {
|
100
115
|
font-size: small;
|
101
116
|
border-top: 2px solid silver;
|
102
117
|
padding-top: 0.5em;
|
103
118
|
margin-top: 4.0em;
|
104
119
|
}
|
105
|
-
|
120
|
+
#footer-text {
|
106
121
|
float: left;
|
107
122
|
padding-bottom: 0.5em;
|
108
123
|
}
|
109
|
-
|
124
|
+
#footer-badges {
|
110
125
|
float: right;
|
111
126
|
padding-bottom: 0.5em;
|
112
127
|
}
|
113
128
|
|
114
|
-
|
129
|
+
#preamble {
|
115
130
|
margin-top: 1.5em;
|
116
131
|
margin-bottom: 1.5em;
|
117
132
|
}
|
118
|
-
div.
|
133
|
+
div.imageblock, div.exampleblock, div.verseblock,
|
119
134
|
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
|
120
135
|
div.admonitionblock {
|
121
136
|
margin-top: 1.0em;
|
@@ -135,7 +150,6 @@ div.content { /* Block element content. */
|
|
135
150
|
/* Block element titles. */
|
136
151
|
div.title, caption.title {
|
137
152
|
color: #527bbd;
|
138
|
-
font-family: sans-serif;
|
139
153
|
font-weight: bold;
|
140
154
|
text-align: left;
|
141
155
|
margin-top: 1.0em;
|
@@ -157,13 +171,15 @@ div.content + div.title {
|
|
157
171
|
|
158
172
|
div.sidebarblock > div.content {
|
159
173
|
background: #ffffee;
|
160
|
-
border: 1px solid
|
174
|
+
border: 1px solid #dddddd;
|
175
|
+
border-left: 4px solid #f0f0f0;
|
161
176
|
padding: 0.5em;
|
162
177
|
}
|
163
178
|
|
164
179
|
div.listingblock > div.content {
|
165
|
-
border: 1px solid
|
166
|
-
|
180
|
+
border: 1px solid #dddddd;
|
181
|
+
border-left: 5px solid #f0f0f0;
|
182
|
+
background: #f8f8f8;
|
167
183
|
padding: 0.5em;
|
168
184
|
}
|
169
185
|
|
@@ -171,7 +187,7 @@ div.quoteblock, div.verseblock {
|
|
171
187
|
padding-left: 1.0em;
|
172
188
|
margin-left: 1.0em;
|
173
189
|
margin-right: 10%;
|
174
|
-
border-left: 5px solid #
|
190
|
+
border-left: 5px solid #f0f0f0;
|
175
191
|
color: #777777;
|
176
192
|
}
|
177
193
|
|
@@ -182,6 +198,7 @@ div.quoteblock > div.attribution {
|
|
182
198
|
|
183
199
|
div.verseblock > pre.content {
|
184
200
|
font-family: inherit;
|
201
|
+
font-size: inherit;
|
185
202
|
}
|
186
203
|
div.verseblock > div.attribution {
|
187
204
|
padding-top: 0.75em;
|
@@ -254,36 +271,12 @@ div.compact div, div.compact div {
|
|
254
271
|
margin-bottom: 0.1em;
|
255
272
|
}
|
256
273
|
|
257
|
-
div.tableblock > table {
|
258
|
-
border: 3px solid #527bbd;
|
259
|
-
}
|
260
|
-
thead, p.table.header {
|
261
|
-
font-family: sans-serif;
|
262
|
-
font-weight: bold;
|
263
|
-
color: #527bbd;
|
264
|
-
}
|
265
274
|
tfoot {
|
266
275
|
font-weight: bold;
|
267
276
|
}
|
268
277
|
td > div.verse {
|
269
278
|
white-space: pre;
|
270
279
|
}
|
271
|
-
p.table {
|
272
|
-
margin-top: 0;
|
273
|
-
}
|
274
|
-
/* Because the table frame attribute is overriden by CSS in most browsers. */
|
275
|
-
div.tableblock > table[frame="void"] {
|
276
|
-
border-style: none;
|
277
|
-
}
|
278
|
-
div.tableblock > table[frame="hsides"] {
|
279
|
-
border-left-style: none;
|
280
|
-
border-right-style: none;
|
281
|
-
}
|
282
|
-
div.tableblock > table[frame="vsides"] {
|
283
|
-
border-top-style: none;
|
284
|
-
border-bottom-style: none;
|
285
|
-
}
|
286
|
-
|
287
280
|
|
288
281
|
div.hdlist {
|
289
282
|
margin-top: 0.8em;
|
@@ -350,16 +343,15 @@ div.colist td img {
|
|
350
343
|
}
|
351
344
|
|
352
345
|
@media print {
|
353
|
-
|
346
|
+
#footer-badges { display: none; }
|
354
347
|
}
|
355
348
|
|
356
|
-
|
349
|
+
#toc {
|
357
350
|
margin-bottom: 2.5em;
|
358
351
|
}
|
359
352
|
|
360
|
-
|
353
|
+
#toctitle {
|
361
354
|
color: #527bbd;
|
362
|
-
font-family: sans-serif;
|
363
355
|
font-size: 1.1em;
|
364
356
|
font-weight: bold;
|
365
357
|
margin-top: 1.0em;
|
@@ -383,10 +375,223 @@ div.toclevel4 {
|
|
383
375
|
font-size: 0.9em;
|
384
376
|
}
|
385
377
|
|
378
|
+
span.aqua { color: aqua; }
|
379
|
+
span.black { color: black; }
|
380
|
+
span.blue { color: blue; }
|
381
|
+
span.fuchsia { color: fuchsia; }
|
382
|
+
span.gray { color: gray; }
|
383
|
+
span.green { color: green; }
|
384
|
+
span.lime { color: lime; }
|
385
|
+
span.maroon { color: maroon; }
|
386
|
+
span.navy { color: navy; }
|
387
|
+
span.olive { color: olive; }
|
388
|
+
span.purple { color: purple; }
|
389
|
+
span.red { color: red; }
|
390
|
+
span.silver { color: silver; }
|
391
|
+
span.teal { color: teal; }
|
392
|
+
span.white { color: white; }
|
393
|
+
span.yellow { color: yellow; }
|
394
|
+
|
395
|
+
span.aqua-background { background: aqua; }
|
396
|
+
span.black-background { background: black; }
|
397
|
+
span.blue-background { background: blue; }
|
398
|
+
span.fuchsia-background { background: fuchsia; }
|
399
|
+
span.gray-background { background: gray; }
|
400
|
+
span.green-background { background: green; }
|
401
|
+
span.lime-background { background: lime; }
|
402
|
+
span.maroon-background { background: maroon; }
|
403
|
+
span.navy-background { background: navy; }
|
404
|
+
span.olive-background { background: olive; }
|
405
|
+
span.purple-background { background: purple; }
|
406
|
+
span.red-background { background: red; }
|
407
|
+
span.silver-background { background: silver; }
|
408
|
+
span.teal-background { background: teal; }
|
409
|
+
span.white-background { background: white; }
|
410
|
+
span.yellow-background { background: yellow; }
|
411
|
+
|
412
|
+
span.big { font-size: 2em; }
|
413
|
+
span.small { font-size: 0.6em; }
|
414
|
+
|
415
|
+
span.underline { text-decoration: underline; }
|
416
|
+
span.overline { text-decoration: overline; }
|
417
|
+
span.line-through { text-decoration: line-through; }
|
418
|
+
|
419
|
+
|
420
|
+
/*
|
421
|
+
* xhtml11 specific
|
422
|
+
*
|
423
|
+
* */
|
424
|
+
|
425
|
+
tt {
|
426
|
+
font-family: monospace;
|
427
|
+
font-size: inherit;
|
428
|
+
color: navy;
|
429
|
+
}
|
430
|
+
|
431
|
+
div.tableblock {
|
432
|
+
margin-top: 1.0em;
|
433
|
+
margin-bottom: 1.5em;
|
434
|
+
}
|
435
|
+
div.tableblock > table {
|
436
|
+
border: 3px solid #527bbd;
|
437
|
+
}
|
438
|
+
thead, p.table.header {
|
439
|
+
font-weight: bold;
|
440
|
+
color: #527bbd;
|
441
|
+
}
|
442
|
+
p.table {
|
443
|
+
margin-top: 0;
|
444
|
+
}
|
445
|
+
/* Because the table frame attribute is overriden by CSS in most browsers. */
|
446
|
+
div.tableblock > table[frame="void"] {
|
447
|
+
border-style: none;
|
448
|
+
}
|
449
|
+
div.tableblock > table[frame="hsides"] {
|
450
|
+
border-left-style: none;
|
451
|
+
border-right-style: none;
|
452
|
+
}
|
453
|
+
div.tableblock > table[frame="vsides"] {
|
454
|
+
border-top-style: none;
|
455
|
+
border-bottom-style: none;
|
456
|
+
}
|
457
|
+
|
458
|
+
|
459
|
+
/*
|
460
|
+
* html5 specific
|
461
|
+
*
|
462
|
+
* */
|
463
|
+
|
464
|
+
.monospaced {
|
465
|
+
font-family: monospace;
|
466
|
+
font-size: inherit;
|
467
|
+
color: navy;
|
468
|
+
}
|
469
|
+
|
470
|
+
table.tableblock {
|
471
|
+
margin-top: 1.0em;
|
472
|
+
margin-bottom: 1.5em;
|
473
|
+
}
|
474
|
+
thead, p.tableblock.header {
|
475
|
+
font-weight: bold;
|
476
|
+
color: #527bbd;
|
477
|
+
}
|
478
|
+
p.tableblock {
|
479
|
+
margin-top: 0;
|
480
|
+
}
|
481
|
+
table.tableblock {
|
482
|
+
border-width: 3px;
|
483
|
+
border-spacing: 0px;
|
484
|
+
border-style: solid;
|
485
|
+
border-color: #527bbd;
|
486
|
+
border-collapse: collapse;
|
487
|
+
}
|
488
|
+
th.tableblock, td.tableblock {
|
489
|
+
border-width: 1px;
|
490
|
+
padding: 4px;
|
491
|
+
border-style: solid;
|
492
|
+
border-color: #527bbd;
|
493
|
+
}
|
494
|
+
|
495
|
+
table.tableblock.frame-topbot {
|
496
|
+
border-left-style: hidden;
|
497
|
+
border-right-style: hidden;
|
498
|
+
}
|
499
|
+
table.tableblock.frame-sides {
|
500
|
+
border-top-style: hidden;
|
501
|
+
border-bottom-style: hidden;
|
502
|
+
}
|
503
|
+
table.tableblock.frame-none {
|
504
|
+
border-style: hidden;
|
505
|
+
}
|
506
|
+
|
507
|
+
th.tableblock.halign-left, td.tableblock.halign-left {
|
508
|
+
text-align: left;
|
509
|
+
}
|
510
|
+
th.tableblock.halign-center, td.tableblock.halign-center {
|
511
|
+
text-align: center;
|
512
|
+
}
|
513
|
+
th.tableblock.halign-right, td.tableblock.halign-right {
|
514
|
+
text-align: right;
|
515
|
+
}
|
516
|
+
|
517
|
+
th.tableblock.valign-top, td.tableblock.valign-top {
|
518
|
+
vertical-align: top;
|
519
|
+
}
|
520
|
+
th.tableblock.valign-middle, td.tableblock.valign-middle {
|
521
|
+
vertical-align: middle;
|
522
|
+
}
|
523
|
+
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
|
524
|
+
vertical-align: bottom;
|
525
|
+
}
|
526
|
+
|
527
|
+
|
528
|
+
/*
|
529
|
+
* Theme specific overrides of the preceding (asciidoc.css) CSS.
|
530
|
+
*
|
531
|
+
*/
|
532
|
+
body {
|
533
|
+
font-family: Garamond, Georgia, serif;
|
534
|
+
font-size: 17px;
|
535
|
+
color: #3E4349;
|
536
|
+
line-height: 1.3em;
|
537
|
+
}
|
538
|
+
h1, h2, h3, h4, h5, h6,
|
539
|
+
div.title, caption.title,
|
540
|
+
thead, p.table.header,
|
541
|
+
#toctitle,
|
542
|
+
#author, #revnumber, #revdate, #revremark,
|
543
|
+
#footer {
|
544
|
+
font-family: Garmond, Georgia, serif;
|
545
|
+
font-weight: normal;
|
546
|
+
border-bottom-width: 0;
|
547
|
+
color: #3E4349;
|
548
|
+
}
|
549
|
+
div.title, caption.title { color: #596673; font-weight: bold; }
|
550
|
+
h1 { font-size: 240%; }
|
551
|
+
h2 { font-size: 180%; }
|
552
|
+
h3 { font-size: 150%; }
|
553
|
+
h4 { font-size: 130%; }
|
554
|
+
h5 { font-size: 100%; }
|
555
|
+
h6 { font-size: 100%; }
|
556
|
+
#header h1 { margin-top: 0; }
|
557
|
+
#toc {
|
558
|
+
color: #444444;
|
559
|
+
line-height: 1.5;
|
560
|
+
padding-top: 1.5em;
|
561
|
+
}
|
562
|
+
#toctitle {
|
563
|
+
font-size: 20px;
|
564
|
+
}
|
565
|
+
#toc a {
|
566
|
+
border-bottom: 1px dotted #999999;
|
567
|
+
color: #444444 !important;
|
568
|
+
text-decoration: none !important;
|
569
|
+
}
|
570
|
+
#toc a:hover {
|
571
|
+
border-bottom: 1px solid #6D4100;
|
572
|
+
color: #6D4100 !important;
|
573
|
+
text-decoration: none !important;
|
574
|
+
}
|
575
|
+
div.toclevel1 { margin-top: 0.2em; font-size: 16px; }
|
576
|
+
div.toclevel2 { margin-top: 0.15em; font-size: 14px; }
|
577
|
+
em, dt, td.hdlist1 { color: black; }
|
578
|
+
strong { color: #3E4349; }
|
579
|
+
a { color: #004B6B; text-decoration: none; border-bottom: 1px dotted #004B6B; }
|
580
|
+
a:visited { color: #615FA0; border-bottom: 1px dotted #615FA0; }
|
581
|
+
a:hover { color: #6D4100; border-bottom: 1px solid #6D4100; }
|
582
|
+
div.tableblock > table, table.tableblock { border: 3px solid #E8E8E8; }
|
583
|
+
th.tableblock, td.tableblock { border: 1px solid #E8E8E8; }
|
584
|
+
ul > li > * { color: #3E4349; }
|
585
|
+
pre, tt, .monospaced { font-family: Consolas,Menlo,'Deja Vu Sans Mono','Bitstream Vera Sans Mono',monospace; }
|
586
|
+
tt, .monospaced { font-size: 0.9em; color: black;
|
587
|
+
}
|
588
|
+
div.exampleblock > div.content, div.sidebarblock > div.content, div.listingblock > div.content { border-width: 0 0 0 3px; border-color: #E8E8E8; }
|
589
|
+
div.verseblock { border-left-width: 0; margin-left: 3em; }
|
590
|
+
div.quoteblock { border-left-width: 3px; margin-left: 0; margin-right: 0;}
|
591
|
+
div.admonitionblock td.content { border-left: 3px solid #E8E8E8; }
|
386
592
|
</style>
|
387
593
|
<script type="text/javascript">
|
388
594
|
/*<![CDATA[*/
|
389
|
-
window.onload = function(){asciidoc.footnotes(); asciidoc.toc(3);}
|
390
595
|
var asciidoc = { // Namespace.
|
391
596
|
|
392
597
|
/////////////////////////////////////////////////////////////////////
|
@@ -448,6 +653,25 @@ toc: function (toclevels) {
|
|
448
653
|
}
|
449
654
|
|
450
655
|
var toc = document.getElementById("toc");
|
656
|
+
if (!toc) {
|
657
|
+
return;
|
658
|
+
}
|
659
|
+
|
660
|
+
// Delete existing TOC entries in case we're reloading the TOC.
|
661
|
+
var tocEntriesToRemove = [];
|
662
|
+
var i;
|
663
|
+
for (i = 0; i < toc.childNodes.length; i++) {
|
664
|
+
var entry = toc.childNodes[i];
|
665
|
+
if (entry.nodeName == 'DIV'
|
666
|
+
&& entry.getAttribute("class")
|
667
|
+
&& entry.getAttribute("class").match(/^toclevel/))
|
668
|
+
tocEntriesToRemove.push(entry);
|
669
|
+
}
|
670
|
+
for (i = 0; i < tocEntriesToRemove.length; i++) {
|
671
|
+
toc.removeChild(tocEntriesToRemove[i]);
|
672
|
+
}
|
673
|
+
|
674
|
+
// Rebuild TOC entries.
|
451
675
|
var entries = tocEntries(document.getElementById("content"), toclevels);
|
452
676
|
for (var i = 0; i < entries.length; ++i) {
|
453
677
|
var entry = entries[i];
|
@@ -475,24 +699,44 @@ toc: function (toclevels) {
|
|
475
699
|
*/
|
476
700
|
|
477
701
|
footnotes: function () {
|
478
|
-
|
702
|
+
// Delete existing footnote entries in case we're reloading the footnodes.
|
703
|
+
var i;
|
479
704
|
var noteholder = document.getElementById("footnotes");
|
705
|
+
if (!noteholder) {
|
706
|
+
return;
|
707
|
+
}
|
708
|
+
var entriesToRemove = [];
|
709
|
+
for (i = 0; i < noteholder.childNodes.length; i++) {
|
710
|
+
var entry = noteholder.childNodes[i];
|
711
|
+
if (entry.nodeName == 'DIV' && entry.getAttribute("class") == "footnote")
|
712
|
+
entriesToRemove.push(entry);
|
713
|
+
}
|
714
|
+
for (i = 0; i < entriesToRemove.length; i++) {
|
715
|
+
noteholder.removeChild(entriesToRemove[i]);
|
716
|
+
}
|
717
|
+
|
718
|
+
// Rebuild footnote entries.
|
719
|
+
var cont = document.getElementById("content");
|
480
720
|
var spans = cont.getElementsByTagName("span");
|
481
721
|
var refs = {};
|
482
722
|
var n = 0;
|
483
723
|
for (i=0; i<spans.length; i++) {
|
484
724
|
if (spans[i].className == "footnote") {
|
485
725
|
n++;
|
486
|
-
|
487
|
-
|
488
|
-
|
726
|
+
var note = spans[i].getAttribute("data-note");
|
727
|
+
if (!note) {
|
728
|
+
// Use [\s\S] in place of . so multi-line matches work.
|
729
|
+
// Because JavaScript has no s (dotall) regex flag.
|
730
|
+
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
|
731
|
+
spans[i].innerHTML =
|
732
|
+
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
|
733
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
734
|
+
spans[i].setAttribute("data-note", note);
|
735
|
+
}
|
489
736
|
noteholder.innerHTML +=
|
490
737
|
"<div class='footnote' id='_footnote_" + n + "'>" +
|
491
738
|
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
|
492
739
|
n + "</a>. " + note + "</div>";
|
493
|
-
spans[i].innerHTML =
|
494
|
-
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
|
495
|
-
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
496
740
|
var id =spans[i].getAttribute("id");
|
497
741
|
if (id != null) refs["#"+id] = n;
|
498
742
|
}
|
@@ -512,9 +756,32 @@ footnotes: function () {
|
|
512
756
|
}
|
513
757
|
}
|
514
758
|
}
|
759
|
+
},
|
760
|
+
|
761
|
+
install: function(toclevels) {
|
762
|
+
var timerId;
|
763
|
+
|
764
|
+
function reinstall() {
|
765
|
+
asciidoc.footnotes();
|
766
|
+
if (toclevels) {
|
767
|
+
asciidoc.toc(toclevels);
|
768
|
+
}
|
769
|
+
}
|
770
|
+
|
771
|
+
function reinstallAndRemoveTimer() {
|
772
|
+
clearInterval(timerId);
|
773
|
+
reinstall();
|
774
|
+
}
|
775
|
+
|
776
|
+
timerId = setInterval(reinstall, 500);
|
777
|
+
if (document.addEventListener)
|
778
|
+
document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
|
779
|
+
else
|
780
|
+
window.onload = reinstallAndRemoveTimer;
|
515
781
|
}
|
516
782
|
|
517
783
|
}
|
784
|
+
asciidoc.install(3);
|
518
785
|
/*]]>*/
|
519
786
|
</script>
|
520
787
|
</head>
|
@@ -531,7 +798,7 @@ footnotes: function () {
|
|
531
798
|
<div class="sectionbody">
|
532
799
|
<div class="paragraph"><p><span class="image">
|
533
800
|
<a class="image" href="http://www.phusion.nl/">
|
534
|
-
<img src="images/phusion_banner.png" alt="images/phusion_banner.png"
|
801
|
+
<img src="images/phusion_banner.png" alt="images/phusion_banner.png">
|
535
802
|
</a>
|
536
803
|
</span></p></div>
|
537
804
|
<div class="paragraph"><p>Phusion Passenger is an Apache module, which makes deploying Ruby and Ruby on
|
@@ -649,7 +916,7 @@ you’re installing Phusion Passenger via a native Linux package, because no
|
|
649
916
|
compilation is necessary.</p></div>
|
650
917
|
<div class="sect4">
|
651
918
|
<h5 id="_switching_to_a_root_command_prompt">Switching to a root command prompt</h5>
|
652
|
-
<div class="paragraph"><p>Before installing, you will probably need to switch to the <
|
919
|
+
<div class="paragraph"><p>Before installing, you will probably need to switch to the <span class="monospaced">root</span> user first.
|
653
920
|
When you install Phusion Passenger via a gem or a source tarball, some Phusion
|
654
921
|
Passenger files have to be compiled, which requires write access to the
|
655
922
|
directory in which the Phusion Passenger files are located. On Unix systems,
|
@@ -658,22 +925,22 @@ you know that your normal user account has write access to the Phusion Passenger
|
|
658
925
|
directory, you should switch to root before installing Phusion Passenger.</p></div>
|
659
926
|
<div class="paragraph"><p>You can switch to root by typing the following command:</p></div>
|
660
927
|
<div class="listingblock">
|
661
|
-
<div class="content">
|
662
|
-
<pre
|
928
|
+
<div class="content monospaced">
|
929
|
+
<pre>sudo -s</pre>
|
663
930
|
</div></div>
|
664
931
|
<div class="paragraph"><p>This will open a command prompt as the root user, from which you can proceed
|
665
932
|
with installing Phusion Passenger.</p></div>
|
666
933
|
<div class="paragraph"><p>If your system does not have <em>sudo</em> installed, please type the following command instead, which should do the same thing:</p></div>
|
667
934
|
<div class="listingblock">
|
668
|
-
<div class="content">
|
669
|
-
<pre
|
935
|
+
<div class="content monospaced">
|
936
|
+
<pre>su</pre>
|
670
937
|
</div></div>
|
671
938
|
</div>
|
672
939
|
<div class="sect4">
|
673
940
|
<h5 id="specifying_correct_apache_install">Specifying the correct Apache installation</h5>
|
674
941
|
<div class="paragraph"><p>The Phusion Passenger installer will attempt to automatically detect Apache,
|
675
942
|
and compile Phusion Passenger against that Apache version. It does this by
|
676
|
-
looking for the <
|
943
|
+
looking for the <span class="monospaced">apxs</span> or <span class="monospaced">apxs2</span> command in the PATH environment variable.
|
677
944
|
Apxs is an integral part of any Apache installation.</p></div>
|
678
945
|
<div class="paragraph"><p>However, some systems have multiple Apache installations. This is likely
|
679
946
|
the case on MacOS X: the OS ships with Apache, but users tend to install
|
@@ -689,32 +956,32 @@ is most likely the case on systems on which Apache was installed by hand
|
|
689
956
|
from source, i.e. as opposed to installed through the system’s native
|
690
957
|
package manager. If this is the case, then you will also have to tell
|
691
958
|
the installer where it can find Apache.</p></div>
|
692
|
-
<div class="paragraph"><p>To do so, set the <
|
693
|
-
correct <
|
959
|
+
<div class="paragraph"><p>To do so, set the <span class="monospaced">APXS2</span> environment variable to the full path of the
|
960
|
+
correct <span class="monospaced">apxs</span> or <span class="monospaced">apxs2</span> command. Suppose that you want to use the Apache
|
694
961
|
installation in <em>/opt/apache2</em>. Then, assuming that the corresponding
|
695
|
-
<
|
962
|
+
<span class="monospaced">apxs</span> program’s path is <em>/opt/apache2/bin/apxs</em>, type:</p></div>
|
696
963
|
<div class="listingblock">
|
697
|
-
<div class="content">
|
698
|
-
<pre
|
964
|
+
<div class="content monospaced">
|
965
|
+
<pre>export APXS2=/opt/apache2/bin/apxs</pre>
|
699
966
|
</div></div>
|
700
967
|
<div class="admonitionblock">
|
701
968
|
<table><tr>
|
702
969
|
<td class="icon">
|
703
|
-
<img src="./images/icons/note.png" alt="Note"
|
970
|
+
<img src="./images/icons/note.png" alt="Note">
|
704
971
|
</td>
|
705
|
-
<td class="content">On some systems, the <
|
706
|
-
be located in the <
|
972
|
+
<td class="content">On some systems, the <span class="monospaced">apxs</span> program might be called <span class="monospaced">apxs2</span>, and it might
|
973
|
+
be located in the <span class="monospaced">sbin</span> folder instead of the <span class="monospaced">bin</span> folder.</td>
|
707
974
|
</tr></table>
|
708
975
|
</div>
|
709
976
|
<div class="admonitionblock">
|
710
977
|
<table><tr>
|
711
978
|
<td class="icon">
|
712
|
-
<img src="./images/icons/note.png" alt="Note"
|
979
|
+
<img src="./images/icons/note.png" alt="Note">
|
713
980
|
</td>
|
714
981
|
<td class="content">
|
715
982
|
<div class="title">Environment variables and <em>sudo</em></div>By default, the <em>sudo</em> command will erase any environment variables that it
|
716
983
|
doesn’t recognize, prior to executing the given command. So if you set APXS2 as a
|
717
|
-
normal user, then run <
|
984
|
+
normal user, then run <span class="monospaced">sudo passenger-install-apache2-module</span> (which is the command
|
718
985
|
for the Phusion Passenger installer), then the installer will not receive the
|
719
986
|
environment variable value that you set. To solve this problem, please become root
|
720
987
|
prior to setting any environment variables, as described in the previous subsection.</td>
|
@@ -730,8 +997,8 @@ will need to tell the operating system which Ruby installation to use, prior to
|
|
730
997
|
running the Phusion Passenger installer. If you only have one Ruby installation
|
731
998
|
(the case on most Linux systems), then you can skip this section because Phusion
|
732
999
|
Passenger will automatically detect it.</p></div>
|
733
|
-
<div class="paragraph"><p>To specify a Ruby installation, prepend your Ruby installation’s <
|
734
|
-
directory to the <
|
1000
|
+
<div class="paragraph"><p>To specify a Ruby installation, prepend your Ruby installation’s <span class="monospaced">bin</span>
|
1001
|
+
directory to the <span class="monospaced">PATH</span> environment variable. For example, if you have the
|
735
1002
|
following Ruby installations:</p></div>
|
736
1003
|
<div class="ulist"><ul>
|
737
1004
|
<li>
|
@@ -747,8 +1014,8 @@ following Ruby installations:</p></div>
|
|
747
1014
|
</ul></div>
|
748
1015
|
<div class="paragraph"><p>and you want to use the latter, then type:</p></div>
|
749
1016
|
<div class="listingblock">
|
750
|
-
<div class="content">
|
751
|
-
<pre
|
1017
|
+
<div class="content monospaced">
|
1018
|
+
<pre>export PATH=/opt/myruby/bin:$PATH</pre>
|
752
1019
|
</div></div>
|
753
1020
|
</div>
|
754
1021
|
</div>
|
@@ -757,9 +1024,9 @@ following Ruby installations:</p></div>
|
|
757
1024
|
<div class="paragraph"><p>Please install the gem and then run the Phusion Passenger installer, by typing the
|
758
1025
|
following commands:</p></div>
|
759
1026
|
<div class="listingblock">
|
760
|
-
<div class="content">
|
761
|
-
<pre
|
762
|
-
passenger-install-apache2-module</
|
1027
|
+
<div class="content monospaced">
|
1028
|
+
<pre>gem install passenger-x.x.x.gem
|
1029
|
+
passenger-install-apache2-module</pre>
|
763
1030
|
</div></div>
|
764
1031
|
<div class="paragraph"><p>Please follow the instructions given by the installer.</p></div>
|
765
1032
|
</div>
|
@@ -767,22 +1034,22 @@ passenger-install-apache2-module</tt></pre>
|
|
767
1034
|
<h4 id="_installing_via_the_source_tarball">2.1.4. Installing via the source tarball</h4>
|
768
1035
|
<div class="paragraph"><p>Extract the tarball to whatever location you prefer. <strong>The Phusion Passenger files
|
769
1036
|
are to reside in that location permanently.</strong> For example, if you would like
|
770
|
-
Phusion Passenger to reside in <
|
1037
|
+
Phusion Passenger to reside in <span class="monospaced">/opt/passenger-x.x.x</span>:</p></div>
|
771
1038
|
<div class="listingblock">
|
772
|
-
<div class="content">
|
773
|
-
<pre
|
774
|
-
tar xzvf ~/YourDownloadsFolder/passenger-x.x.x.tar.gz</
|
1039
|
+
<div class="content monospaced">
|
1040
|
+
<pre>cd /opt
|
1041
|
+
tar xzvf ~/YourDownloadsFolder/passenger-x.x.x.tar.gz</pre>
|
775
1042
|
</div></div>
|
776
1043
|
<div class="paragraph"><p>Next, run the included installer:</p></div>
|
777
1044
|
<div class="listingblock">
|
778
|
-
<div class="content">
|
779
|
-
<pre
|
1045
|
+
<div class="content monospaced">
|
1046
|
+
<pre>/opt/passenger-x.x.x/bin/passenger-install-apache2-module</pre>
|
780
1047
|
</div></div>
|
781
1048
|
<div class="paragraph"><p>Please follow the instructions given by the installer.</p></div>
|
782
1049
|
<div class="admonitionblock">
|
783
1050
|
<table><tr>
|
784
1051
|
<td class="icon">
|
785
|
-
<img src="./images/icons/important.png" alt="Important"
|
1052
|
+
<img src="./images/icons/important.png" alt="Important">
|
786
1053
|
</td>
|
787
1054
|
<td class="content">Please do not remove the <em>passenger-x.x.x</em> folder after
|
788
1055
|
installation. Furthermore, the <em>passenger-x.x.x</em> folder must be accessible by Apache.</td>
|
@@ -794,11 +1061,11 @@ installation. Furthermore, the <em>passenger-x.x.x</em> folder must be accessibl
|
|
794
1061
|
<div class="paragraph"><p>John Leach from Brightbox has kindly provided an Ubuntu Hardy package for Phusion Passenger. The package is available from the <a href="http://apt.brightbox.net">Brightbox repository</a>.</p></div>
|
795
1062
|
<div class="paragraph"><p>Please install the native Linux package, e.g.:</p></div>
|
796
1063
|
<div class="listingblock">
|
797
|
-
<div class="content">
|
798
|
-
<pre
|
1064
|
+
<div class="content monospaced">
|
1065
|
+
<pre>sudo sh -c 'echo "deb http://apt.brightbox.net hardy main" > /etc/apt/sources.list.d/brightbox.list'
|
799
1066
|
sudo sh -c 'wget -q -O - http://apt.brightbox.net/release.asc | apt-key add -'
|
800
1067
|
sudo apt-get update
|
801
|
-
sudo apt-get install libapache2-mod-passenger</
|
1068
|
+
sudo apt-get install libapache2-mod-passenger</pre>
|
802
1069
|
</div></div>
|
803
1070
|
</div>
|
804
1071
|
<div class="sect3">
|
@@ -807,8 +1074,8 @@ sudo apt-get install libapache2-mod-passenger</tt></pre>
|
|
807
1074
|
The installer checks whether all required dependencies are installed,
|
808
1075
|
compiles Phusion Passenger for you, and tells you how to modify the Apache
|
809
1076
|
configuration file, but it doesn’t copy any files around.</p></div>
|
810
|
-
<div class="paragraph"><p><
|
811
|
-
around the command <
|
1077
|
+
<div class="paragraph"><p><span class="monospaced">passenger-install-apache2-module</span> is actually just a user-friendly frontend
|
1078
|
+
around the command <span class="monospaced">rake apache2</span>, which performs the actual compilation of
|
812
1079
|
Phusion Passenger.</p></div>
|
813
1080
|
</div>
|
814
1081
|
</div>
|
@@ -834,16 +1101,16 @@ about setting up Ruby on Rails and Phusion Passenger on OpenSolaris and EC2.</p>
|
|
834
1101
|
<h3 id="_upgrading_or_downgrading_phusion_passenger">2.3. Upgrading or downgrading Phusion Passenger</h3>
|
835
1102
|
<div class="sect3">
|
836
1103
|
<h4 id="_via_a_gem_or_a_source_tarball">2.3.1. Via a gem or a source tarball</h4>
|
837
|
-
<div class="paragraph"><p>To
|
1104
|
+
<div class="paragraph"><p>To upgrade or downgrade Phusion Passenger via the gem or the source tarball, install the newer
|
838
1105
|
or older version as you normally would; that is, install the gem or unpack the tarball, and
|
839
|
-
run <
|
1106
|
+
run <span class="monospaced">passenger-install-apache2-module</span>. Eventually <span class="monospaced">passenger-install-apache2-module</span> will tell
|
840
1107
|
you to copy & paste some settings into the Apache configuration file; something that looks along
|
841
1108
|
the lines of:</p></div>
|
842
1109
|
<div class="listingblock">
|
843
|
-
<div class="content">
|
844
|
-
<pre
|
1110
|
+
<div class="content monospaced">
|
1111
|
+
<pre>LoadModule passenger_module ...
|
845
1112
|
PassengerRoot ...
|
846
|
-
PassengerRuby ...</
|
1113
|
+
PassengerRuby ...</pre>
|
847
1114
|
</div></div>
|
848
1115
|
<div class="paragraph"><p>Because you already had Phusion Passenger installed, you already had similar settings
|
849
1116
|
in your Apache configuration file, just with different values. <strong>Replace</strong> the old settings with
|
@@ -883,8 +1150,8 @@ the <em>LoadModule passenger_module</em> directive.
|
|
883
1150
|
</ul></div>
|
884
1151
|
<div class="paragraph"><p>For example, if your configuration file looks like this…</p></div>
|
885
1152
|
<div class="listingblock">
|
886
|
-
<div class="content">
|
887
|
-
<pre
|
1153
|
+
<div class="content monospaced">
|
1154
|
+
<pre>Listen *:80
|
888
1155
|
NameVirtualHosts *:80
|
889
1156
|
....
|
890
1157
|
|
@@ -898,12 +1165,12 @@ PassengerMaxPoolSize 10
|
|
898
1165
|
ServerName www.foo.com
|
899
1166
|
DocumentRoot /webapps/foo/public
|
900
1167
|
RailsBaseURI /rails
|
901
|
-
</VirtualHost></
|
1168
|
+
</VirtualHost></pre>
|
902
1169
|
</div></div>
|
903
1170
|
<div class="paragraph"><p>…then comment out the relevant directives, so that it looks like this:</p></div>
|
904
1171
|
<div class="listingblock">
|
905
|
-
<div class="content">
|
906
|
-
<pre
|
1172
|
+
<div class="content monospaced">
|
1173
|
+
<pre>Listen *:80
|
907
1174
|
NameVirtualHosts *:80
|
908
1175
|
....
|
909
1176
|
|
@@ -917,7 +1184,7 @@ NameVirtualHosts *:80
|
|
917
1184
|
ServerName www.foo.com
|
918
1185
|
DocumentRoot /webapps/foo/public
|
919
1186
|
# RailsBaseURI /rails
|
920
|
-
</VirtualHost></
|
1187
|
+
</VirtualHost></pre>
|
921
1188
|
</div></div>
|
922
1189
|
<div class="paragraph"><p>After you’ve done this, save the file and restart Apache.</p></div>
|
923
1190
|
</div>
|
@@ -929,7 +1196,7 @@ done this, you need to remove the Phusion Passenger files.</p></div>
|
|
929
1196
|
<div class="ulist"><ul>
|
930
1197
|
<li>
|
931
1198
|
<p>
|
932
|
-
If you installed Phusion Passenger via a gem, then type <
|
1199
|
+
If you installed Phusion Passenger via a gem, then type <span class="monospaced">gem uninstall passenger</span>.
|
933
1200
|
You might have to run this as root.
|
934
1201
|
</p>
|
935
1202
|
</li>
|
@@ -943,7 +1210,7 @@ If you installed Phusion Passenger via a source tarball, then remove the directo
|
|
943
1210
|
<li>
|
944
1211
|
<p>
|
945
1212
|
If you installed Phusion Passenger via a Debian package, then remove type
|
946
|
-
<
|
1213
|
+
<span class="monospaced">sudo apt-get remove libapache2-mod-passenger</span>.
|
947
1214
|
</p>
|
948
1215
|
</li>
|
949
1216
|
</ul></div>
|
@@ -951,7 +1218,7 @@ If you installed Phusion Passenger via a Debian package, then remove type
|
|
951
1218
|
</div>
|
952
1219
|
</div>
|
953
1220
|
<div class="sect1">
|
954
|
-
<h2 id="
|
1221
|
+
<h2 id="_deploying_a_ruby_on_rails_1_x_or_2_x_but_not_rails_gt_3_x_application">3. Deploying a Ruby on Rails 1.x or 2.x (but NOT Rails >= 3.x) application</h2>
|
955
1222
|
<div class="sectionbody">
|
956
1223
|
<div class="paragraph"><p>Suppose you have a Ruby on Rails application in <em>/webapps/mycook</em>, and you own
|
957
1224
|
the domain <em>www.mycook.com</em>. You can either deploy your application to the
|
@@ -961,9 +1228,9 @@ accessible from a sub URL, such as <em>http://www.mycook.com/railsapplication</e
|
|
961
1228
|
<div class="admonitionblock">
|
962
1229
|
<table><tr>
|
963
1230
|
<td class="icon">
|
964
|
-
<img src="./images/icons/note.png" alt="Note"
|
1231
|
+
<img src="./images/icons/note.png" alt="Note">
|
965
1232
|
</td>
|
966
|
-
<td class="content">The default <
|
1233
|
+
<td class="content">The default <span class="monospaced">RAILS_ENV</span> environment in which deployed Rails applications
|
967
1234
|
are run, is “production”. You can change this by changing the
|
968
1235
|
<a href="#rails_env"><em>RailsEnv</em></a> configuration option.</td>
|
969
1236
|
</tr></table>
|
@@ -992,15 +1259,15 @@ MultiViews must be disabled for this folder.
|
|
992
1259
|
</ul></div>
|
993
1260
|
<div class="paragraph"><p>For example:</p></div>
|
994
1261
|
<div class="listingblock">
|
995
|
-
<div class="content">
|
996
|
-
<pre
|
1262
|
+
<div class="content monospaced">
|
1263
|
+
<pre><VirtualHost *:80>
|
997
1264
|
ServerName www.mycook.com
|
998
1265
|
DocumentRoot /webapps/mycook/public
|
999
1266
|
<Directory /webapps/mycook/public>
|
1000
1267
|
Allow from all
|
1001
1268
|
Options -MultiViews
|
1002
1269
|
</Directory>
|
1003
|
-
</VirtualHost></
|
1270
|
+
</VirtualHost></pre>
|
1004
1271
|
</div></div>
|
1005
1272
|
<div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
|
1006
1273
|
following folders are readable and executable by Apache:</p></div>
|
@@ -1027,22 +1294,22 @@ all parent folders. That is, /webapps/mycook and /webapps must also be readable
|
|
1027
1294
|
<h3 id="deploying_rails_to_sub_uri">3.2. Deploying to a sub URI</h3>
|
1028
1295
|
<div class="paragraph"><p>Suppose that you already have a virtual host:</p></div>
|
1029
1296
|
<div class="listingblock">
|
1030
|
-
<div class="content">
|
1031
|
-
<pre
|
1297
|
+
<div class="content monospaced">
|
1298
|
+
<pre><VirtualHost *:80>
|
1032
1299
|
ServerName www.phusion.nl
|
1033
1300
|
DocumentRoot /websites/phusion
|
1034
1301
|
<Directory /websites/phusion>
|
1035
1302
|
Allow from all
|
1036
1303
|
</Directory>
|
1037
|
-
</VirtualHost></
|
1304
|
+
</VirtualHost></pre>
|
1038
1305
|
</div></div>
|
1039
1306
|
<div class="paragraph"><p>And you want your Ruby on Rails application to be accessible from the URL
|
1040
1307
|
<em>http://www.phusion.nl/rails</em>.</p></div>
|
1041
1308
|
<div class="paragraph"><p>To do this, make a symlink in the virtual host’s document root, and have it
|
1042
1309
|
point to your Ruby on Rails application’s <em>public</em> folder. For example:</p></div>
|
1043
1310
|
<div class="listingblock">
|
1044
|
-
<div class="content">
|
1045
|
-
<pre
|
1311
|
+
<div class="content monospaced">
|
1312
|
+
<pre>ln -s /webapps/mycook/public /websites/phusion/rails</pre>
|
1046
1313
|
</div></div>
|
1047
1314
|
<div class="paragraph"><p>Next, add a <a href="#RailsBaseURI">RailsBaseURI</a> option to the virtual host configuration,
|
1048
1315
|
and also make sure that:</p></div>
|
@@ -1060,8 +1327,8 @@ MultiViews is disabled for this folder.
|
|
1060
1327
|
</ul></div>
|
1061
1328
|
<div class="paragraph"><p>For example:</p></div>
|
1062
1329
|
<div class="listingblock">
|
1063
|
-
<div class="content">
|
1064
|
-
<pre
|
1330
|
+
<div class="content monospaced">
|
1331
|
+
<pre><VirtualHost *:80>
|
1065
1332
|
ServerName www.phusion.nl
|
1066
1333
|
DocumentRoot /websites/phusion
|
1067
1334
|
<Directory /websites/phusion>
|
@@ -1072,13 +1339,13 @@ MultiViews is disabled for this folder.
|
|
1072
1339
|
<Directory /websites/phusion/rails> # <-- been added.
|
1073
1340
|
Options -MultiViews # <--
|
1074
1341
|
</Directory> # <--
|
1075
|
-
</VirtualHost></
|
1342
|
+
</VirtualHost></pre>
|
1076
1343
|
</div></div>
|
1077
1344
|
<div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
|
1078
1345
|
<div class="admonitionblock">
|
1079
1346
|
<table><tr>
|
1080
1347
|
<td class="icon">
|
1081
|
-
<img src="./images/icons/note.png" alt="Note"
|
1348
|
+
<img src="./images/icons/note.png" alt="Note">
|
1082
1349
|
</td>
|
1083
1350
|
<td class="content">If you’re deploying to a sub-URI then please make sure that your view
|
1084
1351
|
templates correctly handles references to sub-URI static assets! Otherwise
|
@@ -1090,19 +1357,19 @@ for more information.</td>
|
|
1090
1357
|
<div class="admonitionblock">
|
1091
1358
|
<table><tr>
|
1092
1359
|
<td class="icon">
|
1093
|
-
<img src="./images/icons/tip.png" alt="Tip"
|
1360
|
+
<img src="./images/icons/tip.png" alt="Tip">
|
1094
1361
|
</td>
|
1095
1362
|
<td class="content">
|
1096
1363
|
<div class="paragraph"><p>You can deploy multiple Rails applications under a virtual host, by specifying
|
1097
1364
|
<a href="#RailsBaseURI">RailsBaseURI</a> multiple times. For example:</p></div>
|
1098
1365
|
<div class="listingblock">
|
1099
|
-
<div class="content">
|
1100
|
-
<pre
|
1366
|
+
<div class="content monospaced">
|
1367
|
+
<pre><VirtualHost *:80>
|
1101
1368
|
....
|
1102
1369
|
RailsBaseURI /app1
|
1103
1370
|
RailsBaseURI /app2
|
1104
1371
|
RailsBaseURI /app3
|
1105
|
-
</VirtualHost></
|
1372
|
+
</VirtualHost></pre>
|
1106
1373
|
</div></div>
|
1107
1374
|
</td>
|
1108
1375
|
</tr></table>
|
@@ -1130,8 +1397,8 @@ By creating or modifying the file <em>tmp/restart.txt</em> in the Rails
|
|
1130
1397
|
<div class="paragraph"><p>For example, to restart our example MyCook application, we type this in the
|
1131
1398
|
command line:</p></div>
|
1132
1399
|
<div class="listingblock">
|
1133
|
-
<div class="content">
|
1134
|
-
<pre
|
1400
|
+
<div class="content monospaced">
|
1401
|
+
<pre>touch /webapps/mycook/tmp/restart.txt</pre>
|
1135
1402
|
</div></div>
|
1136
1403
|
<div class="paragraph"><p>Please note that, unlike earlier versions of Phusion Passenger, <em>restart.txt</em>
|
1137
1404
|
is not automatically deleted. Phusion Passenger checks whether the timestamp
|
@@ -1142,7 +1409,7 @@ be restarted.</p></div>
|
|
1142
1409
|
<h3 id="_migrations">3.4. Migrations</h3>
|
1143
1410
|
<div class="paragraph"><p>Phusion Passenger is not related to Ruby on Rails migrations in any way. To
|
1144
1411
|
run migrations on your deployment server, please login to your deployment
|
1145
|
-
server (e.g. with <em>ssh</em>) and type <
|
1412
|
+
server (e.g. with <em>ssh</em>) and type <span class="monospaced">rake db:migrate RAILS_ENV=production</span> in
|
1146
1413
|
a shell console, just like one would normally run migrations.</p></div>
|
1147
1414
|
</div>
|
1148
1415
|
<div class="sect2">
|
@@ -1152,7 +1419,7 @@ a shell console, just like one would normally run migrations.</p></div>
|
|
1152
1419
|
</div>
|
1153
1420
|
</div>
|
1154
1421
|
<div class="sect1">
|
1155
|
-
<h2 id="
|
1422
|
+
<h2 id="_deploying_a_rack_based_ruby_application_including_rails_gt_3">4. Deploying a Rack-based Ruby application (including Rails >= 3)</h2>
|
1156
1423
|
<div class="sectionbody">
|
1157
1424
|
<div class="paragraph"><p>Phusion Passenger supports arbitrary Ruby web applications that follow the
|
1158
1425
|
<a href="http://rack.rubyforge.org/">Rack</a> interface.</p></div>
|
@@ -1180,14 +1447,14 @@ folder must contain at least three entries:</p></div>
|
|
1180
1447
|
</ul></div>
|
1181
1448
|
<div class="paragraph"><p>So <em>/webapps/rackapp</em> must, at minimum, look like this:</p></div>
|
1182
1449
|
<div class="listingblock">
|
1183
|
-
<div class="content">
|
1184
|
-
<pre
|
1450
|
+
<div class="content monospaced">
|
1451
|
+
<pre>/webapps/rackapp
|
1185
1452
|
|
|
1186
1453
|
+-- config.ru
|
1187
1454
|
|
|
1188
1455
|
+-- public/
|
1189
1456
|
|
|
1190
|
-
+-- tmp/</
|
1457
|
+
+-- tmp/</pre>
|
1191
1458
|
</div></div>
|
1192
1459
|
<div class="paragraph"><p>Suppose you own the domain <em>www.rackapp.com</em>. You can either deploy your application
|
1193
1460
|
to the virtual host’s root (i.e. the application will be accessible from the root URL,
|
@@ -1196,9 +1463,9 @@ accessible from a sub URL, such as <em>http://www.rackapp.com/rackapp</em>).</p>
|
|
1196
1463
|
<div class="admonitionblock">
|
1197
1464
|
<table><tr>
|
1198
1465
|
<td class="icon">
|
1199
|
-
<img src="./images/icons/note.png" alt="Note"
|
1466
|
+
<img src="./images/icons/note.png" alt="Note">
|
1200
1467
|
</td>
|
1201
|
-
<td class="content">The default <
|
1468
|
+
<td class="content">The default <span class="monospaced">RACK_ENV</span> environment in which deployed Rack applications
|
1202
1469
|
are run, is “production”. You can change this by changing the
|
1203
1470
|
<a href="#rack_env"><em>RackEnv</em></a> configuration option.</td>
|
1204
1471
|
</tr></table>
|
@@ -1207,35 +1474,35 @@ are run, is “production”. You can change this by changing the
|
|
1207
1474
|
<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>
|
1208
1475
|
<div class="paragraph"><p>First we create a Phusion Passenger-compliant Rack directory structure:</p></div>
|
1209
1476
|
<div class="listingblock">
|
1210
|
-
<div class="content">
|
1211
|
-
<pre
|
1477
|
+
<div class="content monospaced">
|
1478
|
+
<pre>$ mkdir /webapps/rack_example
|
1212
1479
|
$ mkdir /webapps/rack_example/public
|
1213
|
-
$ mkdir /webapps/rack_example/tmp</
|
1480
|
+
$ mkdir /webapps/rack_example/tmp</pre>
|
1214
1481
|
</div></div>
|
1215
1482
|
<div class="paragraph"><p>Next, we write a minimal "hello world" Rack application:</p></div>
|
1216
1483
|
<div class="listingblock">
|
1217
|
-
<div class="content">
|
1218
|
-
<pre
|
1484
|
+
<div class="content monospaced">
|
1485
|
+
<pre>$ cd /webapps/rack_example
|
1219
1486
|
$ some_awesome_editor config.ru
|
1220
1487
|
...type in some source code...
|
1221
1488
|
$ cat config.ru
|
1222
1489
|
app = proc do |env|
|
1223
1490
|
[200, { "Content-Type" => "text/html" }, ["hello <b>world</b>"]]
|
1224
1491
|
end
|
1225
|
-
run app</
|
1492
|
+
run app</pre>
|
1226
1493
|
</div></div>
|
1227
1494
|
<div class="paragraph"><p>Finally, we deploy it by adding the following configuration options to
|
1228
1495
|
the Apache configuration file:</p></div>
|
1229
1496
|
<div class="listingblock">
|
1230
|
-
<div class="content">
|
1231
|
-
<pre
|
1497
|
+
<div class="content monospaced">
|
1498
|
+
<pre><VirtualHost *:80>
|
1232
1499
|
ServerName www.rackexample.com
|
1233
1500
|
DocumentRoot /webapps/rack_example/public
|
1234
1501
|
<Directory /webapps/rack_example/public>
|
1235
1502
|
Allow from all
|
1236
1503
|
Options -MultiViews
|
1237
1504
|
</Directory>
|
1238
|
-
</VirtualHost></
|
1505
|
+
</VirtualHost></pre>
|
1239
1506
|
</div></div>
|
1240
1507
|
<div class="paragraph"><p>And we’re done! After an Apache restart, the above Rack application will be available
|
1241
1508
|
under the URL <em>http://www.rackexample.com/</em>.</p></div>
|
@@ -1264,15 +1531,15 @@ MultiViews must be disabled for this folder.
|
|
1264
1531
|
</ul></div>
|
1265
1532
|
<div class="paragraph"><p>For example:</p></div>
|
1266
1533
|
<div class="listingblock">
|
1267
|
-
<div class="content">
|
1268
|
-
<pre
|
1534
|
+
<div class="content monospaced">
|
1535
|
+
<pre><VirtualHost *:80>
|
1269
1536
|
ServerName www.rackapp.com
|
1270
1537
|
DocumentRoot /webapps/rackapp/public
|
1271
1538
|
<Directory /webapps/rackapp/public>
|
1272
1539
|
Allow from all
|
1273
1540
|
Options -MultiViews
|
1274
1541
|
</Directory>
|
1275
|
-
</VirtualHost></
|
1542
|
+
</VirtualHost></pre>
|
1276
1543
|
</div></div>
|
1277
1544
|
<div class="paragraph"><p>You may also need to tweak your file/folder permissions. Make sure that the
|
1278
1545
|
following folders are readable and executable by Apache:</p></div>
|
@@ -1299,22 +1566,22 @@ all parent folders. That is, /webapps/rackapp and /webapps must also be readable
|
|
1299
1566
|
<h3 id="deploying_rack_to_sub_uri">4.3. Deploying to a sub URI</h3>
|
1300
1567
|
<div class="paragraph"><p>Suppose that you already have a virtual host:</p></div>
|
1301
1568
|
<div class="listingblock">
|
1302
|
-
<div class="content">
|
1303
|
-
<pre
|
1569
|
+
<div class="content monospaced">
|
1570
|
+
<pre><VirtualHost *:80>
|
1304
1571
|
ServerName www.phusion.nl
|
1305
1572
|
DocumentRoot /websites/phusion
|
1306
1573
|
<Directory /websites/phusion>
|
1307
1574
|
Allow from all
|
1308
1575
|
</Directory>
|
1309
|
-
</VirtualHost></
|
1576
|
+
</VirtualHost></pre>
|
1310
1577
|
</div></div>
|
1311
1578
|
<div class="paragraph"><p>And you want your Rack application to be accessible from the URL
|
1312
1579
|
<em>http://www.phusion.nl/rack</em>.</p></div>
|
1313
1580
|
<div class="paragraph"><p>To do this, make a symlink in the virtual host’s document root, and have it
|
1314
1581
|
point to your Rack application’s <em>public</em> folder. For example:</p></div>
|
1315
1582
|
<div class="listingblock">
|
1316
|
-
<div class="content">
|
1317
|
-
<pre
|
1583
|
+
<div class="content monospaced">
|
1584
|
+
<pre>ln -s /webapps/rackapp/public /websites/phusion/rack</pre>
|
1318
1585
|
</div></div>
|
1319
1586
|
<div class="paragraph"><p>Next, add a <a href="#RackBaseURI">RackBaseURI</a> option to the virtual host configuration,
|
1320
1587
|
and also make sure that:</p></div>
|
@@ -1332,8 +1599,8 @@ MultiViews is disabled for this folder.
|
|
1332
1599
|
</ul></div>
|
1333
1600
|
<div class="paragraph"><p>For example:</p></div>
|
1334
1601
|
<div class="listingblock">
|
1335
|
-
<div class="content">
|
1336
|
-
<pre
|
1602
|
+
<div class="content monospaced">
|
1603
|
+
<pre><VirtualHost *:80>
|
1337
1604
|
ServerName www.phusion.nl
|
1338
1605
|
DocumentRoot /websites/phusion
|
1339
1606
|
<Directory /websites/phusion>
|
@@ -1344,25 +1611,25 @@ MultiViews is disabled for this folder.
|
|
1344
1611
|
<Directory /websites/phusion/rails> # <-- been added.
|
1345
1612
|
Options -MultiViews # <--
|
1346
1613
|
</Directory> # <--
|
1347
|
-
</VirtualHost></
|
1614
|
+
</VirtualHost></pre>
|
1348
1615
|
</div></div>
|
1349
1616
|
<div class="paragraph"><p>Then restart Apache. The application has now been deployed.</p></div>
|
1350
1617
|
<div class="admonitionblock">
|
1351
1618
|
<table><tr>
|
1352
1619
|
<td class="icon">
|
1353
|
-
<img src="./images/icons/tip.png" alt="Tip"
|
1620
|
+
<img src="./images/icons/tip.png" alt="Tip">
|
1354
1621
|
</td>
|
1355
1622
|
<td class="content">
|
1356
1623
|
<div class="paragraph"><p>You can deploy multiple Rack applications under a virtual host, by specifying
|
1357
1624
|
<a href="#RackBaseURI">RackBaseURI</a> multiple times. For example:</p></div>
|
1358
1625
|
<div class="listingblock">
|
1359
|
-
<div class="content">
|
1360
|
-
<pre
|
1626
|
+
<div class="content monospaced">
|
1627
|
+
<pre><VirtualHost *:80>
|
1361
1628
|
....
|
1362
1629
|
RackBaseURI /app1
|
1363
1630
|
RackBaseURI /app2
|
1364
1631
|
RackBaseURI /app3
|
1365
|
-
</VirtualHost></
|
1632
|
+
</VirtualHost></pre>
|
1366
1633
|
</div></div>
|
1367
1634
|
</td>
|
1368
1635
|
</tr></table>
|
@@ -1390,8 +1657,8 @@ By creating or modifying the file <em>tmp/restart.txt</em> in the Rack
|
|
1390
1657
|
<div class="paragraph"><p>For example, to restart our example application, we type this in the
|
1391
1658
|
command line:</p></div>
|
1392
1659
|
<div class="listingblock">
|
1393
|
-
<div class="content">
|
1394
|
-
<pre
|
1660
|
+
<div class="content monospaced">
|
1661
|
+
<pre>touch /webapps/rackapp/tmp/restart.txt</pre>
|
1395
1662
|
</div></div>
|
1396
1663
|
</div>
|
1397
1664
|
<div class="sect2">
|
@@ -1400,8 +1667,8 @@ command line:</p></div>
|
|
1400
1667
|
<div class="sect3">
|
1401
1668
|
<h4 id="_camping">4.5.1. Camping</h4>
|
1402
1669
|
<div class="listingblock">
|
1403
|
-
<div class="content">
|
1404
|
-
<pre
|
1670
|
+
<div class="content monospaced">
|
1671
|
+
<pre>require 'rubygems'
|
1405
1672
|
require 'rack'
|
1406
1673
|
require 'camping'
|
1407
1674
|
|
@@ -1411,37 +1678,37 @@ Camping.goes :Blog
|
|
1411
1678
|
...your application code here...
|
1412
1679
|
##### End Camping application
|
1413
1680
|
|
1414
|
-
run Rack::Adapter::Camping.new(Blog)</
|
1681
|
+
run Rack::Adapter::Camping.new(Blog)</pre>
|
1415
1682
|
</div></div>
|
1416
|
-
<div class="paragraph"><p>For Camping versions 2.0 and up, using <
|
1683
|
+
<div class="paragraph"><p>For Camping versions 2.0 and up, using <span class="monospaced">run Blog</span> as the final line will do.</p></div>
|
1417
1684
|
</div>
|
1418
1685
|
<div class="sect3">
|
1419
1686
|
<h4 id="_halcyon">4.5.2. Halcyon</h4>
|
1420
1687
|
<div class="listingblock">
|
1421
|
-
<div class="content">
|
1422
|
-
<pre
|
1688
|
+
<div class="content monospaced">
|
1689
|
+
<pre>require 'rubygems'
|
1423
1690
|
require 'halcyon'
|
1424
1691
|
$LOAD_PATH.unshift(Halcyon.root / 'lib')
|
1425
1692
|
Halcyon::Runner.load_config Halcyon.root/'config'/'config.yml'
|
1426
|
-
run Halcyon::Runner.new</
|
1693
|
+
run Halcyon::Runner.new</pre>
|
1427
1694
|
</div></div>
|
1428
1695
|
</div>
|
1429
1696
|
<div class="sect3">
|
1430
1697
|
<h4 id="_mack">4.5.3. Mack</h4>
|
1431
1698
|
<div class="listingblock">
|
1432
|
-
<div class="content">
|
1433
|
-
<pre
|
1699
|
+
<div class="content monospaced">
|
1700
|
+
<pre>ENV["MACK_ENV"] = ENV["RACK_ENV"]
|
1434
1701
|
load("Rakefile")
|
1435
1702
|
require 'rubygems'
|
1436
1703
|
require 'mack'
|
1437
|
-
run Mack::Utils::Server.build_app</
|
1704
|
+
run Mack::Utils::Server.build_app</pre>
|
1438
1705
|
</div></div>
|
1439
1706
|
</div>
|
1440
1707
|
<div class="sect3">
|
1441
1708
|
<h4 id="_merb">4.5.4. Merb</h4>
|
1442
1709
|
<div class="listingblock">
|
1443
|
-
<div class="content">
|
1444
|
-
<pre
|
1710
|
+
<div class="content monospaced">
|
1711
|
+
<pre>require 'rubygems'
|
1445
1712
|
require 'merb-core'
|
1446
1713
|
|
1447
1714
|
Merb::Config.setup(
|
@@ -1452,30 +1719,30 @@ Merb.environment = Merb::Config[:environment]
|
|
1452
1719
|
Merb.root = Merb::Config[:merb_root]
|
1453
1720
|
Merb::BootLoader.run
|
1454
1721
|
|
1455
|
-
run Merb::Rack::Application.new</
|
1722
|
+
run Merb::Rack::Application.new</pre>
|
1456
1723
|
</div></div>
|
1457
1724
|
</div>
|
1458
1725
|
<div class="sect3">
|
1459
1726
|
<h4 id="_ramaze">4.5.5. Ramaze</h4>
|
1460
1727
|
<div class="listingblock">
|
1461
|
-
<div class="content">
|
1462
|
-
<pre
|
1728
|
+
<div class="content monospaced">
|
1729
|
+
<pre>require "rubygems"
|
1463
1730
|
require "ramaze"
|
1464
1731
|
Ramaze.trait[:essentials].delete Ramaze::Adapter
|
1465
1732
|
require "start"
|
1466
1733
|
Ramaze.start!
|
1467
|
-
run Ramaze::Adapter::Base</
|
1734
|
+
run Ramaze::Adapter::Base</pre>
|
1468
1735
|
</div></div>
|
1469
1736
|
</div>
|
1470
1737
|
<div class="sect3">
|
1471
1738
|
<h4 id="_sinatra">4.5.6. Sinatra</h4>
|
1472
1739
|
<div class="listingblock">
|
1473
|
-
<div class="content">
|
1474
|
-
<pre
|
1740
|
+
<div class="content monospaced">
|
1741
|
+
<pre>require 'rubygems'
|
1475
1742
|
require 'sinatra'
|
1476
1743
|
require 'app.rb'
|
1477
1744
|
|
1478
|
-
run Sinatra::Application</
|
1745
|
+
run Sinatra::Application</pre>
|
1479
1746
|
</div></div>
|
1480
1747
|
</div>
|
1481
1748
|
</div>
|
@@ -1524,25 +1791,25 @@ In a virtual host configuration block.
|
|
1524
1791
|
</li>
|
1525
1792
|
<li>
|
1526
1793
|
<p>
|
1527
|
-
In a <
|
1794
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
1528
1795
|
</p>
|
1529
1796
|
</li>
|
1530
1797
|
<li>
|
1531
1798
|
<p>
|
1532
|
-
In <em>.htaccess</em>, if <
|
1799
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span> is on.
|
1533
1800
|
</p>
|
1534
1801
|
</li>
|
1535
1802
|
</ul></div>
|
1536
1803
|
<div class="paragraph"><p>In each place, it may be specified at most once.</p></div>
|
1537
1804
|
<div class="paragraph"><p>Example:</p></div>
|
1538
1805
|
<div class="listingblock">
|
1539
|
-
<div class="content">
|
1540
|
-
<pre
|
1806
|
+
<div class="content monospaced">
|
1807
|
+
<pre><VirtualHost test.host>
|
1541
1808
|
DocumentRoot /var/rails/zena/sites/example.com/public
|
1542
1809
|
PassengerAppRoot /var/rails/zena # <-- normally Phusion Passenger would
|
1543
1810
|
# have assumed that the application
|
1544
1811
|
# root is "/var/rails/zena/sites/example.com"
|
1545
|
-
</VirtualHost></
|
1812
|
+
</VirtualHost></pre>
|
1546
1813
|
</div></div>
|
1547
1814
|
</div>
|
1548
1815
|
<div class="sect2">
|
@@ -1550,7 +1817,7 @@ In <em>.htaccess</em>, if <tt>AllowOverride Options</tt> is on.
|
|
1550
1817
|
<div class="admonitionblock">
|
1551
1818
|
<table><tr>
|
1552
1819
|
<td class="icon">
|
1553
|
-
<img src="./images/icons/tip.png" alt="Tip"
|
1820
|
+
<img src="./images/icons/tip.png" alt="Tip">
|
1554
1821
|
</td>
|
1555
1822
|
<td class="content">
|
1556
1823
|
<div class="title">"What spawn method should I use?"</div>
|
@@ -1559,7 +1826,7 @@ understand it, as it’s mostly a technical detail. You can basically follow
|
|
1559
1826
|
<div class="sidebarblock">
|
1560
1827
|
<div class="content">
|
1561
1828
|
<div class="paragraph"><p>If your application works on Mongrel, but not on Phusion Passenger, then set
|
1562
|
-
<
|
1829
|
+
<span class="monospaced">PassengerSpawnMethod</span> to <em>conservative</em>. Otherwise, leave it at <em>smart-lv2</em> (the default).</p></div>
|
1563
1830
|
</div></div>
|
1564
1831
|
<div class="paragraph"><p>However, we do recommend you to try to understand it. The <em>smart</em> and <em>smart-lv2</em> spawn
|
1565
1832
|
methods bring many benefits.</p></div>
|
@@ -1694,31 +1961,31 @@ we’re currently in a state where all backend processes have 3 requests in
|
|
1694
1961
|
</ul></div>
|
1695
1962
|
<div class="paragraph"><p>The situation looks like this:</p></div>
|
1696
1963
|
<div class="listingblock">
|
1697
|
-
<div class="content">
|
1698
|
-
<pre
|
1964
|
+
<div class="content monospaced">
|
1965
|
+
<pre>Backend process A: [* ] (1 request in queue)
|
1699
1966
|
Backend process B: [*** ] (3 requests in queue)
|
1700
1967
|
Backend process C: [*** ] (3 requests in queue)
|
1701
|
-
Backend process D: [*** ] (3 requests in queue)</
|
1968
|
+
Backend process D: [*** ] (3 requests in queue)</pre>
|
1702
1969
|
</div></div>
|
1703
1970
|
<div class="paragraph"><p>Each process is currently serving short-running requests.</p></div>
|
1704
1971
|
<div class="paragraph"><p>Phusion Passenger will forward the next request to backend process A. A will
|
1705
1972
|
now have 2 items in its queue. We’ll mark this new request with an X:</p></div>
|
1706
1973
|
<div class="listingblock">
|
1707
|
-
<div class="content">
|
1708
|
-
<pre
|
1974
|
+
<div class="content monospaced">
|
1975
|
+
<pre>Backend process A: [*X ] (2 request in queue)
|
1709
1976
|
Backend process B: [*** ] (3 requests in queue)
|
1710
1977
|
Backend process C: [*** ] (3 requests in queue)
|
1711
|
-
Backend process D: [*** ] (3 requests in queue)</
|
1978
|
+
Backend process D: [*** ] (3 requests in queue)</pre>
|
1712
1979
|
</div></div>
|
1713
1980
|
<div class="paragraph"><p>Assuming that B, C and D still aren’t done with their current request, the next
|
1714
1981
|
HTTP request - let’s call this Y - will be forwarded to backend process A as
|
1715
1982
|
well, because it has the least number of items in its queue:</p></div>
|
1716
1983
|
<div class="listingblock">
|
1717
|
-
<div class="content">
|
1718
|
-
<pre
|
1984
|
+
<div class="content monospaced">
|
1985
|
+
<pre>Backend process A: [*XY ] (3 requests in queue)
|
1719
1986
|
Backend process B: [*** ] (3 requests in queue)
|
1720
1987
|
Backend process C: [*** ] (3 requests in queue)
|
1721
|
-
Backend process D: [*** ] (3 requests in queue)</
|
1988
|
+
Backend process D: [*** ] (3 requests in queue)</pre>
|
1722
1989
|
</div></div>
|
1723
1990
|
<div class="paragraph"><p>But if request X happens to be a long-running request that needs 60 seconds to
|
1724
1991
|
complete, then we’ll have a problem. Y won’t be processed for at least 60
|
@@ -1739,15 +2006,15 @@ dropped Wordpress — a blogging application written in PHP̴
|
|
1739
2006
|
<em>/apps/foo/public/wordpress</em>. You can then configure Phusion Passenger as
|
1740
2007
|
follows:</p></div>
|
1741
2008
|
<div class="listingblock">
|
1742
|
-
<div class="content">
|
1743
|
-
<pre
|
2009
|
+
<div class="content monospaced">
|
2010
|
+
<pre><VirtualHost *:80>
|
1744
2011
|
ServerName www.foo.com
|
1745
2012
|
DocumentRoot /apps/foo/public
|
1746
2013
|
<Directory /apps/foo/public/wordpress>
|
1747
2014
|
PassengerEnabled off
|
1748
2015
|
AllowOverride all # <-- Makes Wordpress's .htaccess file work.
|
1749
2016
|
</Directory>
|
1750
|
-
</VirtualHost></
|
2017
|
+
</VirtualHost></pre>
|
1751
2018
|
</div></div>
|
1752
2019
|
<div class="paragraph"><p>This way, Phusion Passenger will not interfere with Wordpress.</p></div>
|
1753
2020
|
<div class="paragraph"><p><em>PassengerEnabled</em> may occur in the following places:</p></div>
|
@@ -1764,7 +2031,7 @@ In a virtual host configuration block.
|
|
1764
2031
|
</li>
|
1765
2032
|
<li>
|
1766
2033
|
<p>
|
1767
|
-
In a <
|
2034
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
1768
2035
|
</p>
|
1769
2036
|
</li>
|
1770
2037
|
<li>
|
@@ -1786,18 +2053,18 @@ default temp directory that Phusion Passenger uses is <em>/tmp</em>.</p></div>
|
|
1786
2053
|
(which is the case on some systems with strict SELinux policies) or if the
|
1787
2054
|
partition that /tmp lives on doesn’t have enough disk space.</p></div>
|
1788
2055
|
<div class="paragraph"><div class="title">Command line tools</div><p>Some Phusion Passenger command line administration tools, such as
|
1789
|
-
<
|
2056
|
+
<span class="monospaced">passenger-status</span>, must know what Phusion Passenger’s temp directory is
|
1790
2057
|
in order to function properly. You can pass the directory through the
|
1791
|
-
<
|
2058
|
+
<span class="monospaced">PASSENGER_TMPDIR</span> environment variable, or the <span class="monospaced">TMPDIR</span> environment variable
|
1792
2059
|
(the former will be used if both are specified).</p></div>
|
1793
2060
|
<div class="paragraph"><p>For example, if you set <em>PassengerTempDir</em> to <em>/my_temp_dir</em>, then invoke
|
1794
|
-
<
|
2061
|
+
<span class="monospaced">passenger-status</span> after you’ve set the <span class="monospaced">PASSENGER_TMPDIR</span> or <span class="monospaced">TMPDIR</span>
|
1795
2062
|
environment variable, like this:</p></div>
|
1796
2063
|
<div class="listingblock">
|
1797
|
-
<div class="content">
|
1798
|
-
<pre
|
2064
|
+
<div class="content monospaced">
|
2065
|
+
<pre>export PASSENGER_TMPDIR=/my_temp-dir
|
1799
2066
|
sudo -E passenger-status
|
1800
|
-
# The -E option tells 'sudo' to preserve environment variables.</
|
2067
|
+
# The -E option tells 'sudo' to preserve environment variables.</pre>
|
1801
2068
|
</div></div>
|
1802
2069
|
</div>
|
1803
2070
|
<div class="sect2">
|
@@ -1832,12 +2099,12 @@ In a virtual host configuration block.
|
|
1832
2099
|
</li>
|
1833
2100
|
<li>
|
1834
2101
|
<p>
|
1835
|
-
In a <
|
2102
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
1836
2103
|
</p>
|
1837
2104
|
</li>
|
1838
2105
|
<li>
|
1839
2106
|
<p>
|
1840
|
-
In <em>.htaccess</em>, if <
|
2107
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverrides Options</span> is enabled.
|
1841
2108
|
</p>
|
1842
2109
|
</li>
|
1843
2110
|
</ul></div>
|
@@ -1865,12 +2132,12 @@ In a virtual host configuration block.
|
|
1865
2132
|
</li>
|
1866
2133
|
<li>
|
1867
2134
|
<p>
|
1868
|
-
In a <
|
2135
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
1869
2136
|
</p>
|
1870
2137
|
</li>
|
1871
2138
|
<li>
|
1872
2139
|
<p>
|
1873
|
-
In <em>.htaccess</em>, if <
|
2140
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverrides Options</span> is enabled.
|
1874
2141
|
</p>
|
1875
2142
|
</li>
|
1876
2143
|
</ul></div>
|
@@ -1878,8 +2145,8 @@ In <em>.htaccess</em>, if <tt>AllowOverrides Options</tt> is enabled.
|
|
1878
2145
|
<div class="paragraph"><p>You can either set it to an absolute directory, or to a directory relative to
|
1879
2146
|
the <a href="#application_root">application root</a>. Examples:</p></div>
|
1880
2147
|
<div class="listingblock">
|
1881
|
-
<div class="content">
|
1882
|
-
<pre
|
2148
|
+
<div class="content monospaced">
|
2149
|
+
<pre><VirtualHost *:80>
|
1883
2150
|
ServerName www.foo.com
|
1884
2151
|
# Phusion Passenger will check for /apps/foo/public/tmp/restart.txt
|
1885
2152
|
DocumentRoot /apps/foo/public
|
@@ -1902,7 +2169,7 @@ the <a href="#application_root">application root</a>. Examples:</p></div>
|
|
1902
2169
|
# Note that this directory is relative to the APPLICATION ROOT, *not*
|
1903
2170
|
# the value of DocumentRoot!
|
1904
2171
|
PassengerRestartDir restart_files
|
1905
|
-
</VirtualHost></
|
2172
|
+
</VirtualHost></pre>
|
1906
2173
|
</div></div>
|
1907
2174
|
<div class="paragraph"><div class="title">What are the security reasons for wanting to customize PassengerRestartDir?</div><p>Touching restart.txt will cause Phusion Passenger to restart the application.
|
1908
2175
|
So anybody who can touch restart.txt can effectively cause a Denial-of-Service
|
@@ -1924,7 +2191,7 @@ The default value is <em>on</em>.</p></div>
|
|
1924
2191
|
<div class="sect3">
|
1925
2192
|
<h4 id="_passengeruser_lt_username_gt">5.10.2. PassengerUser <username></h4>
|
1926
2193
|
<div class="paragraph"><p>If <a href="#user_switching">user switching support</a> is enabled, then Phusion Passenger will
|
1927
|
-
by default run the web application as the owner
|
2194
|
+
by default run the web application as the owner of the file <em>config/environment.rb</em>
|
1928
2195
|
(for Rails apps) or <em>config.ru</em> (for Rack apps). This option allows you to override
|
1929
2196
|
that behavior and explicitly set a user to run the web application as, regardless
|
1930
2197
|
of the ownership of <em>environment.rb</em>/<em>config.ru</em>.</p></div>
|
@@ -1942,7 +2209,7 @@ In a virtual host configuration block.
|
|
1942
2209
|
</li>
|
1943
2210
|
<li>
|
1944
2211
|
<p>
|
1945
|
-
In a <
|
2212
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
1946
2213
|
</p>
|
1947
2214
|
</li>
|
1948
2215
|
</ul></div>
|
@@ -1971,7 +2238,7 @@ In a virtual host configuration block.
|
|
1971
2238
|
</li>
|
1972
2239
|
<li>
|
1973
2240
|
<p>
|
1974
|
-
In a <
|
2241
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
1975
2242
|
</p>
|
1976
2243
|
</li>
|
1977
2244
|
</ul></div>
|
@@ -2017,12 +2284,12 @@ In a virtual host configuration block.
|
|
2017
2284
|
</li>
|
2018
2285
|
<li>
|
2019
2286
|
<p>
|
2020
|
-
In a <
|
2287
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2021
2288
|
</p>
|
2022
2289
|
</li>
|
2023
2290
|
<li>
|
2024
2291
|
<p>
|
2025
|
-
In <em>.htaccess</em>, if <
|
2292
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span> is on.
|
2026
2293
|
</p>
|
2027
2294
|
</li>
|
2028
2295
|
</ul></div>
|
@@ -2051,7 +2318,7 @@ The default value is <em>6</em>.</p></div>
|
|
2051
2318
|
<div class="admonitionblock">
|
2052
2319
|
<table><tr>
|
2053
2320
|
<td class="icon">
|
2054
|
-
<img src="./images/icons/tip.png" alt="Tip"
|
2321
|
+
<img src="./images/icons/tip.png" alt="Tip">
|
2055
2322
|
</td>
|
2056
2323
|
<td class="content">We strongly recommend you to <a href="#reducing_memory_usage">use Ruby Enterprise Edition</a>. This allows you to reduce the memory usage of your Ruby on Rails applications
|
2057
2324
|
by about 33%. And it’s not hard to install.</td>
|
@@ -2084,15 +2351,15 @@ the given number of processes will be kept around even when instances are being
|
|
2084
2351
|
but <a href="#PassengerPreStart">PassengerPreStart</a> explains the rationale behind it.</p></div>
|
2085
2352
|
<div class="paragraph"><p>For example, suppose that you have the following configuration:</p></div>
|
2086
2353
|
<div class="listingblock">
|
2087
|
-
<div class="content">
|
2088
|
-
<pre
|
2354
|
+
<div class="content monospaced">
|
2355
|
+
<pre>PassengerMaxPoolSize 15
|
2089
2356
|
PassengerPoolIdleTime 10
|
2090
2357
|
|
2091
2358
|
<VirtualHost *:80>
|
2092
2359
|
ServerName foobar.com
|
2093
2360
|
DocumentRoot /webapps/foobar/public
|
2094
2361
|
PassengerMinInstances 3
|
2095
|
-
</VirtualHost></
|
2362
|
+
</VirtualHost></pre>
|
2096
2363
|
</div></div>
|
2097
2364
|
<div class="paragraph"><p>When you start Apache, there are 0 application instances for <em>foobar.com</em>. Things will
|
2098
2365
|
stay that way until someone visits <em>foobar.com</em>. Suppose that there is only 1 visitor.
|
@@ -2117,12 +2384,12 @@ In a virtual host configuration block.
|
|
2117
2384
|
</li>
|
2118
2385
|
<li>
|
2119
2386
|
<p>
|
2120
|
-
In a <
|
2387
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2121
2388
|
</p>
|
2122
2389
|
</li>
|
2123
2390
|
<li>
|
2124
2391
|
<p>
|
2125
|
-
In <em>.htaccess</em>, if <
|
2392
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> is on.
|
2126
2393
|
</p>
|
2127
2394
|
</li>
|
2128
2395
|
</ul></div>
|
@@ -2150,7 +2417,7 @@ more often. Since spawning is a relatively slow operation, some visitors may
|
|
2150
2417
|
notice a small delay when they visit your Rails/Rack website. However, it will also
|
2151
2418
|
free up resources used by applications more quickly.</p></div>
|
2152
2419
|
<div class="paragraph"><p>The optimal value depends on the average time that a visitor spends on a single
|
2153
|
-
Rails/Rack web page. We recommend a value of <
|
2420
|
+
Rails/Rack web page. We recommend a value of <span class="monospaced">2 * x</span>, where <span class="monospaced">x</span> is the average
|
2154
2421
|
number of seconds that a visitor spends on a single Rails/Rack web page. But your
|
2155
2422
|
mileage may vary.</p></div>
|
2156
2423
|
<div class="paragraph"><p>When this value is set to <em>0</em>, application instances will not be shutdown unless
|
@@ -2186,12 +2453,12 @@ In a virtual host configuration block.
|
|
2186
2453
|
</li>
|
2187
2454
|
<li>
|
2188
2455
|
<p>
|
2189
|
-
In a <
|
2456
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2190
2457
|
</p>
|
2191
2458
|
</li>
|
2192
2459
|
<li>
|
2193
2460
|
<p>
|
2194
|
-
In <em>.htaccess</em>, if <
|
2461
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> is on.
|
2195
2462
|
</p>
|
2196
2463
|
</li>
|
2197
2464
|
</ul></div>
|
@@ -2199,7 +2466,7 @@ In <em>.htaccess</em>, if <tt>AllowOverride Limits</tt> is on.
|
|
2199
2466
|
<div class="admonitionblock">
|
2200
2467
|
<table><tr>
|
2201
2468
|
<td class="icon">
|
2202
|
-
<img src="./images/icons/caution.png" alt="Caution"
|
2469
|
+
<img src="./images/icons/caution.png" alt="Caution">
|
2203
2470
|
</td>
|
2204
2471
|
<td class="content">
|
2205
2472
|
<div class="paragraph"><p>The <a href="#PassengerMaxRequests">PassengerMaxRequests</a> directive should be considered
|
@@ -2251,12 +2518,12 @@ In a virtual host configuration block.
|
|
2251
2518
|
</li>
|
2252
2519
|
<li>
|
2253
2520
|
<p>
|
2254
|
-
In a <
|
2521
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2255
2522
|
</p>
|
2256
2523
|
</li>
|
2257
2524
|
<li>
|
2258
2525
|
<p>
|
2259
|
-
In <em>.htaccess</em>, if <
|
2526
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Limits</span> is on.
|
2260
2527
|
</p>
|
2261
2528
|
</li>
|
2262
2529
|
</ul></div>
|
@@ -2325,8 +2592,8 @@ In a virtual host configuration block.
|
|
2325
2592
|
<h5 id="_example_1_basic_usage">Example 1: basic usage</h5>
|
2326
2593
|
<div class="paragraph"><p>Suppose that you have the following web applications.</p></div>
|
2327
2594
|
<div class="listingblock">
|
2328
|
-
<div class="content">
|
2329
|
-
<pre
|
2595
|
+
<div class="content monospaced">
|
2596
|
+
<pre><VirtualHost *:80>
|
2330
2597
|
ServerName foo.com
|
2331
2598
|
DocumentRoot /webapps/foo/public
|
2332
2599
|
</VirtualHost>
|
@@ -2334,15 +2601,15 @@ In a virtual host configuration block.
|
|
2334
2601
|
<VirtualHost *:3500>
|
2335
2602
|
ServerName bar.com
|
2336
2603
|
DocumentRoot /webapps/bar/public
|
2337
|
-
</VirtualHost></
|
2604
|
+
</VirtualHost></pre>
|
2338
2605
|
</div></div>
|
2339
2606
|
<div class="paragraph"><p>You want both of them to be pre-started during Apache startup. The URL for
|
2340
2607
|
foo.com is <em>http://foo.com/</em> (or, equivalently, <em>http://foo.com:80/</em>) and
|
2341
2608
|
the URL for bar.com is <em>http://bar.com:3500/</em>. So we add two PassengerPreStart
|
2342
2609
|
directives, like this:</p></div>
|
2343
2610
|
<div class="listingblock">
|
2344
|
-
<div class="content">
|
2345
|
-
<pre
|
2611
|
+
<div class="content monospaced">
|
2612
|
+
<pre><VirtualHost *:80>
|
2346
2613
|
ServerName foo.com
|
2347
2614
|
DocumentRoot /webapps/foo/public
|
2348
2615
|
</VirtualHost>
|
@@ -2353,37 +2620,37 @@ directives, like this:</p></div>
|
|
2353
2620
|
</VirtualHost>
|
2354
2621
|
|
2355
2622
|
PassengerPreStart http://foo.com/ # <--- added
|
2356
|
-
PassengerPreStart http://bar.com:3500/ # <--- added</
|
2623
|
+
PassengerPreStart http://bar.com:3500/ # <--- added</pre>
|
2357
2624
|
</div></div>
|
2358
2625
|
</div>
|
2359
2626
|
<div class="sect4">
|
2360
2627
|
<h5 id="_example_2_pre_starting_apps_that_are_deployed_in_sub_uris">Example 2: pre-starting apps that are deployed in sub-URIs</h5>
|
2361
2628
|
<div class="paragraph"><p>Suppose that you have a web application deployed in a sub-URI <em>/store</em>, like this:</p></div>
|
2362
2629
|
<div class="listingblock">
|
2363
|
-
<div class="content">
|
2364
|
-
<pre
|
2630
|
+
<div class="content monospaced">
|
2631
|
+
<pre><VirtualHost *:80>
|
2365
2632
|
ServerName myblog.com
|
2366
2633
|
DocumentRoot /webapps/wordpress
|
2367
2634
|
RailsBaseURI /store
|
2368
|
-
</VirtualHost></
|
2635
|
+
</VirtualHost></pre>
|
2369
2636
|
</div></div>
|
2370
2637
|
<div class="paragraph"><p>Then specify the domain name of its containing virtual host followed by the sub-URI,
|
2371
2638
|
like this:</p></div>
|
2372
2639
|
<div class="listingblock">
|
2373
|
-
<div class="content">
|
2374
|
-
<pre
|
2640
|
+
<div class="content monospaced">
|
2641
|
+
<pre><VirtualHost *:80>
|
2375
2642
|
ServerName myblog.com
|
2376
2643
|
DocumentRoot /webapps/wordpress
|
2377
2644
|
RailsBaseURI /store
|
2378
2645
|
</VirtualHost>
|
2379
2646
|
|
2380
|
-
PassengerPreStart http://myblog.com/store # <----- added</
|
2647
|
+
PassengerPreStart http://myblog.com/store # <----- added</pre>
|
2381
2648
|
</div></div>
|
2382
2649
|
<div class="paragraph"><p>The sub-URI <strong>must</strong> be included; if you don’t then the directive will have no effect.
|
2383
2650
|
The following example is wrong and won’t pre-start the store web application:</p></div>
|
2384
2651
|
<div class="listingblock">
|
2385
|
-
<div class="content">
|
2386
|
-
<pre
|
2652
|
+
<div class="content monospaced">
|
2653
|
+
<pre>PassengerPreStart http://myblog.com/ # <----- WRONG! Missing "/store" part.</pre>
|
2387
2654
|
</div></div>
|
2388
2655
|
</div>
|
2389
2656
|
<div class="sect4">
|
@@ -2396,8 +2663,8 @@ after a few minutes of inactivity. If you don’t want that to happen, then
|
|
2396
2663
|
you should combine PassengerPreStart with
|
2397
2664
|
<a href="#PassengerMinInstances">PassengerMinInstances</a>, like this:</p></div>
|
2398
2665
|
<div class="listingblock">
|
2399
|
-
<div class="content">
|
2400
|
-
<pre
|
2666
|
+
<div class="content monospaced">
|
2667
|
+
<pre><VirtualHost *:80>
|
2401
2668
|
ServerName foo.com
|
2402
2669
|
DocumentRoot /webapps/foo/public
|
2403
2670
|
PassengerMinInstances 1 # <--- added
|
@@ -2410,7 +2677,7 @@ you should combine PassengerPreStart with
|
|
2410
2677
|
</VirtualHost>
|
2411
2678
|
|
2412
2679
|
PassengerPreStart http://foo.com/
|
2413
|
-
PassengerPreStart http://bar.com:3500/</
|
2680
|
+
PassengerPreStart http://bar.com:3500/</pre>
|
2414
2681
|
</div></div>
|
2415
2682
|
</div>
|
2416
2683
|
<div class="sect4">
|
@@ -2458,18 +2725,18 @@ in example 1 resolves to 209.85.227.99; Phusion Passenger will
|
|
2458
2725
|
send the following HTTP request to 127.0.0.1 port 3500 (and not to 209.85.227.99
|
2459
2726
|
port 3500):</p></div>
|
2460
2727
|
<div class="listingblock">
|
2461
|
-
<div class="content">
|
2462
|
-
<pre
|
2728
|
+
<div class="content monospaced">
|
2729
|
+
<pre>HEAD / HTTP/1.1
|
2463
2730
|
Host: bar.com
|
2464
|
-
Connection: close</
|
2731
|
+
Connection: close</pre>
|
2465
2732
|
</div></div>
|
2466
2733
|
<div class="paragraph"><p>Similarly, for example 2, Phusion Passenger will send the following HTTP request
|
2467
2734
|
to 127.0.0.1 port 80:</p></div>
|
2468
2735
|
<div class="listingblock">
|
2469
|
-
<div class="content">
|
2470
|
-
<pre
|
2736
|
+
<div class="content monospaced">
|
2737
|
+
<pre>HEAD /store HTTP/1.1
|
2471
2738
|
Host: myblog.com
|
2472
|
-
Connection: close</
|
2739
|
+
Connection: close</pre>
|
2473
2740
|
</div></div>
|
2474
2741
|
</div>
|
2475
2742
|
<div class="sect4">
|
@@ -2517,7 +2784,7 @@ In a virtual host configuration block.
|
|
2517
2784
|
</li>
|
2518
2785
|
<li>
|
2519
2786
|
<p>
|
2520
|
-
In a <
|
2787
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2521
2788
|
</p>
|
2522
2789
|
</li>
|
2523
2790
|
<li>
|
@@ -2535,8 +2802,8 @@ sense to enable high performance mode.</p></div>
|
|
2535
2802
|
Apache modules, while some do not. In that case you can enable high performance
|
2536
2803
|
for only those applications that don’t use other Apache modules. For example:</p></div>
|
2537
2804
|
<div class="listingblock">
|
2538
|
-
<div class="content">
|
2539
|
-
<pre
|
2805
|
+
<div class="content monospaced">
|
2806
|
+
<pre><VirtualHost *:80>
|
2540
2807
|
ServerName www.foo.com
|
2541
2808
|
DocumentRoot /apps/foo/public
|
2542
2809
|
.... mod_rewrite rules or options for other Apache modules here ...
|
@@ -2546,7 +2813,7 @@ for only those applications that don’t use other Apache modules. For examp
|
|
2546
2813
|
ServerName www.bar.com
|
2547
2814
|
DocumentRoot /apps/bar/public
|
2548
2815
|
PassengerHighPerformance on
|
2549
|
-
</VirtualHost></
|
2816
|
+
</VirtualHost></pre>
|
2550
2817
|
</div></div>
|
2551
2818
|
<div class="paragraph"><p>In the above example, high performance mode is only enabled for www.bar.com.
|
2552
2819
|
It is disabled for everything else.</p></div>
|
@@ -2554,8 +2821,8 @@ It is disabled for everything else.</p></div>
|
|
2554
2821
|
but a certain URL that’s accessed often doesn’t depend on those other modules,
|
2555
2822
|
then you can enable high performance mode for a certain URL only. For example:</p></div>
|
2556
2823
|
<div class="listingblock">
|
2557
|
-
<div class="content">
|
2558
|
-
<pre
|
2824
|
+
<div class="content monospaced">
|
2825
|
+
<pre><VirtualHost *:80>
|
2559
2826
|
ServerName www.foo.com
|
2560
2827
|
DocumentRoot /apps/foo/public
|
2561
2828
|
.... mod_rewrite rules or options for other Apache modules here ...
|
@@ -2563,7 +2830,7 @@ then you can enable high performance mode for a certain URL only. For example:</
|
|
2563
2830
|
<Location /chatroom/ajax_update_poll>
|
2564
2831
|
PassengerHighPerformance on
|
2565
2832
|
</Location>
|
2566
|
-
</VirtualHost></
|
2833
|
+
</VirtualHost></pre>
|
2567
2834
|
</div></div>
|
2568
2835
|
<div class="paragraph"><p>This enables high performance mode for
|
2569
2836
|
<a href="http://www.foo.com/chatroom/ajax_update_poll">http://www.foo.com/chatroom/ajax_update_poll</a> only.</p></div>
|
@@ -2589,12 +2856,12 @@ In a virtual host configuration block.
|
|
2589
2856
|
</li>
|
2590
2857
|
<li>
|
2591
2858
|
<p>
|
2592
|
-
In a <
|
2859
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2593
2860
|
</p>
|
2594
2861
|
</li>
|
2595
2862
|
<li>
|
2596
2863
|
<p>
|
2597
|
-
In <em>.htaccess</em>, if <
|
2864
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span> is on.
|
2598
2865
|
</p>
|
2599
2866
|
</li>
|
2600
2867
|
</ul></div>
|
@@ -2603,7 +2870,7 @@ In <em>.htaccess</em>, if <tt>AllowOverride Options</tt> is on.
|
|
2603
2870
|
<div class="sect3">
|
2604
2871
|
<h4 id="_passengerallowencodedslashes_lt_on_off_gt">5.12.2. PassengerAllowEncodedSlashes <on|off></h4>
|
2605
2872
|
<div class="paragraph"><p>By default, Apache doesn’t support URLs with encoded slashes (%2f), e.g. URLs like
|
2606
|
-
this: <
|
2873
|
+
this: <span class="monospaced">/users/fujikura%2fyuu</span>. If you access such an URL then Apache will return a
|
2607
2874
|
404 Not Found error. This can be solved by turning on PassengerAllowEncodedSlashes
|
2608
2875
|
as well as Apache’s
|
2609
2876
|
<a href="http://httpd.apache.org/docs/2.0/mod/core.html#allowencodedslashes">AllowEncodedSlashes</a>.</p></div>
|
@@ -2623,12 +2890,12 @@ In a virtual host configuration block.
|
|
2623
2890
|
</li>
|
2624
2891
|
<li>
|
2625
2892
|
<p>
|
2626
|
-
In a <
|
2893
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2627
2894
|
</p>
|
2628
2895
|
</li>
|
2629
2896
|
<li>
|
2630
2897
|
<p>
|
2631
|
-
In <em>.htaccess</em>, if <
|
2898
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span> is on.
|
2632
2899
|
</p>
|
2633
2900
|
</li>
|
2634
2901
|
</ul></div>
|
@@ -2639,8 +2906,8 @@ can support either encoded slashes or mod_rewrite passthrough rules, but not bot
|
|
2639
2906
|
same time. Luckily this option can be specified anywhere, so you can enable it only for
|
2640
2907
|
virtual hosts or URLs that need it:</p></div>
|
2641
2908
|
<div class="listingblock">
|
2642
|
-
<div class="content">
|
2643
|
-
<pre
|
2909
|
+
<div class="content monospaced">
|
2910
|
+
<pre><VirtualHost *:80>
|
2644
2911
|
ServerName www.example.com
|
2645
2912
|
DocumentRoot /webapps/example/public
|
2646
2913
|
AllowEncodedSlashes on
|
@@ -2659,7 +2926,7 @@ virtual hosts or URLs that need it:</p></div>
|
|
2659
2926
|
# above /about mod_rewrite rule.
|
2660
2927
|
PassengerAllowEncodedSlashes on
|
2661
2928
|
</Location>
|
2662
|
-
</VirtualHost></
|
2929
|
+
</VirtualHost></pre>
|
2663
2930
|
</div></div>
|
2664
2931
|
<div class="paragraph"><p>With this, <a href="http://www.example.com/users/fujikura%2fyuu">http://www.example.com/users/fujikura%2fyuu</a> will work properly, and
|
2665
2932
|
accessing <a href="http://www.example.com/about">http://www.example.com/about</a> will properly display the result of
|
@@ -2721,12 +2988,12 @@ document root is a Ruby on Rails application. The default is <em>on</em>.</p></d
|
|
2721
2988
|
configuration block.</p></div>
|
2722
2989
|
<div class="paragraph"><p>For example, consider the following configuration:</p></div>
|
2723
2990
|
<div class="listingblock">
|
2724
|
-
<div class="content">
|
2725
|
-
<pre
|
2991
|
+
<div class="content monospaced">
|
2992
|
+
<pre>RailsAutoDetect off
|
2726
2993
|
<VirtualHost *:80>
|
2727
2994
|
ServerName www.mycook.com
|
2728
2995
|
DocumentRoot /webapps/mycook/public
|
2729
|
-
</VirtualHost></
|
2996
|
+
</VirtualHost></pre>
|
2730
2997
|
</div></div>
|
2731
2998
|
<div class="paragraph"><p>If one goes to <em>http://www.mycook.com/</em>, the visitor will see the contents of
|
2732
2999
|
the <em>/webapps/mycook/public</em> folder, instead of the output of the Ruby on Rails
|
@@ -2734,13 +3001,13 @@ application.</p></div>
|
|
2734
3001
|
<div class="paragraph"><p>It is possible to explicitly specify that the host is a Ruby on Rails
|
2735
3002
|
application by using the <a href="#RailsBaseURI">RailsBaseURI</a> configuration option:</p></div>
|
2736
3003
|
<div class="listingblock">
|
2737
|
-
<div class="content">
|
2738
|
-
<pre
|
3004
|
+
<div class="content monospaced">
|
3005
|
+
<pre>RailsAutoDetect off
|
2739
3006
|
<VirtualHost *:80>
|
2740
3007
|
ServerName www.mycook.com
|
2741
3008
|
DocumentRoot /webapps/mycook/public
|
2742
3009
|
RailsBaseURI / # This line has been added.
|
2743
|
-
</VirtualHost></
|
3010
|
+
</VirtualHost></pre>
|
2744
3011
|
</div></div>
|
2745
3012
|
</div>
|
2746
3013
|
<div class="sect3">
|
@@ -2763,19 +3030,19 @@ In a virtual host configuration block.
|
|
2763
3030
|
</li>
|
2764
3031
|
<li>
|
2765
3032
|
<p>
|
2766
|
-
In a <
|
3033
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2767
3034
|
</p>
|
2768
3035
|
</li>
|
2769
3036
|
<li>
|
2770
3037
|
<p>
|
2771
|
-
In <em>.htaccess</em>, if <
|
3038
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span> is on.
|
2772
3039
|
</p>
|
2773
3040
|
</li>
|
2774
3041
|
</ul></div>
|
2775
3042
|
</div>
|
2776
3043
|
<div class="sect3">
|
2777
3044
|
<h4 id="rails_env">5.14.3. RailsEnv <string></h4>
|
2778
|
-
<div class="paragraph"><p>This option allows one to specify the default <
|
3045
|
+
<div class="paragraph"><p>This option allows one to specify the default <span class="monospaced">RAILS_ENV</span> value.</p></div>
|
2779
3046
|
<div class="paragraph"><p>This option may occur in the following places:</p></div>
|
2780
3047
|
<div class="ulist"><ul>
|
2781
3048
|
<li>
|
@@ -2790,12 +3057,12 @@ In a virtual host configuration block.
|
|
2790
3057
|
</li>
|
2791
3058
|
<li>
|
2792
3059
|
<p>
|
2793
|
-
In a <
|
3060
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2794
3061
|
</p>
|
2795
3062
|
</li>
|
2796
3063
|
<li>
|
2797
3064
|
<p>
|
2798
|
-
In <em>.htaccess</em>, if <
|
3065
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span> is on.
|
2799
3066
|
</p>
|
2800
3067
|
</li>
|
2801
3068
|
</ul></div>
|
@@ -2870,12 +3137,12 @@ document root is a Rack application. The default is <em>on</em>.</p></div>
|
|
2870
3137
|
configuration block.</p></div>
|
2871
3138
|
<div class="paragraph"><p>For example, consider the following configuration:</p></div>
|
2872
3139
|
<div class="listingblock">
|
2873
|
-
<div class="content">
|
2874
|
-
<pre
|
3140
|
+
<div class="content monospaced">
|
3141
|
+
<pre>RackAutoDetect off
|
2875
3142
|
<VirtualHost *:80>
|
2876
3143
|
ServerName www.rackapp.com
|
2877
3144
|
DocumentRoot /webapps/my_rack_app/public
|
2878
|
-
</VirtualHost></
|
3145
|
+
</VirtualHost></pre>
|
2879
3146
|
</div></div>
|
2880
3147
|
<div class="paragraph"><p>If one goes to <em>http://www.rackapp.com/</em>, the visitor will see the contents of
|
2881
3148
|
the <em>/webapps/my_rack_app/public</em> folder, instead of the output of the Rack
|
@@ -2883,13 +3150,13 @@ application.</p></div>
|
|
2883
3150
|
<div class="paragraph"><p>It is possible to explicitly specify that the host is a Rack
|
2884
3151
|
application by using the <a href="#RackBaseURI">RackBaseURI</a> configuration option:</p></div>
|
2885
3152
|
<div class="listingblock">
|
2886
|
-
<div class="content">
|
2887
|
-
<pre
|
3153
|
+
<div class="content monospaced">
|
3154
|
+
<pre>RackAutoDetect off
|
2888
3155
|
<VirtualHost *:80>
|
2889
3156
|
ServerName www.rackapp.com
|
2890
3157
|
DocumentRoot /webapps/my_rack_app/public
|
2891
3158
|
RackBaseURI / # This line was added
|
2892
|
-
</VirtualHost></
|
3159
|
+
</VirtualHost></pre>
|
2893
3160
|
</div></div>
|
2894
3161
|
</div>
|
2895
3162
|
<div class="sect3">
|
@@ -2912,21 +3179,21 @@ In a virtual host configuration block.
|
|
2912
3179
|
</li>
|
2913
3180
|
<li>
|
2914
3181
|
<p>
|
2915
|
-
In a <
|
3182
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2916
3183
|
</p>
|
2917
3184
|
</li>
|
2918
3185
|
<li>
|
2919
3186
|
<p>
|
2920
|
-
In <em>.htaccess</em>, if <
|
3187
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span> is on.
|
2921
3188
|
</p>
|
2922
3189
|
</li>
|
2923
3190
|
</ul></div>
|
2924
3191
|
</div>
|
2925
3192
|
<div class="sect3">
|
2926
3193
|
<h4 id="rack_env">5.15.3. RackEnv <string></h4>
|
2927
|
-
<div class="paragraph"><p>The given value will be accessible in Rack applications in the <
|
3194
|
+
<div class="paragraph"><p>The given value will be accessible in Rack applications in the <span class="monospaced">RACK_ENV</span>
|
2928
3195
|
environment variable. This allows one to define the environment in which
|
2929
|
-
Rack applications are run, very similar to <
|
3196
|
+
Rack applications are run, very similar to <span class="monospaced">RAILS_ENV</span>.</p></div>
|
2930
3197
|
<div class="paragraph"><p>This option may occur in the following places:</p></div>
|
2931
3198
|
<div class="ulist"><ul>
|
2932
3199
|
<li>
|
@@ -2941,12 +3208,12 @@ In a virtual host configuration block.
|
|
2941
3208
|
</li>
|
2942
3209
|
<li>
|
2943
3210
|
<p>
|
2944
|
-
In a <
|
3211
|
+
In a <span class="monospaced"><Directory></span> or <span class="monospaced"><Location></span> block.
|
2945
3212
|
</p>
|
2946
3213
|
</li>
|
2947
3214
|
<li>
|
2948
3215
|
<p>
|
2949
|
-
In <em>.htaccess</em>, if <
|
3216
|
+
In <em>.htaccess</em>, if <span class="monospaced">AllowOverride Options</span> is on.
|
2950
3217
|
</p>
|
2951
3218
|
</li>
|
2952
3219
|
</ul></div>
|
@@ -2990,12 +3257,12 @@ compatibility reasons.</p></div>
|
|
2990
3257
|
<div class="sidebarblock">
|
2991
3258
|
<div class="content">
|
2992
3259
|
<div class="title">Symptoms</div>
|
2993
|
-
<div class="paragraph"><p>The installer finds Apache 2 development headers at <
|
3260
|
+
<div class="paragraph"><p>The installer finds Apache 2 development headers at <span class="monospaced">/Applications/MAMP/Library/bin/apxs</span>.
|
2994
3261
|
However, Apache cannot be found. The installer also outputs the following error:</p></div>
|
2995
3262
|
<div class="listingblock">
|
2996
|
-
<div class="content">
|
2997
|
-
<pre
|
2998
|
-
No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.</
|
3263
|
+
<div class="content monospaced">
|
3264
|
+
<pre>cannot open /Applications/MAMP/Library/build/config_vars.mk:
|
3265
|
+
No such file or directory at /Applications/MAMP/Library/bin/apxs line 218.</pre>
|
2999
3266
|
</div></div>
|
3000
3267
|
</div></div>
|
3001
3268
|
<div class="paragraph"><p>Your MAMP installation seems to be broken. In particular, <em>config_vars.mk</em> is missing.
|
@@ -3045,8 +3312,8 @@ Ubuntu/Debian
|
|
3045
3312
|
Please type:
|
3046
3313
|
</p>
|
3047
3314
|
<div class="listingblock">
|
3048
|
-
<div class="content">
|
3049
|
-
<pre
|
3315
|
+
<div class="content monospaced">
|
3316
|
+
<pre>sudo apt-get install ruby1.8-dev</pre>
|
3050
3317
|
</div></div>
|
3051
3318
|
</dd>
|
3052
3319
|
<dt class="hdlist1">
|
@@ -3057,8 +3324,8 @@ Fedora/CentOS/RHEL
|
|
3057
3324
|
Please type:
|
3058
3325
|
</p>
|
3059
3326
|
<div class="listingblock">
|
3060
|
-
<div class="content">
|
3061
|
-
<pre
|
3327
|
+
<div class="content monospaced">
|
3328
|
+
<pre>su -c 'yum install ruby-devel'</pre>
|
3062
3329
|
</div></div>
|
3063
3330
|
</dd>
|
3064
3331
|
<dt class="hdlist1">
|
@@ -3066,7 +3333,7 @@ FreeBSD
|
|
3066
3333
|
</dt>
|
3067
3334
|
<dd>
|
3068
3335
|
<p>
|
3069
|
-
Please install Ruby from <em>ports</em> or with <
|
3336
|
+
Please install Ruby from <em>ports</em> or with <span class="monospaced">pkg_add</span>. If that fails,
|
3070
3337
|
please install Ruby from source.
|
3071
3338
|
</p>
|
3072
3339
|
</dd>
|
@@ -3092,7 +3359,7 @@ Other operating systems
|
|
3092
3359
|
<div class="admonitionblock">
|
3093
3360
|
<table><tr>
|
3094
3361
|
<td class="icon">
|
3095
|
-
<img src="./images/icons/note.png" alt="Note"
|
3362
|
+
<img src="./images/icons/note.png" alt="Note">
|
3096
3363
|
</td>
|
3097
3364
|
<td class="content">If you’ve installed a new Ruby version (i.e. your system now contains
|
3098
3365
|
multiple Ruby installations), then you will need to tell Phusion Passenger
|
@@ -3131,8 +3398,8 @@ Ubuntu
|
|
3131
3398
|
Please type:
|
3132
3399
|
</p>
|
3133
3400
|
<div class="listingblock">
|
3134
|
-
<div class="content">
|
3135
|
-
<pre
|
3401
|
+
<div class="content monospaced">
|
3402
|
+
<pre>sudo apt-get install apache2-prefork-dev</pre>
|
3136
3403
|
</div></div>
|
3137
3404
|
</dd>
|
3138
3405
|
<dt class="hdlist1">
|
@@ -3143,8 +3410,8 @@ Debian
|
|
3143
3410
|
Please type:
|
3144
3411
|
</p>
|
3145
3412
|
<div class="listingblock">
|
3146
|
-
<div class="content">
|
3147
|
-
<pre
|
3413
|
+
<div class="content monospaced">
|
3414
|
+
<pre>sudo apt-get install apache2-dev</pre>
|
3148
3415
|
</div></div>
|
3149
3416
|
</dd>
|
3150
3417
|
<dt class="hdlist1">
|
@@ -3155,8 +3422,8 @@ Fedora/CentOS/RHEL
|
|
3155
3422
|
Please type:
|
3156
3423
|
</p>
|
3157
3424
|
<div class="listingblock">
|
3158
|
-
<div class="content">
|
3159
|
-
<pre
|
3425
|
+
<div class="content monospaced">
|
3426
|
+
<pre>su -c 'yum install httpd-devel'</pre>
|
3160
3427
|
</div></div>
|
3161
3428
|
</dd>
|
3162
3429
|
<dt class="hdlist1">
|
@@ -3164,7 +3431,7 @@ FreeBSD
|
|
3164
3431
|
</dt>
|
3165
3432
|
<dd>
|
3166
3433
|
<p>
|
3167
|
-
Please install Apache from <em>ports</em> or with <
|
3434
|
+
Please install Apache from <em>ports</em> or with <span class="monospaced">pkg_add</span>. If that fails,
|
3168
3435
|
please install Apache from source.
|
3169
3436
|
</p>
|
3170
3437
|
</dd>
|
@@ -3221,8 +3488,8 @@ Ubuntu
|
|
3221
3488
|
Please type:
|
3222
3489
|
</p>
|
3223
3490
|
<div class="listingblock">
|
3224
|
-
<div class="content">
|
3225
|
-
<pre
|
3491
|
+
<div class="content monospaced">
|
3492
|
+
<pre>sudo apt-get install libapr1-dev</pre>
|
3226
3493
|
</div></div>
|
3227
3494
|
</dd>
|
3228
3495
|
<dt class="hdlist1">
|
@@ -3233,8 +3500,8 @@ Debian
|
|
3233
3500
|
Please type:
|
3234
3501
|
</p>
|
3235
3502
|
<div class="listingblock">
|
3236
|
-
<div class="content">
|
3237
|
-
<pre
|
3503
|
+
<div class="content monospaced">
|
3504
|
+
<pre>sudo apt-get install libapr1-dev</pre>
|
3238
3505
|
</div></div>
|
3239
3506
|
</dd>
|
3240
3507
|
<dt class="hdlist1">
|
@@ -3245,8 +3512,8 @@ Fedora/CentOS/RHEL
|
|
3245
3512
|
Please type:
|
3246
3513
|
</p>
|
3247
3514
|
<div class="listingblock">
|
3248
|
-
<div class="content">
|
3249
|
-
<pre
|
3515
|
+
<div class="content monospaced">
|
3516
|
+
<pre>su -c 'yum install apr-devel'</pre>
|
3250
3517
|
</div></div>
|
3251
3518
|
</dd>
|
3252
3519
|
<dt class="hdlist1">
|
@@ -3284,7 +3551,7 @@ Other operating systems
|
|
3284
3551
|
<div class="admonitionblock">
|
3285
3552
|
<table><tr>
|
3286
3553
|
<td class="icon">
|
3287
|
-
<img src="./images/icons/tip.png" alt="Tip"
|
3554
|
+
<img src="./images/icons/tip.png" alt="Tip">
|
3288
3555
|
</td>
|
3289
3556
|
<td class="content">
|
3290
3557
|
<div class="title">The golden tip: read your Apache error logs!</div>
|
@@ -3311,7 +3578,7 @@ Apache installations on their system.</p></div>
|
|
3311
3578
|
<div class="paragraph"><p>To solve this problem, please <a href="#specifying_correct_apache_install">specify the correct Apache installation</a>, and <a href="#install_passenger">reinstall Phusion Passenger</a>.</p></div>
|
3312
3579
|
</div>
|
3313
3580
|
<div class="sect3">
|
3314
|
-
<h4 id="
|
3581
|
+
<h4 id="_i_get_a_403_forbidden_error">6.3.3. I get a "403 Forbidden" error</h4>
|
3315
3582
|
<div class="paragraph"><p>See next subsection.</p></div>
|
3316
3583
|
</div>
|
3317
3584
|
<div class="sect3">
|
@@ -3323,17 +3590,17 @@ assets correctly:</p></div>
|
|
3323
3590
|
<li>
|
3324
3591
|
<p>
|
3325
3592
|
Your Apache configuration is too strict, and does not allow HTTP clients to
|
3326
|
-
access static assets. This can be achieved with an <
|
3593
|
+
access static assets. This can be achieved with an <span class="monospaced">Allow from all</span> directive
|
3327
3594
|
in the correct place. For example:
|
3328
3595
|
</p>
|
3329
3596
|
<div class="listingblock">
|
3330
|
-
<div class="content">
|
3331
|
-
<pre
|
3597
|
+
<div class="content monospaced">
|
3598
|
+
<pre><Directory "/webapps/mycook/public">
|
3332
3599
|
Options FollowSymLinks
|
3333
3600
|
AllowOverride None
|
3334
3601
|
Order allow,deny
|
3335
3602
|
Allow from all
|
3336
|
-
</Directory></
|
3603
|
+
</Directory></pre>
|
3337
3604
|
</div></div>
|
3338
3605
|
<div class="paragraph"><p>See also <a href="http://groups.google.com/group/phusion-passenger/browse_thread/thread/9699a639a87f85f4/b9d71a03bf2670a5">this discussion</a>.</p></div>
|
3339
3606
|
</li>
|
@@ -3361,16 +3628,16 @@ If you’ve installed Phusion Passenger via a gem, then run this command to
|
|
3361
3628
|
Phusion Passenger’s root folder:
|
3362
3629
|
</p>
|
3363
3630
|
<div class="listingblock">
|
3364
|
-
<div class="content">
|
3365
|
-
<pre
|
3631
|
+
<div class="content monospaced">
|
3632
|
+
<pre>passenger-config --root</pre>
|
3366
3633
|
</div></div>
|
3367
3634
|
<div class="paragraph"><p>Next, run the following command:</p></div>
|
3368
3635
|
<div class="listingblock">
|
3369
|
-
<div class="content">
|
3370
|
-
<pre
|
3636
|
+
<div class="content monospaced">
|
3637
|
+
<pre>chcon -R -h -t httpd_sys_content_t /path-to-passenger-root</pre>
|
3371
3638
|
</div></div>
|
3372
3639
|
<div class="paragraph"><p>where <em>/path-to-passenger-root</em> should be replaced with whatever
|
3373
|
-
<
|
3640
|
+
<span class="monospaced">passenger-config --root</span> printed.</p></div>
|
3374
3641
|
</li>
|
3375
3642
|
<li>
|
3376
3643
|
<p>
|
@@ -3378,8 +3645,8 @@ If you’ve installed Phusion Passenger via the source tarball, then run the
|
|
3378
3645
|
command:
|
3379
3646
|
</p>
|
3380
3647
|
<div class="listingblock">
|
3381
|
-
<div class="content">
|
3382
|
-
<pre
|
3648
|
+
<div class="content monospaced">
|
3649
|
+
<pre>chcon -R -h -t httpd_sys_content_t /path/to/passenger/folder</pre>
|
3383
3650
|
</div></div>
|
3384
3651
|
</li>
|
3385
3652
|
</ul></div>
|
@@ -3421,22 +3688,22 @@ that SELinux is interfering</a>. RedHat’s SELinux policy only allows Apach
|
|
3421
3688
|
directories that have the <em>httpd_sys_content_t</em> security context. Please run the
|
3422
3689
|
following command to give your Rails application folder that context:</p></div>
|
3423
3690
|
<div class="listingblock">
|
3424
|
-
<div class="content">
|
3425
|
-
<pre
|
3691
|
+
<div class="content monospaced">
|
3692
|
+
<pre>chcon -R -h -t httpd_sys_content_t /path/to/your/rails/app</pre>
|
3426
3693
|
</div></div>
|
3427
3694
|
</div>
|
3428
3695
|
<div class="sect3">
|
3429
3696
|
<h4 id="_i_8217_ve_deployed_my_app_on_ssl_but_the_app_thinks_its_not_on_ssl">6.3.8. I’ve deployed my app on SSL, but the app thinks its not on SSL</h4>
|
3430
3697
|
<div class="paragraph"><p>Rails and many other frameworks infers whether it’s running on SSL through the CGI
|
3431
|
-
environment variable <
|
3698
|
+
environment variable <span class="monospaced">HTTPS</span>. Apache always sets this variable when on SSL,
|
3432
3699
|
except when SSL is incorrectly configured.</p></div>
|
3433
3700
|
<div class="paragraph"><p>Most Apache installations already configure SSL by default on port 443
|
3434
3701
|
(conf/extra/httpd-ssl.conf). Some people think they can save some typing in
|
3435
3702
|
subsequent SSL vhost blocks, and omit important options like <em>SSLEngine on</em>,
|
3436
3703
|
like this:</p></div>
|
3437
3704
|
<div class="listingblock">
|
3438
|
-
<div class="content">
|
3439
|
-
<pre
|
3705
|
+
<div class="content monospaced">
|
3706
|
+
<pre># httpd-ssl.conf contains something like:
|
3440
3707
|
# <VirtualHost _default_:443>
|
3441
3708
|
# SSLEngine on
|
3442
3709
|
# ...
|
@@ -3446,21 +3713,21 @@ Include conf/extra/httpd-ssl.conf
|
|
3446
3713
|
<VirtualHost *:443>
|
3447
3714
|
ServerName www.example.com
|
3448
3715
|
DocumentRoot /webapps/example/public
|
3449
|
-
</Virtualhost></
|
3716
|
+
</Virtualhost></pre>
|
3450
3717
|
</div></div>
|
3451
3718
|
<div class="paragraph"><p><strong>This is wrong!</strong> In each SSL vhost block you must re-specify all the SSL options.
|
3452
3719
|
Otherwise Apache won’t properly detect the vhost as an SSL vhost block. Here’s
|
3453
3720
|
the corrected example:</p></div>
|
3454
3721
|
<div class="listingblock">
|
3455
|
-
<div class="content">
|
3456
|
-
<pre
|
3722
|
+
<div class="content monospaced">
|
3723
|
+
<pre>Include conf/extra/httpd-ssl.conf
|
3457
3724
|
|
3458
3725
|
<VirtualHost *:443>
|
3459
3726
|
ServerName www.example.com
|
3460
3727
|
DocumentRoot /webapps/example/public
|
3461
3728
|
SSLEngine on
|
3462
3729
|
...more SSL options here...
|
3463
|
-
</Virtualhost></
|
3730
|
+
</Virtualhost></pre>
|
3464
3731
|
</div></div>
|
3465
3732
|
</div>
|
3466
3733
|
</div>
|
@@ -3489,17 +3756,17 @@ for all Phusion Passenger hosts.</p></div>
|
|
3489
3756
|
maintenance and troubleshooting.</p></div>
|
3490
3757
|
<div class="sect2">
|
3491
3758
|
<h3 id="_inspecting_memory_usage">7.1. Inspecting memory usage</h3>
|
3492
|
-
<div class="paragraph"><p>Process inspection tools such as <
|
3759
|
+
<div class="paragraph"><p>Process inspection tools such as <span class="monospaced">ps</span> and <span class="monospaced">top</span> are useful, but they
|
3493
3760
|
<a href="http://groups.google.com/group/phusion-passenger/msg/1fd1c233456d3180">rarely show the correct memory usage</a>.
|
3494
|
-
The real memory usage is usually lower than what <
|
3761
|
+
The real memory usage is usually lower than what <span class="monospaced">ps</span> and <span class="monospaced">top</span> report.</p></div>
|
3495
3762
|
<div class="paragraph"><p>There are many technical reasons why this is so, but an explanation is beyond
|
3496
3763
|
the scope of this Users Guide. We kindly refer the interested reader to
|
3497
3764
|
operating systems literature about <em>virtual memory</em> and <em>copy-on-write</em>.</p></div>
|
3498
|
-
<div class="paragraph"><p>The tool <
|
3765
|
+
<div class="paragraph"><p>The tool <span class="monospaced">passenger-memory-stats</span> allows one to easily analyze Phusion Passenger’s
|
3499
3766
|
and Apache’s real memory usage. For example:</p></div>
|
3500
3767
|
<div class="listingblock">
|
3501
|
-
<div class="content">
|
3502
|
-
<pre
|
3768
|
+
<div class="content monospaced">
|
3769
|
+
<pre>[bash@localhost root]# passenger-memory-stats
|
3503
3770
|
------------- Apache processes --------------.
|
3504
3771
|
PID PPID Threads VMSize Private Name
|
3505
3772
|
---------------------------------------------.
|
@@ -3522,7 +3789,7 @@ PID Threads VMSize Private Name
|
|
3522
3789
|
23791 1 26.8 MB 2.9 MB Passenger ApplicationSpawner: /var/www/projects/app1-foobar
|
3523
3790
|
23793 1 26.9 MB 17.1 MB Rails: /var/www/projects/app1-foobar
|
3524
3791
|
### Processes: 4
|
3525
|
-
### Total private dirty RSS: 27.76 M</
|
3792
|
+
### Total private dirty RSS: 27.76 M</pre>
|
3526
3793
|
</div></div>
|
3527
3794
|
<div class="paragraph"><p>The <em>Private</em> or <em>private dirty RSS</em> field shows the <strong>real</strong> memory usage of processes. Here,
|
3528
3795
|
we see that all the Apache worker processes only take less than 1 MB memory each.
|
@@ -3531,7 +3798,7 @@ This is a lot less than the 50 MB-ish memory usage as shown in the <em>VMSize</e
|
|
3531
3798
|
<div class="admonitionblock">
|
3532
3799
|
<table><tr>
|
3533
3800
|
<td class="icon">
|
3534
|
-
<img src="./images/icons/note.png" alt="Note"
|
3801
|
+
<img src="./images/icons/note.png" alt="Note">
|
3535
3802
|
</td>
|
3536
3803
|
<td class="content">Private dirty RSS reporting only works on Linux. Unfortunately other operating systems
|
3537
3804
|
don’t provide facilities for determining processes' private dirty RSS. On non-Linux systems,
|
@@ -3541,11 +3808,11 @@ the Resident Set Size is reported instead.</td>
|
|
3541
3808
|
</div>
|
3542
3809
|
<div class="sect2">
|
3543
3810
|
<h3 id="_inspecting_phusion_passenger_8217_s_internal_status">7.2. Inspecting Phusion Passenger’s internal status</h3>
|
3544
|
-
<div class="paragraph"><p>One can inspect Phusion Passenger’s internal status with the tool <
|
3811
|
+
<div class="paragraph"><p>One can inspect Phusion Passenger’s internal status with the tool <span class="monospaced">passenger-status</span>.
|
3545
3812
|
This tool must typically be run as root. For example:</p></div>
|
3546
3813
|
<div class="listingblock">
|
3547
|
-
<div class="content">
|
3548
|
-
<pre
|
3814
|
+
<div class="content monospaced">
|
3815
|
+
<pre>[bash@localhost root]# passenger-status
|
3549
3816
|
----------- General information -----------
|
3550
3817
|
max = 6
|
3551
3818
|
count = 1
|
@@ -3554,7 +3821,7 @@ inactive = 1
|
|
3554
3821
|
|
3555
3822
|
----------- Domains -----------
|
3556
3823
|
/var/www/projects/app1-foobar:
|
3557
|
-
PID: 9617 Sessions: 0 Processed: 7 Uptime: 2m 23s</
|
3824
|
+
PID: 9617 Sessions: 0 Processed: 7 Uptime: 2m 23s</pre>
|
3558
3825
|
</div></div>
|
3559
3826
|
<div class="paragraph"><p>The <em>general information</em> section shows the following information:</p></div>
|
3560
3827
|
<div class="dlist"><dl>
|
@@ -3595,7 +3862,7 @@ The number of application instances that are currently <strong>not</strong> proc
|
|
3595
3862
|
requests, i.e. are idle. Idle application instances will be shutdown after a while,
|
3596
3863
|
as can be specified with <a href="#PassengerPoolIdleTime">PassengerPoolIdleTime (Apache)</a>/<a href="#PassengerPoolIdleTime">passenger_pool_idle_time (Nginx)</a> (unless this
|
3597
3864
|
value is set to 0, in which case application instances are never shut down via idle
|
3598
|
-
time). The value of <em>inactive</em> equals <
|
3865
|
+
time). The value of <em>inactive</em> equals <span class="monospaced">count - active</span>.
|
3599
3866
|
</p>
|
3600
3867
|
</dd>
|
3601
3868
|
</dl></div>
|
@@ -3634,22 +3901,22 @@ Shows for how long the application instance has been running.
|
|
3634
3901
|
application instances should be fairly close to each other. For example, this is fairly
|
3635
3902
|
normal:</p></div>
|
3636
3903
|
<div class="listingblock">
|
3637
|
-
<div class="content">
|
3638
|
-
<pre
|
3904
|
+
<div class="content monospaced">
|
3905
|
+
<pre> PID: 4281 Sessions: 2 Processed: 7 Uptime: 5m 11s
|
3639
3906
|
PID: 4268 Sessions: 0 Processed: 5 Uptime: 4m 52s
|
3640
3907
|
PID: 4265 Sessions: 1 Processed: 6 Uptime: 5m 38s
|
3641
|
-
PID: 4275 Sessions: 1 Processed: 7 Uptime: 3m 14s</
|
3908
|
+
PID: 4275 Sessions: 1 Processed: 7 Uptime: 3m 14s</pre>
|
3642
3909
|
</div></div>
|
3643
3910
|
<div class="paragraph"><p>But if you see a "spike", i.e. an application instance has an unusually high number of
|
3644
3911
|
sessions compared to the others, then there might be a problem:</p></div>
|
3645
3912
|
<div class="listingblock">
|
3646
|
-
<div class="content">
|
3647
|
-
<pre
|
3913
|
+
<div class="content monospaced">
|
3914
|
+
<pre> PID: 4281 Sessions: 2 Processed: 7 Uptime: 5m 11s
|
3648
3915
|
PID: 17468 Sessions: 8 <-+ Processed: 2 Uptime: 4m 47s
|
3649
3916
|
PID: 4265 Sessions: 1 | Processed: 6 Uptime: 5m 38s
|
3650
3917
|
PID: 4275 Sessions: 1 | Processed: 7 Uptime: 3m 14s
|
3651
3918
|
|
|
3652
|
-
+---- "spike"</
|
3919
|
+
+---- "spike"</pre>
|
3653
3920
|
</div></div>
|
3654
3921
|
<div class="paragraph"><p>Possible reasons why spikes can occur:</p></div>
|
3655
3922
|
<div class="olist arabic"><ol class="arabic">
|
@@ -3683,7 +3950,7 @@ the Apache error log.</p></div>
|
|
3683
3950
|
<div class="admonitionblock">
|
3684
3951
|
<table><tr>
|
3685
3952
|
<td class="icon">
|
3686
|
-
<img src="./images/icons/note.png" alt="Note"
|
3953
|
+
<img src="./images/icons/note.png" alt="Note">
|
3687
3954
|
</td>
|
3688
3955
|
<td class="content">It is safe to kill application instances, even in live environments. Phusion Passenger
|
3689
3956
|
will restart killed application instances, as if nothing bad happened.</td>
|
@@ -3718,15 +3985,15 @@ Other debugging use cases.
|
|
3718
3985
|
</ul></div>
|
3719
3986
|
<div class="paragraph"><p>All individual application processes are accessible via HTTP, so you can use standard
|
3720
3987
|
HTTP tools like <em>curl</em>. The exact addresses can be obtained with the command
|
3721
|
-
<
|
3988
|
+
<span class="monospaced">passenger-status --verbose</span>. These sockets are all bound to 127.0.0.1, but the port
|
3722
3989
|
number is dynamically assigned. As a security measure, the sockets are also protected
|
3723
3990
|
with a process-specific random password, which you can see in the
|
3724
|
-
<
|
3991
|
+
<span class="monospaced">passenger-status --verbose</span> output. This password must be sent through the
|
3725
3992
|
“X-Passenger-Connect-Password” HTTP header.</p></div>
|
3726
3993
|
<div class="paragraph"><p>Example:</p></div>
|
3727
3994
|
<div class="listingblock">
|
3728
|
-
<div class="content">
|
3729
|
-
<pre
|
3995
|
+
<div class="content monospaced">
|
3996
|
+
<pre>bash# passenger-status --verbose
|
3730
3997
|
----------- General information -----------
|
3731
3998
|
max = 6
|
3732
3999
|
count = 2
|
@@ -3742,7 +4009,7 @@ Waiting on global queue: 0
|
|
3742
4009
|
Password: nFfVOX1F8LjZ90HJh28Sd_htJOsgRsNne2QXKf8NIXw
|
3743
4010
|
* PID: 24250 Sessions: 0 Processed: 4 Uptime: 1s
|
3744
4011
|
URL : http://127.0.0.1:57933
|
3745
|
-
Password: _RGXlQ9EGDGJKLevQ_qflUtF1KmxEo2UiRzMwIE1sBY</
|
4012
|
+
Password: _RGXlQ9EGDGJKLevQ_qflUtF1KmxEo2UiRzMwIE1sBY</pre>
|
3746
4013
|
</div></div>
|
3747
4014
|
<div class="paragraph"><p>Here we see that the web application <em>rack.test</em> has two processes.
|
3748
4015
|
Process 24235 is accessible via <a href="http://127.0.0.1:58122">http://127.0.0.1:58122</a>, and
|
@@ -3750,8 +4017,8 @@ process 24250 is accessible via <a href="http://127.0.0.1:57933">http://127.0.0.
|
|
3750
4017
|
<div class="paragraph"><p>To access 24235 we must send its password, <em>nFfVOX1F8LjZ90HJh28Sd_htJOsgRsNne2QXKf8NIXw</em>,
|
3751
4018
|
through the <em>X-Passenger-Connect-Password</em> HTTP header, like this:</p></div>
|
3752
4019
|
<div class="listingblock">
|
3753
|
-
<div class="content">
|
3754
|
-
<pre
|
4020
|
+
<div class="content monospaced">
|
4021
|
+
<pre>bash# curl -H "X-Passenger-Connect-Password: nFfVOX1F8LjZ90HJh28Sd_htJOsgRsNne2QXKf8NIXw" http://127.0.0.1:58122/</pre>
|
3755
4022
|
</div></div>
|
3756
4023
|
</div>
|
3757
4024
|
</div>
|
@@ -3812,8 +4079,8 @@ Please visit the website for details.</p></div>
|
|
3812
4079
|
The following Capistrano recipe demonstrates Phusion Passenger support.
|
3813
4080
|
It assumes that you’re using Git as version control system.</p></div>
|
3814
4081
|
<div class="listingblock">
|
3815
|
-
<div class="content">
|
3816
|
-
<pre
|
4082
|
+
<div class="content monospaced">
|
4083
|
+
<pre>set :application, "myapp"
|
3817
4084
|
set :domain, "example.com"
|
3818
4085
|
set :repository, "ssh://#{domain}/path-to-your-git-repo/#{application}.git"
|
3819
4086
|
set :use_sudo, false
|
@@ -3837,7 +4104,7 @@ namespace :deploy do
|
|
3837
4104
|
task :restart, :roles => :app do
|
3838
4105
|
run "touch #{current_release}/tmp/restart.txt"
|
3839
4106
|
end
|
3840
|
-
end</
|
4107
|
+
end</pre>
|
3841
4108
|
</div></div>
|
3842
4109
|
</div>
|
3843
4110
|
<div class="sect2">
|
@@ -3854,15 +4121,15 @@ If you have a <em>.bundle/environment.rb</em> in your application root, then Phu
|
|
3854
4121
|
<li>
|
3855
4122
|
<p>
|
3856
4123
|
Otherwise, if you have a <em>Gemfile</em>, then Phusion Passenger will automatically call
|
3857
|
-
<
|
4124
|
+
<span class="monospaced">Bundler.setup()</span> before loading your application.
|
3858
4125
|
</p>
|
3859
4126
|
</li>
|
3860
4127
|
</ul></div>
|
3861
|
-
<div class="paragraph"><p>It’s possible that your application also calls <
|
4128
|
+
<div class="paragraph"><p>It’s possible that your application also calls <span class="monospaced">Bundler.setup</span> during loading, e.g. in
|
3862
4129
|
<em>config.ru</em> or in <em>config/boot.rb</em>. This is the case with Rails 3, and is also the case if you
|
3863
4130
|
modified your <em>config/boot.rb</em> according to the
|
3864
4131
|
<a href="http://gembundler.com/rails23.html">Bundler Rails 2.3 instructions</a>.
|
3865
|
-
This leads to <
|
4132
|
+
This leads to <span class="monospaced">Bundler.setup</span> being called twice, once before the application startup file
|
3866
4133
|
is required and once during application startup. However this is harmless and doesn’t
|
3867
4134
|
have any negative effects.</p></div>
|
3868
4135
|
<div class="paragraph"><p>Phusion Passenger assumes that you’re using Bundler >= 0.9.5. If you don’t want Phusion
|
@@ -3897,8 +4164,8 @@ move it to <em>/usr/local/passenger/</em>, then do this:</p></div>
|
|
3897
4164
|
Run the following command:
|
3898
4165
|
</p>
|
3899
4166
|
<div class="listingblock">
|
3900
|
-
<div class="content">
|
3901
|
-
<pre
|
4167
|
+
<div class="content monospaced">
|
4168
|
+
<pre>mv /opt/passenger /usr/local/passenger</pre>
|
3902
4169
|
</div></div>
|
3903
4170
|
</li>
|
3904
4171
|
<li>
|
@@ -3906,8 +4173,8 @@ Run the following command:
|
|
3906
4173
|
Edit your Apache configuration file, and set:
|
3907
4174
|
</p>
|
3908
4175
|
<div class="listingblock">
|
3909
|
-
<div class="content">
|
3910
|
-
<pre
|
4176
|
+
<div class="content monospaced">
|
4177
|
+
<pre>PassengerRoot /usr/local/passenger</pre>
|
3911
4178
|
</div></div>
|
3912
4179
|
</li>
|
3913
4180
|
</ol></div>
|
@@ -3918,8 +4185,8 @@ Edit your Apache configuration file, and set:
|
|
3918
4185
|
specific Ruby on Rails version. You can install a specific version with
|
3919
4186
|
this command:</p></div>
|
3920
4187
|
<div class="listingblock">
|
3921
|
-
<div class="content">
|
3922
|
-
<pre
|
4188
|
+
<div class="content monospaced">
|
4189
|
+
<pre>gem install rails -v X.X.X</pre>
|
3923
4190
|
</div></div>
|
3924
4191
|
<div class="paragraph"><p>where <em>X.X.X</em> is the version number of Ruby on Rails.</p></div>
|
3925
4192
|
<div class="paragraph"><p>All of these versions will exist in parallel, and will not conflict with each
|
@@ -3937,7 +4204,7 @@ application, as long as <em>always_restart.txt</em> exists.</p></div>
|
|
3937
4204
|
<div class="admonitionblock">
|
3938
4205
|
<table><tr>
|
3939
4206
|
<td class="icon">
|
3940
|
-
<img src="./images/icons/note.png" alt="Note"
|
4207
|
+
<img src="./images/icons/note.png" alt="Note">
|
3941
4208
|
</td>
|
3942
4209
|
<td class="content">If you’re just developing a Rails application then you probably don’t need
|
3943
4210
|
this feature. If you set <em>RailsEnv development</em> in your Apache configuration,
|
@@ -3971,14 +4238,14 @@ So relative URIs usually don’t work well with layout templates.</p></div>
|
|
3971
4238
|
<div class="paragraph"><p>The second and highly recommended way is to always use Rails helper methods to
|
3972
4239
|
output tags for static assets. These helper methods automatically take care
|
3973
4240
|
of prepending the base URI that you’ve deployed the application to. For images
|
3974
|
-
there is <
|
3975
|
-
CSS there is <
|
4241
|
+
there is <span class="monospaced">image_tag</span>, for JavaScript there is <span class="monospaced">javascript_include_tag</span> and for
|
4242
|
+
CSS there is <span class="monospaced">stylesheet_link_tag</span>. In the above example you would simply remove
|
3976
4243
|
the <em><img></em> HTML tag and replace it with inline Ruby like this:</p></div>
|
3977
4244
|
<div class="listingblock">
|
3978
|
-
<div class="content">
|
3979
|
-
<pre
|
4245
|
+
<div class="content monospaced">
|
4246
|
+
<pre><%= image_tag("foo.jpg") %></pre>
|
3980
4247
|
</div></div>
|
3981
|
-
<div class="paragraph"><p>This will generate the proper image tag to <
|
4248
|
+
<div class="paragraph"><p>This will generate the proper image tag to <span class="monospaced">$RAILS_ROOT/public/images/foo.jpg</span>
|
3982
4249
|
so that your images will always work no matter what sub-URI you’ve deployed to.</p></div>
|
3983
4250
|
<div class="paragraph"><p>These helper methods are more valuable than you may think. For example they also
|
3984
4251
|
append a timestamp to the URI to better facilitate HTTP caching. For more information,
|
@@ -4013,12 +4280,12 @@ directly, without hitting the web application.</p></div>
|
|
4013
4280
|
who are switching from an old Mongrel-based setup might have mod_rewrite rules such
|
4014
4281
|
as these:</p></div>
|
4015
4282
|
<div class="listingblock">
|
4016
|
-
<div class="content">
|
4017
|
-
<pre
|
4283
|
+
<div class="content monospaced">
|
4284
|
+
<pre># Check whether this request has a corresponding file; if that
|
4018
4285
|
# exists, let Apache serve it, otherwise forward the request to
|
4019
4286
|
# Mongrel.
|
4020
4287
|
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
|
4021
|
-
RewriteRule ^(.*)$ balancer://mongrel%{REQUEST_URI} [P,QSA,L]</
|
4288
|
+
RewriteRule ^(.*)$ balancer://mongrel%{REQUEST_URI} [P,QSA,L]</pre>
|
4022
4289
|
</div></div>
|
4023
4290
|
<div class="paragraph"><p>These kind of mod_rewrite rules are no longer required, and you can safely remove
|
4024
4291
|
them.</p></div>
|
@@ -4067,8 +4334,8 @@ able to serve, and how it knows what kind of web application it is (e.g. Rails o
|
|
4067
4334
|
<div class="paragraph"><p>Phusion Passenger checks whether the virtual host is a Rails application by checking
|
4068
4335
|
whether the following file exists:</p></div>
|
4069
4336
|
<div class="listingblock">
|
4070
|
-
<div class="content">
|
4071
|
-
<pre
|
4337
|
+
<div class="content monospaced">
|
4338
|
+
<pre>dirname(DocumentRoot) + "/config/environment.rb"</pre>
|
4072
4339
|
</div></div>
|
4073
4340
|
<div class="paragraph"><p>If you’re not a programmer and don’t understand the above pseudo-code snippet, it means
|
4074
4341
|
that Phusion Passenger will:</p></div>
|
@@ -4115,13 +4382,13 @@ Phusion Passenger will look for <em>config.ru</em> instead of <em>config/environ
|
|
4115
4382
|
Attribution-Share Alike 3.0 Unported License</a>.</p></div>
|
4116
4383
|
<div class="paragraph"><p><span class="image">
|
4117
4384
|
<a class="image" href="http://creativecommons.org/licenses/by-sa/3.0/">
|
4118
|
-
<img src="images/by_sa.png" alt="images/by_sa.png"
|
4385
|
+
<img src="images/by_sa.png" alt="images/by_sa.png">
|
4119
4386
|
</a>
|
4120
4387
|
</span></p></div>
|
4121
4388
|
<div class="paragraph"><p>Phusion Passenger is brought to you by <a href="http://www.phusion.nl/">Phusion</a>.</p></div>
|
4122
4389
|
<div class="paragraph"><p><span class="image">
|
4123
4390
|
<a class="image" href="http://www.phusion.nl/">
|
4124
|
-
<img src="images/phusion_banner.png" alt="images/phusion_banner.png"
|
4391
|
+
<img src="images/phusion_banner.png" alt="images/phusion_banner.png">
|
4125
4392
|
</a>
|
4126
4393
|
</span></p></div>
|
4127
4394
|
<div class="paragraph"><p>Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.</p></div>
|
@@ -4135,10 +4402,10 @@ Attribution-Share Alike 3.0 Unported License</a>.</p></div>
|
|
4135
4402
|
<div class="paragraph"><p>The root directory of an application that’s served by Phusion Passenger.</p></div>
|
4136
4403
|
<div class="paragraph"><p>In case of Ruby on Rails applications, this is the directory that contains
|
4137
4404
|
<em>Rakefile</em>, <em>app/</em>, <em>config/</em>, <em>public/</em>, etc. In other words, the directory
|
4138
|
-
pointed to by <
|
4405
|
+
pointed to by <span class="monospaced">RAILS_ROOT</span>. For example, take the following directory structure:</p></div>
|
4139
4406
|
<div class="listingblock">
|
4140
|
-
<div class="content">
|
4141
|
-
<pre
|
4407
|
+
<div class="content monospaced">
|
4408
|
+
<pre>/apps/foo/ <------ This is the Rails application's application root!
|
4142
4409
|
|
|
4143
4410
|
+- app/
|
4144
4411
|
| |
|
@@ -4158,13 +4425,13 @@ pointed to by <tt>RAILS_ROOT</tt>. For example, take the following directory str
|
|
4158
4425
|
| |
|
4159
4426
|
| +- ...
|
4160
4427
|
|
|
4161
|
-
+- ...</
|
4428
|
+
+- ...</pre>
|
4162
4429
|
</div></div>
|
4163
4430
|
<div class="paragraph"><p>In case of Rack applications, this is the directory that contains <em>config.ru</em>.
|
4164
4431
|
For example, take the following directory structure:</p></div>
|
4165
4432
|
<div class="listingblock">
|
4166
|
-
<div class="content">
|
4167
|
-
<pre
|
4433
|
+
<div class="content monospaced">
|
4434
|
+
<pre>/apps/bar/ <----- This is the Rack application's application root!
|
4168
4435
|
|
|
4169
4436
|
+- public/
|
4170
4437
|
| |
|
@@ -4172,13 +4439,13 @@ For example, take the following directory structure:</p></div>
|
|
4172
4439
|
|
|
4173
4440
|
+- config.ru
|
4174
4441
|
|
|
4175
|
-
+- ...</
|
4442
|
+
+- ...</pre>
|
4176
4443
|
</div></div>
|
4177
4444
|
<div class="paragraph"><p>In case of Python (WSGI) applications, this is the directory that contains
|
4178
4445
|
<em>passenger_wsgi.py</em>. For example, take the following directory structure:</p></div>
|
4179
4446
|
<div class="listingblock">
|
4180
|
-
<div class="content">
|
4181
|
-
<pre
|
4447
|
+
<div class="content monospaced">
|
4448
|
+
<pre>/apps/baz/ <----- This is the WSGI application's application root!
|
4182
4449
|
|
|
4183
4450
|
+- public/
|
4184
4451
|
| |
|
@@ -4186,7 +4453,7 @@ For example, take the following directory structure:</p></div>
|
|
4186
4453
|
|
|
4187
4454
|
+- passenger_wsgi.py
|
4188
4455
|
|
|
4189
|
-
+- ...</
|
4456
|
+
+- ...</pre>
|
4190
4457
|
</div></div>
|
4191
4458
|
</div>
|
4192
4459
|
</div>
|
@@ -4223,7 +4490,7 @@ programmers jargon, Phusion Passenger calls fork(), but not exec().</p></div>
|
|
4223
4490
|
<div class="admonitionblock">
|
4224
4491
|
<table><tr>
|
4225
4492
|
<td class="icon">
|
4226
|
-
<img src="./images/icons/note.png" alt="Note"
|
4493
|
+
<img src="./images/icons/note.png" alt="Note">
|
4227
4494
|
</td>
|
4228
4495
|
<td class="content">Smart spawning is supported for all Ruby applications but not for WSGI applications.</td>
|
4229
4496
|
</tr></table>
|
@@ -4232,8 +4499,8 @@ programmers jargon, Phusion Passenger calls fork(), but not exec().</p></div>
|
|
4232
4499
|
because each worker process has its own private copy of the Rails application
|
4233
4500
|
as well as the Rails framework. This wastes memory as well as startup time.</p></div>
|
4234
4501
|
<div class="paragraph"><p><span class="image">
|
4235
|
-
<img src="images/conservative_spawning.png" alt="Worker processes and conservative spawning"
|
4236
|
-
</span><br
|
4502
|
+
<img src="images/conservative_spawning.png" alt="Worker processes and conservative spawning">
|
4503
|
+
</span><br>
|
4237
4504
|
<em>Figure: Worker processes and conservative spawning. Each worker process has its
|
4238
4505
|
own private copy of the application code and Rails framework code.</em></p></div>
|
4239
4506
|
<div class="paragraph"><p>It is possible to make the different worker processes share the memory occupied
|
@@ -4258,8 +4525,8 @@ processes will share as much common
|
|
4258
4525
|
memory as possible. That is, they will all share the same application and Rails
|
4259
4526
|
framework code.</p></div>
|
4260
4527
|
<div class="paragraph"><p><span class="image">
|
4261
|
-
<img src="images/smart-lv2.png" alt="images/smart-lv2.png"
|
4262
|
-
</span><br
|
4528
|
+
<img src="images/smart-lv2.png" alt="images/smart-lv2.png">
|
4529
|
+
</span><br>
|
4263
4530
|
<em>Figure: Worker processes and the smart-lv2 spawn method. All worker processes,
|
4264
4531
|
as well as the ApplicationSpawner, share the same application code and Rails
|
4265
4532
|
framework code.</em></p></div>
|
@@ -4343,7 +4610,7 @@ may potentially cause problems.</p></div>
|
|
4343
4610
|
<div class="paragraph"><p>The problem commonly involves socket connections that are unintentially being
|
4344
4611
|
shared. You can fix it by closing and reestablishing the connection when Phusion
|
4345
4612
|
Passenger is creating a new worker process. Phusion Passenger provides the API
|
4346
|
-
call <
|
4613
|
+
call <span class="monospaced">PhusionPassenger.on_event(:starting_worker_process)</span> to do so. So you
|
4347
4614
|
could insert the following code in your <em>environment.rb</em>:</p></div>
|
4348
4615
|
<div class="listingblock">
|
4349
4616
|
<div class="content"><!-- Generator: GNU source-highlight 2.11.1
|
@@ -4369,22 +4636,22 @@ encounter any database issues when using smart spawning mode.</p></div>
|
|
4369
4636
|
<em>environment.rb</em>. This causes the ApplicationSpawner to have a socket connection
|
4370
4637
|
(file descriptor) to the Memcached server, as shown in the following figure:</p></div>
|
4371
4638
|
<div class="literalblock">
|
4372
|
-
<div class="content">
|
4373
|
-
<pre
|
4639
|
+
<div class="content monospaced">
|
4640
|
+
<pre>+--------------------+
|
4374
4641
|
| ApplicationSpawner |-----------[Memcached server]
|
4375
|
-
+--------------------+</
|
4642
|
+
+--------------------+</pre>
|
4376
4643
|
</div></div>
|
4377
4644
|
<div class="paragraph"><p>Phusion Passenger then proceeds with creating a new Rails worker process, which
|
4378
4645
|
is to process incoming HTTP requests. The result will look like this:</p></div>
|
4379
4646
|
<div class="literalblock">
|
4380
|
-
<div class="content">
|
4381
|
-
<pre
|
4647
|
+
<div class="content monospaced">
|
4648
|
+
<pre>+--------------------+
|
4382
4649
|
| ApplicationSpawner |------+----[Memcached server]
|
4383
4650
|
+--------------------+ |
|
4384
4651
|
|
|
4385
4652
|
+--------------------+ |
|
4386
4653
|
| Worker process 1 |-----/
|
4387
|
-
+--------------------+</
|
4654
|
+
+--------------------+</pre>
|
4388
4655
|
</div></div>
|
4389
4656
|
<div class="paragraph"><p>Since a <em>fork()</em> makes a (virtual) complete copy of a process, all its file
|
4390
4657
|
descriptors will be copied as well. What we see here is that ApplicationSpawner
|
@@ -4393,8 +4660,8 @@ and Worker process 1 both share the same connection to Memcached.</p></div>
|
|
4393
4660
|
spawn another worker process. It does so by forking ApplicationSpawner. The
|
4394
4661
|
result is now as follows:</p></div>
|
4395
4662
|
<div class="literalblock">
|
4396
|
-
<div class="content">
|
4397
|
-
<pre
|
4663
|
+
<div class="content monospaced">
|
4664
|
+
<pre>+--------------------+
|
4398
4665
|
| ApplicationSpawner |------+----[Memcached server]
|
4399
4666
|
+--------------------+ |
|
4400
4667
|
|
|
@@ -4404,7 +4671,7 @@ result is now as follows:</p></div>
|
|
4404
4671
|
|
|
4405
4672
|
+--------------------+ |
|
4406
4673
|
| Worker process 2 |-----/
|
4407
|
-
+--------------------+</
|
4674
|
+
+--------------------+</pre>
|
4408
4675
|
</div></div>
|
4409
4676
|
<div class="paragraph"><p>As you can see, Worker process 1 and Worker process 2 have the same Memcache
|
4410
4677
|
connection.</p></div>
|
@@ -4420,8 +4687,8 @@ recognize. In other words: the data from both handlers get interleaved. And thus
|
|
4420
4687
|
Memcached is forced to handle this as an error.</p></div>
|
4421
4688
|
<div class="paragraph"><p>This problem can be solved by reestablishing the connection to Memcached after forking:</p></div>
|
4422
4689
|
<div class="literalblock">
|
4423
|
-
<div class="content">
|
4424
|
-
<pre
|
4690
|
+
<div class="content monospaced">
|
4691
|
+
<pre>+--------------------+
|
4425
4692
|
| ApplicationSpawner |------+----[Memcached server]
|
4426
4693
|
+--------------------+ | |
|
4427
4694
|
| |
|
@@ -4435,7 +4702,7 @@ Memcached is forced to handle this as an error.</p></div>
|
|
4435
4702
|
| Worker process 2 |-----/ connection |
|
4436
4703
|
+--------------------+ |
|
4437
4704
|
| |
|
4438
|
-
+-------------------------------------+</
|
4705
|
+
+-------------------------------------+</pre>
|
4439
4706
|
</div></div>
|
4440
4707
|
<div class="paragraph"><p>Worker process 2 now has its own, separate communication channel with Memcached.
|
4441
4708
|
The code in <em>environment.rb</em> looks like this:</p></div>
|
@@ -4473,7 +4740,7 @@ Memcached example, doesn’t help.</p></div>
|
|
4473
4740
|
disappear after a fork call. So if you’ve created any threads in environment.rb,
|
4474
4741
|
then those threads will no longer be running in newly created worker process.
|
4475
4742
|
You need to revive them when a new worker process is created. Use the
|
4476
|
-
<
|
4743
|
+
<span class="monospaced">:starting_worker_process</span> event that Phusion Passenger provides, like this:</p></div>
|
4477
4744
|
<div class="listingblock">
|
4478
4745
|
<div class="content"><!-- Generator: GNU source-highlight 2.11.1
|
4479
4746
|
by Lorenzo Bettini
|
@@ -4505,16 +4772,16 @@ of <em>active_record/base.rb</em> located in <em>RAILS_ROOT/lib/patches</em>, an
|
|
4505
4772
|
<em>RAILS_ROOT/lib/patches</em> comes first in the Ruby load path. When conservative
|
4506
4773
|
spawning is used, the patched version of <em>base.rb</em> is properly loaded. When
|
4507
4774
|
<em>smart</em> (not <em>smart-lv2</em>) spawning is used, the original <em>base.rb</em> is used
|
4508
|
-
because it was already loaded, so a subsequent <
|
4775
|
+
because it was already loaded, so a subsequent <span class="monospaced">require "active_record/base"</span>
|
4509
4776
|
has no effect.</p></div>
|
4510
4777
|
</div>
|
4511
4778
|
</div>
|
4512
4779
|
</div>
|
4513
4780
|
</div>
|
4514
|
-
<div id="footnotes"><hr
|
4781
|
+
<div id="footnotes"><hr></div>
|
4515
4782
|
<div id="footer">
|
4516
4783
|
<div id="footer-text">
|
4517
|
-
Last updated 2011-
|
4784
|
+
Last updated 2011-08-03 11:00:00 CEST
|
4518
4785
|
</div>
|
4519
4786
|
</div>
|
4520
4787
|
</body>
|