passenger 5.0.4 → 5.0.5
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.
- checksums.yaml +8 -8
- checksums.yaml.gz.asc +7 -7
- data.tar.gz.asc +7 -7
- data/.editorconfig +10 -0
- data/CHANGELOG +21 -0
- data/build/agents.rb +2 -2
- data/build/apache2.rb +6 -5
- data/build/common_library.rb +22 -7
- data/build/cxx_tests.rb +0 -3
- data/build/misc.rb +1 -1
- data/dev/parse_file_descriptor_log +119 -0
- data/doc/CloudLicensingConfiguration.html +387 -0
- data/doc/Design and Architecture.html +2430 -0
- data/doc/Packaging.html +488 -0
- data/doc/Security of user switching support.html +1833 -0
- data/doc/ServerOptimizationGuide.html +659 -0
- data/doc/ServerOptimizationGuide.txt.md +8 -0
- data/doc/Users guide Apache.html +9116 -0
- data/doc/Users guide Apache.idmap.txt +6 -2
- data/doc/Users guide Apache.txt +26 -7
- data/doc/Users guide Nginx.html +9025 -0
- data/doc/Users guide Nginx.idmap.txt +7 -3
- data/doc/Users guide Nginx.txt +29 -6
- data/doc/Users guide Standalone.html +3983 -0
- data/doc/Users guide.html +1748 -0
- data/doc/users_guide_snippets/installation.txt +4 -4
- data/ext/apache2/Configuration.cpp +16 -5
- data/ext/apache2/Configuration.hpp +4 -2
- data/ext/apache2/Hooks.cpp +44 -19
- data/ext/boost/libs/thread/src/pthread/once.cpp +2 -0
- data/ext/boost/libs/thread/src/pthread/once_atomic.cpp +6 -0
- data/ext/common/AgentsStarter.h +3 -2
- data/ext/common/ApplicationPool2/DirectSpawner.h +14 -4
- data/ext/common/ApplicationPool2/DummySpawner.h +12 -7
- data/ext/common/ApplicationPool2/Implementation.cpp +1 -1
- data/ext/common/ApplicationPool2/Process.h +2 -1
- data/ext/common/ApplicationPool2/Session.h +6 -6
- data/ext/common/ApplicationPool2/SmartSpawner.h +19 -4
- data/ext/common/ApplicationPool2/Socket.h +59 -27
- data/ext/common/ApplicationPool2/Spawner.h +2 -2
- data/ext/common/BackgroundEventLoop.cpp +6 -1
- data/ext/common/Constants.h +1 -1
- data/ext/common/EventedClient.h +1 -1
- data/ext/common/EventedServer.h +2 -2
- data/ext/common/FileDescriptor.h +25 -6
- data/ext/common/Logging.cpp +107 -52
- data/ext/common/Logging.h +146 -19
- data/ext/common/MessageClient.h +2 -2
- data/ext/common/MessageServer.h +3 -2
- data/ext/common/RandomGenerator.h +8 -7
- data/ext/common/SafeLibev.h +5 -1
- data/ext/common/ServerKit/AcceptLoadBalancer.h +9 -4
- data/ext/common/ServerKit/FdSinkChannel.h +5 -2
- data/ext/common/ServerKit/FdSourceChannel.h +5 -2
- data/ext/common/ServerKit/FileBufferedChannel.h +2 -0
- data/ext/common/ServerKit/FileBufferedFdSinkChannel.h +7 -2
- data/ext/common/ServerKit/HttpServer.h +6 -0
- data/ext/common/ServerKit/Server.h +40 -3
- data/ext/common/StaticString.h +20 -0
- data/ext/common/UnionStation/Connection.h +3 -1
- data/ext/common/UnionStation/Core.h +6 -4
- data/ext/common/Utils.cpp +4 -3
- data/ext/common/Utils/DateParsing.h +19 -5
- data/ext/common/Utils/FastStringStream.h +183 -0
- data/ext/common/Utils/IOUtils.cpp +47 -28
- data/ext/common/Utils/IOUtils.h +56 -12
- data/ext/common/Utils/MessagePassing.h +3 -3
- data/ext/common/Utils/ProcessMetricsCollector.h +2 -2
- data/ext/common/Utils/ScopeGuard.h +16 -5
- data/ext/common/Utils/SpeedMeter.h +2 -2
- data/ext/common/Utils/StrIntUtils.cpp +6 -6
- data/ext/common/Utils/StrIntUtils.h +2 -1
- data/ext/common/agents/Base.cpp +56 -4
- data/ext/common/agents/Base.h +2 -1
- data/ext/common/agents/HelperAgent/AdminServer.h +122 -11
- data/ext/common/agents/HelperAgent/Main.cpp +16 -5
- data/ext/common/agents/HelperAgent/OptionParser.h +7 -1
- data/ext/common/agents/HelperAgent/RequestHandler.h +1 -1
- data/ext/common/agents/HelperAgent/RequestHandler/Hooks.cpp +10 -1
- data/ext/common/agents/HelperAgent/RequestHandler/Request.h +8 -0
- data/ext/common/agents/HelperAgent/RequestHandler/TurboCaching.h +4 -3
- data/ext/common/agents/LoggingAgent/AdminServer.h +57 -11
- data/ext/common/agents/LoggingAgent/LoggingServer.h +3 -3
- data/ext/common/agents/LoggingAgent/Main.cpp +11 -3
- data/ext/common/agents/Watchdog/AdminServer.h +53 -11
- data/ext/common/agents/Watchdog/AgentWatcher.cpp +3 -3
- data/ext/common/agents/Watchdog/Main.cpp +13 -6
- data/ext/libeio/ecb.h +1 -1
- data/ext/libev/ev.c +13 -1
- data/ext/libev/ev.h +3 -0
- data/ext/nginx/Configuration.c +28 -6
- data/ext/nginx/Configuration.h +2 -1
- data/ext/nginx/ngx_http_passenger_module.c +5 -4
- data/ext/oxt/dynamic_thread_group.hpp +38 -5
- data/lib/phusion_passenger.rb +1 -1
- data/lib/phusion_passenger/common_library.rb +9 -5
- data/lib/phusion_passenger/config/reopen_logs_command.rb +2 -2
- data/lib/phusion_passenger/packaging.rb +23 -37
- data/passenger.gemspec +21 -21
- metadata +4 -453
- metadata.gz.asc +7 -7
- data/.gitignore +0 -68
- data/.travis.yml +0 -16
- data/Gemfile +0 -17
- data/Gemfile.lock +0 -39
- data/Vagrantfile +0 -54
- data/debian.template/README.Debian +0 -15
- data/debian.template/changelog +0 -316
- data/debian.template/compat +0 -1
- data/debian.template/control.erb +0 -91
- data/debian.template/copyright +0 -385
- data/debian.template/libapache2-mod-passenger.install +0 -3
- data/debian.template/libapache2-mod-passenger.postinst +0 -36
- data/debian.template/libapache2-mod-passenger.prerm +0 -15
- data/debian.template/locations.ini.erb +0 -14
- data/debian.template/passenger-dev.install.erb +0 -3
- data/debian.template/passenger-doc.install.erb +0 -2
- data/debian.template/passenger.conf +0 -6
- data/debian.template/passenger.docs +0 -4
- data/debian.template/passenger.install.erb +0 -14
- data/debian.template/passenger.load +0 -3
- data/debian.template/passenger.manpages +0 -3
- data/debian.template/patches/series +0 -0
- data/debian.template/rules.erb +0 -76
- data/debian.template/source/format +0 -1
- data/ext/common/EventedBufferedInput.h +0 -458
- data/packaging/rpm/LICENSE.txt +0 -19
- data/packaging/rpm/Makefile +0 -13
- data/packaging/rpm/README.md +0 -41
- data/packaging/rpm/Vagrantfile +0 -38
- data/packaging/rpm/Vagrantfile.centos +0 -30
- data/packaging/rpm/build +0 -170
- data/packaging/rpm/create_project +0 -41
- data/packaging/rpm/git_update +0 -88
- data/packaging/rpm/image/Dockerfile +0 -37
- data/packaging/rpm/image/Gemfile +0 -3
- data/packaging/rpm/image/Gemfile.lock +0 -12
- data/packaging/rpm/image/RPM-GPG-KEY-amazon-ga +0 -19
- data/packaging/rpm/image/amazon2014-i386.cfg +0 -96
- data/packaging/rpm/image/amazon2014-x86_64.cfg +0 -96
- data/packaging/rpm/image/site-defaults.cfg +0 -168
- data/packaging/rpm/internal/build_tasks.rb +0 -238
- data/packaging/rpm/internal/dummygpg +0 -11
- data/packaging/rpm/internal/exec_build +0 -42
- data/packaging/rpm/internal/get_distro_arch +0 -14
- data/packaging/rpm/internal/get_distro_id +0 -10
- data/packaging/rpm/internal/git_update +0 -27
- data/packaging/rpm/internal/inituidgid +0 -17
- data/packaging/rpm/internal/my_init +0 -344
- data/packaging/rpm/internal/python27 +0 -3
- data/packaging/rpm/internal/repo_update +0 -46
- data/packaging/rpm/internal/setuser +0 -26
- data/packaging/rpm/internal/tracking_helper +0 -40
- data/packaging/rpm/jenkins_release +0 -99
- data/packaging/rpm/lib/build_tasks_support.rb +0 -402
- data/packaging/rpm/lib/preprocessor.rb +0 -341
- data/packaging/rpm/nginx_spec/404.html +0 -119
- data/packaging/rpm/nginx_spec/50x.html +0 -119
- data/packaging/rpm/nginx_spec/index.html +0 -116
- data/packaging/rpm/nginx_spec/nginx-auto-cc-gcc.patch +0 -13
- data/packaging/rpm/nginx_spec/nginx-logo.png +0 -0
- data/packaging/rpm/nginx_spec/nginx-upgrade +0 -13
- data/packaging/rpm/nginx_spec/nginx-upgrade.8 +0 -151
- data/packaging/rpm/nginx_spec/nginx.conf +0 -131
- data/packaging/rpm/nginx_spec/nginx.init +0 -144
- data/packaging/rpm/nginx_spec/nginx.logrotate +0 -13
- data/packaging/rpm/nginx_spec/nginx.service +0 -15
- data/packaging/rpm/nginx_spec/nginx.spec.template +0 -560
- data/packaging/rpm/nginx_spec/nginx.sysconfig +0 -4
- data/packaging/rpm/nginx_spec/passenger.conf +0 -9
- data/packaging/rpm/nginx_spec/poweredby.png +0 -0
- data/packaging/rpm/passenger_spec/apache-passenger.conf.in +0 -26
- data/packaging/rpm/passenger_spec/config.json +0 -30
- data/packaging/rpm/passenger_spec/passenger.logrotate +0 -7
- data/packaging/rpm/passenger_spec/passenger.spec.template +0 -478
- data/packaging/rpm/passenger_spec/passenger_dynamic_thread_group.patch +0 -16
- data/packaging/rpm/passenger_spec/passenger_tests_default_config_example.patch +0 -44
- data/packaging/rpm/passenger_spec/rubygem-passenger-4.0.18-GLIBC_HAVE_LONG_LONG.patch +0 -21
- data/packaging/rpm/repo_update +0 -114
- data/packaging/rpm/setup-system +0 -61
- data/packaging/rpm/shell +0 -10
- data/test/.rspec +0 -4
- data/test/config.json.example +0 -42
- data/test/config.json.rpm-automation +0 -15
- data/test/config.json.travis +0 -15
- data/test/config.json.vagrant +0 -30
- data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +0 -124
- data/test/cxx/ApplicationPool2/OptionsTest.cpp +0 -30
- data/test/cxx/ApplicationPool2/PoolTest.cpp +0 -2062
- data/test/cxx/ApplicationPool2/ProcessTest.cpp +0 -130
- data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +0 -243
- data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +0 -823
- data/test/cxx/BufferedIOTest.cpp +0 -364
- data/test/cxx/CachedFileStatTest.cpp +0 -402
- data/test/cxx/CxxTestMain.cpp +0 -181
- data/test/cxx/DataStructures/LStringTest.cpp +0 -275
- data/test/cxx/DataStructures/StringKeyTableTest.cpp +0 -199
- data/test/cxx/DateParsingTest.cpp +0 -75
- data/test/cxx/DechunkerTest.cpp +0 -250
- data/test/cxx/EventedBufferedInputTest.cpp +0 -758
- data/test/cxx/EventedClientTest.cpp +0 -523
- data/test/cxx/FileChangeCheckerTest.cpp +0 -331
- data/test/cxx/FileDescriptorTest.cpp +0 -69
- data/test/cxx/FilterSupportTest.cpp +0 -433
- data/test/cxx/IOUtilsTest.cpp +0 -861
- data/test/cxx/MemoryKit/MbufTest.cpp +0 -213
- data/test/cxx/MessageIOTest.cpp +0 -360
- data/test/cxx/MessagePassingTest.cpp +0 -81
- data/test/cxx/MessageReadersWritersTest.cpp +0 -576
- data/test/cxx/MessageServerTest.cpp +0 -393
- data/test/cxx/ProcessMetricsCollectorTest.cpp +0 -123
- data/test/cxx/RequestHandlerTest.cpp +0 -1463
- data/test/cxx/ResponseCacheTest.cpp +0 -322
- data/test/cxx/ServerKit/ChannelTest.cpp +0 -1467
- data/test/cxx/ServerKit/CookieUtilsTest.cpp +0 -274
- data/test/cxx/ServerKit/FileBufferedChannelTest.cpp +0 -992
- data/test/cxx/ServerKit/HeaderTableTest.cpp +0 -177
- data/test/cxx/ServerKit/HttpServerTest.cpp +0 -1580
- data/test/cxx/ServerKit/ServerTest.cpp +0 -408
- data/test/cxx/StaticStringTest.cpp +0 -220
- data/test/cxx/StringMapTest.cpp +0 -131
- data/test/cxx/SystemTimeTest.cpp +0 -37
- data/test/cxx/TemplateTest.cpp +0 -118
- data/test/cxx/TestSupport.cpp +0 -207
- data/test/cxx/TestSupport.h +0 -333
- data/test/cxx/UnionStationTest.cpp +0 -741
- data/test/cxx/Utils/StrIntUtilsTest.cpp +0 -39
- data/test/cxx/UtilsTest.cpp +0 -672
- data/test/cxx/VariantMapTest.cpp +0 -191
- data/test/gdbinit.example +0 -34
- data/test/integration_tests/apache2_tests.rb +0 -585
- data/test/integration_tests/downloaded_binaries_tests.rb +0 -185
- data/test/integration_tests/native_packaging_spec.rb +0 -368
- data/test/integration_tests/nginx_tests.rb +0 -402
- data/test/integration_tests/shared/example_webapp_tests.rb +0 -289
- data/test/integration_tests/source_packaging_test.rb +0 -201
- data/test/integration_tests/spec_helper.rb +0 -22
- data/test/integration_tests/standalone_tests.rb +0 -392
- data/test/node/line_reader_spec.js +0 -338
- data/test/node/spec_helper.js +0 -65
- data/test/oxt/backtrace_test.cpp +0 -88
- data/test/oxt/counter.hpp +0 -55
- data/test/oxt/dynamic_thread_group_test.cpp +0 -131
- data/test/oxt/oxt_test_main.cpp +0 -27
- data/test/oxt/spin_lock_test.cpp +0 -59
- data/test/oxt/syscall_interruption_test.cpp +0 -39
- data/test/ruby/debug_logging_spec.rb +0 -145
- data/test/ruby/message_channel_spec.rb +0 -196
- data/test/ruby/rack/loader_spec.rb +0 -42
- data/test/ruby/rack/preloader_spec.rb +0 -48
- data/test/ruby/rails3.0/loader_spec.rb +0 -26
- data/test/ruby/rails3.0/preloader_spec.rb +0 -32
- data/test/ruby/rails3.1/loader_spec.rb +0 -26
- data/test/ruby/rails3.1/preloader_spec.rb +0 -32
- data/test/ruby/rails3.2/loader_spec.rb +0 -26
- data/test/ruby/rails3.2/preloader_spec.rb +0 -32
- data/test/ruby/rails4.0/loader_spec.rb +0 -28
- data/test/ruby/rails4.0/preloader_spec.rb +0 -34
- data/test/ruby/rails4.1/loader_spec.rb +0 -28
- data/test/ruby/rails4.1/preloader_spec.rb +0 -34
- data/test/ruby/request_handler_spec.rb +0 -747
- data/test/ruby/shared/loader_sharedspec.rb +0 -247
- data/test/ruby/shared/rails/union_station_extensions_sharedspec.rb +0 -357
- data/test/ruby/shared/ruby_loader_sharedspec.rb +0 -55
- data/test/ruby/spec_helper.rb +0 -114
- data/test/ruby/standalone/runtime_installer_spec.rb +0 -402
- data/test/ruby/union_station_spec.rb +0 -288
- data/test/ruby/utils/file_system_watcher_spec.rb +0 -229
- data/test/ruby/utils/hosts_file_parser.rb +0 -258
- data/test/ruby/utils/tee_input_spec.rb +0 -235
- data/test/ruby/utils/unseekable_socket_spec.rb +0 -66
- data/test/ruby/utils_spec.rb +0 -41
- data/test/stub/apache2/httpd.conf.erb +0 -122
- data/test/stub/apache2/mime.types +0 -748
- data/test/stub/garbage1.dat +0 -0
- data/test/stub/garbage2.dat +0 -0
- data/test/stub/garbage3.dat +0 -0
- data/test/stub/http_request.yml +0 -23
- data/test/stub/index.html +0 -1
- data/test/stub/nginx/koi-utf +0 -109
- data/test/stub/nginx/koi-win +0 -103
- data/test/stub/nginx/mime.types +0 -70
- data/test/stub/nginx/nginx.conf.erb +0 -70
- data/test/stub/nginx/win-utf +0 -126
- data/test/stub/node/app.js +0 -133
- data/test/stub/node/public/.gitignore +0 -0
- data/test/stub/node/tmp/.gitignore +0 -0
- data/test/stub/rack/config.ru +0 -95
- data/test/stub/rack/library.rb +0 -16
- data/test/stub/rack/public/.gitignore +0 -0
- data/test/stub/rack/start.rb +0 -52
- data/test/stub/rack/tmp/.gitignore +0 -0
- data/test/stub/rails3.0/.gitignore +0 -4
- data/test/stub/rails3.0/Gemfile +0 -22
- data/test/stub/rails3.0/Gemfile.lock +0 -80
- data/test/stub/rails3.0/Rakefile +0 -10
- data/test/stub/rails3.0/app/controllers/application_controller.rb +0 -4
- data/test/stub/rails3.0/app/helpers/application_helper.rb +0 -2
- data/test/stub/rails3.0/app/views/layouts/application.html.erb +0 -14
- data/test/stub/rails3.0/config.ru +0 -4
- data/test/stub/rails3.0/config/application.rb +0 -48
- data/test/stub/rails3.0/config/boot.rb +0 -13
- data/test/stub/rails3.0/config/database.yml +0 -22
- data/test/stub/rails3.0/config/environment.rb +0 -5
- data/test/stub/rails3.0/config/environments/development.rb +0 -19
- data/test/stub/rails3.0/config/environments/production.rb +0 -48
- data/test/stub/rails3.0/config/environments/test.rb +0 -32
- data/test/stub/rails3.0/config/initializers/backtrace_silencers.rb +0 -7
- data/test/stub/rails3.0/config/initializers/inflections.rb +0 -10
- data/test/stub/rails3.0/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails3.0/config/initializers/passenger.rb +0 -2
- data/test/stub/rails3.0/config/initializers/secret_token.rb +0 -7
- data/test/stub/rails3.0/config/initializers/session_store.rb +0 -8
- data/test/stub/rails3.0/config/locales/en.yml +0 -5
- data/test/stub/rails3.0/config/routes.rb +0 -58
- data/test/stub/rails3.0/db/seeds.rb +0 -7
- data/test/stub/rails3.0/doc/README_FOR_APP +0 -2
- data/test/stub/rails3.0/lib/tasks/.gitkeep +0 -0
- data/test/stub/rails3.0/log/.gitignore +0 -0
- data/test/stub/rails3.0/public/404.html +0 -26
- data/test/stub/rails3.0/public/422.html +0 -26
- data/test/stub/rails3.0/public/500.html +0 -26
- data/test/stub/rails3.0/public/favicon.ico +0 -0
- data/test/stub/rails3.0/public/index.html +0 -279
- data/test/stub/rails3.0/public/robots.txt +0 -5
- data/test/stub/rails3.0/public/stylesheets/.gitkeep +0 -0
- data/test/stub/rails3.0/script/rails +0 -9
- data/test/stub/rails3.0/test/performance/browsing_test.rb +0 -9
- data/test/stub/rails3.0/test/test_helper.rb +0 -13
- data/test/stub/rails3.0/vendor/plugins/.gitkeep +0 -0
- data/test/stub/rails3.1/.gitignore +0 -15
- data/test/stub/rails3.1/Gemfile +0 -37
- data/test/stub/rails3.1/Gemfile.lock +0 -115
- data/test/stub/rails3.1/README +0 -261
- data/test/stub/rails3.1/Rakefile +0 -7
- data/test/stub/rails3.1/app/assets/images/rails.png +0 -0
- data/test/stub/rails3.1/app/assets/stylesheets/application.css +0 -7
- data/test/stub/rails3.1/app/controllers/application_controller.rb +0 -3
- data/test/stub/rails3.1/app/helpers/application_helper.rb +0 -2
- data/test/stub/rails3.1/app/mailers/.gitkeep +0 -0
- data/test/stub/rails3.1/app/models/.gitkeep +0 -0
- data/test/stub/rails3.1/app/views/layouts/application.html.erb +0 -14
- data/test/stub/rails3.1/config.ru +0 -4
- data/test/stub/rails3.1/config/application.rb +0 -48
- data/test/stub/rails3.1/config/boot.rb +0 -6
- data/test/stub/rails3.1/config/database.yml +0 -25
- data/test/stub/rails3.1/config/environment.rb +0 -5
- data/test/stub/rails3.1/config/environments/development.rb +0 -30
- data/test/stub/rails3.1/config/environments/production.rb +0 -60
- data/test/stub/rails3.1/config/environments/test.rb +0 -39
- data/test/stub/rails3.1/config/initializers/backtrace_silencers.rb +0 -7
- data/test/stub/rails3.1/config/initializers/inflections.rb +0 -10
- data/test/stub/rails3.1/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails3.1/config/initializers/passenger.rb +0 -2
- data/test/stub/rails3.1/config/initializers/secret_token.rb +0 -7
- data/test/stub/rails3.1/config/initializers/session_store.rb +0 -8
- data/test/stub/rails3.1/config/initializers/wrap_parameters.rb +0 -14
- data/test/stub/rails3.1/config/locales/en.yml +0 -5
- data/test/stub/rails3.1/config/routes.rb +0 -58
- data/test/stub/rails3.1/db/seeds.rb +0 -7
- data/test/stub/rails3.1/doc/README_FOR_APP +0 -2
- data/test/stub/rails3.1/lib/assets/.gitkeep +0 -0
- data/test/stub/rails3.1/lib/tasks/.gitkeep +0 -0
- data/test/stub/rails3.1/log/.gitkeep +0 -0
- data/test/stub/rails3.1/public/404.html +0 -26
- data/test/stub/rails3.1/public/422.html +0 -26
- data/test/stub/rails3.1/public/500.html +0 -26
- data/test/stub/rails3.1/public/favicon.ico +0 -0
- data/test/stub/rails3.1/public/index.html +0 -241
- data/test/stub/rails3.1/public/robots.txt +0 -5
- data/test/stub/rails3.1/script/rails +0 -6
- data/test/stub/rails3.1/test/fixtures/.gitkeep +0 -0
- data/test/stub/rails3.1/test/functional/.gitkeep +0 -0
- data/test/stub/rails3.1/test/integration/.gitkeep +0 -0
- data/test/stub/rails3.1/test/performance/browsing_test.rb +0 -12
- data/test/stub/rails3.1/test/test_helper.rb +0 -13
- data/test/stub/rails3.1/test/unit/.gitkeep +0 -0
- data/test/stub/rails3.1/vendor/assets/stylesheets/.gitkeep +0 -0
- data/test/stub/rails3.1/vendor/plugins/.gitkeep +0 -0
- data/test/stub/rails3.2/.gitignore +0 -15
- data/test/stub/rails3.2/Gemfile +0 -39
- data/test/stub/rails3.2/Gemfile.lock +0 -113
- data/test/stub/rails3.2/Rakefile +0 -7
- data/test/stub/rails3.2/app/assets/images/rails.png +0 -0
- data/test/stub/rails3.2/app/assets/stylesheets/application.css +0 -13
- data/test/stub/rails3.2/app/controllers/application_controller.rb +0 -3
- data/test/stub/rails3.2/app/helpers/application_helper.rb +0 -2
- data/test/stub/rails3.2/app/mailers/.gitkeep +0 -0
- data/test/stub/rails3.2/app/models/.gitkeep +0 -0
- data/test/stub/rails3.2/app/views/layouts/application.html.erb +0 -14
- data/test/stub/rails3.2/config.ru +0 -4
- data/test/stub/rails3.2/config/application.rb +0 -62
- data/test/stub/rails3.2/config/boot.rb +0 -6
- data/test/stub/rails3.2/config/database.yml +0 -25
- data/test/stub/rails3.2/config/environment.rb +0 -5
- data/test/stub/rails3.2/config/environments/development.rb +0 -37
- data/test/stub/rails3.2/config/environments/production.rb +0 -67
- data/test/stub/rails3.2/config/environments/test.rb +0 -37
- data/test/stub/rails3.2/config/initializers/backtrace_silencers.rb +0 -7
- data/test/stub/rails3.2/config/initializers/inflections.rb +0 -15
- data/test/stub/rails3.2/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails3.2/config/initializers/passenger.rb +0 -2
- data/test/stub/rails3.2/config/initializers/secret_token.rb +0 -7
- data/test/stub/rails3.2/config/initializers/session_store.rb +0 -8
- data/test/stub/rails3.2/config/initializers/wrap_parameters.rb +0 -14
- data/test/stub/rails3.2/config/locales/en.yml +0 -5
- data/test/stub/rails3.2/config/routes.rb +0 -58
- data/test/stub/rails3.2/db/seeds.rb +0 -7
- data/test/stub/rails3.2/doc/README_FOR_APP +0 -2
- data/test/stub/rails3.2/lib/assets/.gitkeep +0 -0
- data/test/stub/rails3.2/lib/tasks/.gitkeep +0 -0
- data/test/stub/rails3.2/log/.gitkeep +0 -0
- data/test/stub/rails3.2/public/404.html +0 -26
- data/test/stub/rails3.2/public/422.html +0 -26
- data/test/stub/rails3.2/public/500.html +0 -25
- data/test/stub/rails3.2/public/favicon.ico +0 -0
- data/test/stub/rails3.2/public/index.html +0 -241
- data/test/stub/rails3.2/public/robots.txt +0 -5
- data/test/stub/rails3.2/script/rails +0 -6
- data/test/stub/rails3.2/test/fixtures/.gitkeep +0 -0
- data/test/stub/rails3.2/test/functional/.gitkeep +0 -0
- data/test/stub/rails3.2/test/integration/.gitkeep +0 -0
- data/test/stub/rails3.2/test/performance/browsing_test.rb +0 -12
- data/test/stub/rails3.2/test/test_helper.rb +0 -13
- data/test/stub/rails3.2/test/unit/.gitkeep +0 -0
- data/test/stub/rails3.2/vendor/assets/stylesheets/.gitkeep +0 -0
- data/test/stub/rails3.2/vendor/plugins/.gitkeep +0 -0
- data/test/stub/rails4.0/.gitignore +0 -16
- data/test/stub/rails4.0/Gemfile +0 -45
- data/test/stub/rails4.0/Gemfile.lock +0 -126
- data/test/stub/rails4.0/README.rdoc +0 -28
- data/test/stub/rails4.0/Rakefile +0 -6
- data/test/stub/rails4.0/app/assets/images/.keep +0 -0
- data/test/stub/rails4.0/app/assets/javascripts/application.js +0 -16
- data/test/stub/rails4.0/app/assets/stylesheets/application.css +0 -13
- data/test/stub/rails4.0/app/controllers/application_controller.rb +0 -5
- data/test/stub/rails4.0/app/controllers/concerns/.keep +0 -0
- data/test/stub/rails4.0/app/helpers/application_helper.rb +0 -2
- data/test/stub/rails4.0/app/mailers/.keep +0 -0
- data/test/stub/rails4.0/app/models/.keep +0 -0
- data/test/stub/rails4.0/app/models/concerns/.keep +0 -0
- data/test/stub/rails4.0/app/views/layouts/application.html.erb +0 -14
- data/test/stub/rails4.0/bin/bundle +0 -3
- data/test/stub/rails4.0/bin/rails +0 -4
- data/test/stub/rails4.0/bin/rake +0 -4
- data/test/stub/rails4.0/config.ru +0 -4
- data/test/stub/rails4.0/config/application.rb +0 -23
- data/test/stub/rails4.0/config/boot.rb +0 -4
- data/test/stub/rails4.0/config/database.yml +0 -25
- data/test/stub/rails4.0/config/environment.rb +0 -5
- data/test/stub/rails4.0/config/environments/development.rb +0 -29
- data/test/stub/rails4.0/config/environments/production.rb +0 -80
- data/test/stub/rails4.0/config/environments/test.rb +0 -36
- data/test/stub/rails4.0/config/initializers/backtrace_silencers.rb +0 -7
- data/test/stub/rails4.0/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/stub/rails4.0/config/initializers/inflections.rb +0 -16
- data/test/stub/rails4.0/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails4.0/config/initializers/passenger.rb +0 -2
- data/test/stub/rails4.0/config/initializers/secret_token.rb +0 -12
- data/test/stub/rails4.0/config/initializers/session_store.rb +0 -3
- data/test/stub/rails4.0/config/initializers/wrap_parameters.rb +0 -14
- data/test/stub/rails4.0/config/locales/en.yml +0 -23
- data/test/stub/rails4.0/config/routes.rb +0 -57
- data/test/stub/rails4.0/db/seeds.rb +0 -7
- data/test/stub/rails4.0/lib/assets/.keep +0 -0
- data/test/stub/rails4.0/lib/tasks/.keep +0 -0
- data/test/stub/rails4.0/log/.keep +0 -0
- data/test/stub/rails4.0/public/404.html +0 -58
- data/test/stub/rails4.0/public/422.html +0 -58
- data/test/stub/rails4.0/public/500.html +0 -57
- data/test/stub/rails4.0/public/favicon.ico +0 -0
- data/test/stub/rails4.0/public/robots.txt +0 -5
- data/test/stub/rails4.0/test/controllers/.keep +0 -0
- data/test/stub/rails4.0/test/fixtures/.keep +0 -0
- data/test/stub/rails4.0/test/helpers/.keep +0 -0
- data/test/stub/rails4.0/test/integration/.keep +0 -0
- data/test/stub/rails4.0/test/mailers/.keep +0 -0
- data/test/stub/rails4.0/test/models/.keep +0 -0
- data/test/stub/rails4.0/test/test_helper.rb +0 -15
- data/test/stub/rails4.0/vendor/assets/javascripts/.keep +0 -0
- data/test/stub/rails4.0/vendor/assets/stylesheets/.keep +0 -0
- data/test/stub/rails4.1/.gitignore +0 -16
- data/test/stub/rails4.1/Gemfile +0 -45
- data/test/stub/rails4.1/Gemfile.lock +0 -129
- data/test/stub/rails4.1/README.rdoc +0 -28
- data/test/stub/rails4.1/Rakefile +0 -6
- data/test/stub/rails4.1/app/assets/images/.keep +0 -0
- data/test/stub/rails4.1/app/assets/javascripts/application.js +0 -16
- data/test/stub/rails4.1/app/assets/stylesheets/application.css +0 -13
- data/test/stub/rails4.1/app/controllers/application_controller.rb +0 -5
- data/test/stub/rails4.1/app/controllers/concerns/.keep +0 -0
- data/test/stub/rails4.1/app/helpers/application_helper.rb +0 -2
- data/test/stub/rails4.1/app/mailers/.keep +0 -0
- data/test/stub/rails4.1/app/models/.keep +0 -0
- data/test/stub/rails4.1/app/models/concerns/.keep +0 -0
- data/test/stub/rails4.1/app/views/layouts/application.html.erb +0 -14
- data/test/stub/rails4.1/bin/bundle +0 -3
- data/test/stub/rails4.1/bin/rails +0 -4
- data/test/stub/rails4.1/bin/rake +0 -4
- data/test/stub/rails4.1/config.ru +0 -4
- data/test/stub/rails4.1/config/application.rb +0 -23
- data/test/stub/rails4.1/config/boot.rb +0 -4
- data/test/stub/rails4.1/config/database.yml +0 -25
- data/test/stub/rails4.1/config/environment.rb +0 -5
- data/test/stub/rails4.1/config/environments/development.rb +0 -29
- data/test/stub/rails4.1/config/environments/production.rb +0 -80
- data/test/stub/rails4.1/config/environments/test.rb +0 -36
- data/test/stub/rails4.1/config/initializers/backtrace_silencers.rb +0 -7
- data/test/stub/rails4.1/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/stub/rails4.1/config/initializers/inflections.rb +0 -16
- data/test/stub/rails4.1/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails4.1/config/initializers/passenger.rb +0 -5
- data/test/stub/rails4.1/config/initializers/secret_token.rb +0 -12
- data/test/stub/rails4.1/config/initializers/session_store.rb +0 -3
- data/test/stub/rails4.1/config/initializers/wrap_parameters.rb +0 -14
- data/test/stub/rails4.1/config/locales/en.yml +0 -23
- data/test/stub/rails4.1/config/routes.rb +0 -57
- data/test/stub/rails4.1/db/seeds.rb +0 -7
- data/test/stub/rails4.1/lib/assets/.keep +0 -0
- data/test/stub/rails4.1/lib/tasks/.keep +0 -0
- data/test/stub/rails4.1/log/.keep +0 -0
- data/test/stub/rails4.1/public/404.html +0 -58
- data/test/stub/rails4.1/public/422.html +0 -58
- data/test/stub/rails4.1/public/500.html +0 -57
- data/test/stub/rails4.1/public/favicon.ico +0 -0
- data/test/stub/rails4.1/public/robots.txt +0 -5
- data/test/stub/rails4.1/test/controllers/.keep +0 -0
- data/test/stub/rails4.1/test/fixtures/.keep +0 -0
- data/test/stub/rails4.1/test/helpers/.keep +0 -0
- data/test/stub/rails4.1/test/integration/.keep +0 -0
- data/test/stub/rails4.1/test/mailers/.keep +0 -0
- data/test/stub/rails4.1/test/models/.keep +0 -0
- data/test/stub/rails4.1/test/test_helper.rb +0 -15
- data/test/stub/rails4.1/vendor/assets/javascripts/.keep +0 -0
- data/test/stub/rails4.1/vendor/assets/stylesheets/.keep +0 -0
- data/test/stub/start_error.pl +0 -24
- data/test/stub/upload_data.txt +0 -494
- data/test/stub/wsgi/passenger_wsgi.py +0 -212
- data/test/stub/wsgi/public/.gitignore +0 -0
- data/test/stub/wsgi/tmp/.gitignore +0 -0
- data/test/support/allocate_memory.c +0 -14
- data/test/support/apache2_controller.rb +0 -258
- data/test/support/multipart.rb +0 -62
- data/test/support/nginx_controller.rb +0 -97
- data/test/support/placebo-preloader.rb +0 -88
- data/test/support/test_helper.rb +0 -455
- data/test/support/valgrind.h +0 -2539
- data/test/tut/tut.h +0 -1310
- data/test/tut/tut_reporter.h +0 -256
- data/test/valgrind-osx.supp +0 -7
@@ -244,9 +244,11 @@
|
|
244
244
|
|
245
245
|
7.7.1. passenger_log_level <integer> => passenger-log-level-integer--17snhon
|
246
246
|
|
247
|
-
7.7.2.
|
247
|
+
7.7.2. passenger_log_file <filename> => passenger-debug-log-file-filename--21ubaj
|
248
248
|
|
249
|
-
7.7.3.
|
249
|
+
7.7.3. PassengerFileDescriptorLogFile <filename> => passengerfiledescriptorlogfile-filename--bqbga8
|
250
|
+
|
251
|
+
7.7.4. passenger_debugger <on|off> => passenger-debugger-on-off--1wkuq85
|
250
252
|
|
251
253
|
7.8. Advanced options => advanced-options-hnuhqz
|
252
254
|
|
@@ -256,10 +258,12 @@
|
|
256
258
|
|
257
259
|
7.8.3. passenger_fly_with <socket filename> => passenger-fly-with-socket-filename--1amd1xn
|
258
260
|
|
259
|
-
7.9. Deprecated options => deprecated-options-1dtzo0g
|
261
|
+
7.9. Deprecated or removed options => deprecated-options-1dtzo0g
|
260
262
|
|
261
263
|
7.9.1. rails_spawn_method => rails-spawn-method-17vdnpt
|
262
264
|
|
265
|
+
7.9.2. passenger_debug_log_file => passenger-debug-log-file-1aqru34
|
266
|
+
|
263
267
|
8. Troubleshooting => troubleshooting-1pt0c76
|
264
268
|
|
265
269
|
8.1. Generic troubleshooting tips => generic-troubleshooting-tips-xhe4nu
|
data/doc/Users guide Nginx.txt
CHANGED
@@ -1992,16 +1992,36 @@ Possible values are:
|
|
1992
1992
|
|
1993
1993
|
This option may only occur once, in the 'http' configuration block. The default is '3'.
|
1994
1994
|
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
1998
|
-
|
1995
|
+
[[PassengerLogFile]]
|
1996
|
+
==== passenger_log_file <filename> ====
|
1997
|
+
:version: 5.0.5
|
1998
|
+
include::users_guide_snippets/since_version.txt[]
|
1999
|
+
|
2000
|
+
By default Phusion Passenger log messages are written to the global web server error log. With this option, you can have those messages logged to a different file instead.
|
1999
2001
|
|
2000
2002
|
This option may only occur once, in the 'http' configuration block.
|
2001
2003
|
|
2002
2004
|
:option: `--log-file`
|
2003
2005
|
include::users_guide_snippets/alternative_for_flying_passenger.txt[]
|
2004
2006
|
|
2007
|
+
==== PassengerFileDescriptorLogFile <filename>
|
2008
|
+
:version: 5.0.5
|
2009
|
+
include::users_guide_snippets/since_version.txt[]
|
2010
|
+
|
2011
|
+
Log file descriptor debug tracing messages to the given file.
|
2012
|
+
|
2013
|
+
Phusion Passenger has the ability to log all file descriptors that it opens and closes. These logs are useful to the Phusion Passenger developers for the purpose of analyzing file descriptor leaks.
|
2014
|
+
|
2015
|
+
File descriptor activity is logged as follows:
|
2016
|
+
|
2017
|
+
* If `passenger_file_descriptor_log_file` is not set, then file descriptor activity is logged to the <<PassengerLogFile,main log file>>, but only if the <<PassengerLogLevel,log level>> is 5 (debug) or higher.
|
2018
|
+
* If `passenger_file_descriptor_log_file` is set, then file descriptor activity is logged to the specified file, regardless of the log level.
|
2019
|
+
|
2020
|
+
This option may only occur once, in the 'http' configuration block.
|
2021
|
+
|
2022
|
+
:option: `--file-descriptor-log-file`
|
2023
|
+
include::users_guide_snippets/alternative_for_flying_passenger.txt[]
|
2024
|
+
|
2005
2025
|
==== passenger_debugger <on|off> ====
|
2006
2026
|
:version: 3.0.0
|
2007
2027
|
include::users_guide_snippets/enterprise_only.txt[]
|
@@ -2093,14 +2113,17 @@ Enables <<flying_passenger,Flying Passenger>> mode, and configures Nginx to conn
|
|
2093
2113
|
This option may only occur once, in the 'http' configuration block. When not set, Flying Passenger is not enabled.
|
2094
2114
|
|
2095
2115
|
|
2096
|
-
=== Deprecated options ===
|
2116
|
+
=== Deprecated or removed options ===
|
2097
2117
|
|
2098
|
-
The following options have been deprecated
|
2118
|
+
The following options have been deprecated or removed. Some are still supported for backwards
|
2099
2119
|
compatibility reasons.
|
2100
2120
|
|
2101
2121
|
==== rails_spawn_method ====
|
2102
2122
|
Deprecated in favor of <<PassengerSpawnMethod,passenger_spawn_method>>.
|
2103
2123
|
|
2124
|
+
==== passenger_debug_log_file ====
|
2125
|
+
This option has been renamed in version 5.0.5 to <<PassengerLogFile,passenger_log_file>>.
|
2126
|
+
|
2104
2127
|
|
2105
2128
|
[[troubleshooting]]
|
2106
2129
|
== Troubleshooting ==
|
@@ -0,0 +1,3983 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
5
|
+
<meta name="generator" content="AsciiDoc 8.6.7">
|
6
|
+
<title>Phusion Passenger Standalone users guide</title>
|
7
|
+
<style type="text/css">
|
8
|
+
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
|
9
|
+
|
10
|
+
/* Default font. */
|
11
|
+
body {
|
12
|
+
font-family: Georgia,serif;
|
13
|
+
}
|
14
|
+
|
15
|
+
/* Title font. */
|
16
|
+
h1, h2, h3, h4, h5, h6,
|
17
|
+
div.title, caption.title,
|
18
|
+
thead, p.table.header,
|
19
|
+
#toctitle,
|
20
|
+
#author, #revnumber, #revdate, #revremark,
|
21
|
+
#footer {
|
22
|
+
font-family: Arial,Helvetica,sans-serif;
|
23
|
+
}
|
24
|
+
|
25
|
+
body {
|
26
|
+
margin: 1em 5% 1em 5%;
|
27
|
+
}
|
28
|
+
|
29
|
+
a {
|
30
|
+
color: blue;
|
31
|
+
text-decoration: underline;
|
32
|
+
}
|
33
|
+
a:visited {
|
34
|
+
color: fuchsia;
|
35
|
+
}
|
36
|
+
|
37
|
+
em {
|
38
|
+
font-style: italic;
|
39
|
+
color: navy;
|
40
|
+
}
|
41
|
+
|
42
|
+
strong {
|
43
|
+
font-weight: bold;
|
44
|
+
color: #083194;
|
45
|
+
}
|
46
|
+
|
47
|
+
h1, h2, h3, h4, h5, h6 {
|
48
|
+
color: #527bbd;
|
49
|
+
margin-top: 1.2em;
|
50
|
+
margin-bottom: 0.5em;
|
51
|
+
line-height: 1.3;
|
52
|
+
}
|
53
|
+
|
54
|
+
h1, h2, h3 {
|
55
|
+
border-bottom: 2px solid silver;
|
56
|
+
}
|
57
|
+
h2 {
|
58
|
+
padding-top: 0.5em;
|
59
|
+
}
|
60
|
+
h3 {
|
61
|
+
float: left;
|
62
|
+
}
|
63
|
+
h3 + * {
|
64
|
+
clear: left;
|
65
|
+
}
|
66
|
+
h5 {
|
67
|
+
font-size: 1.0em;
|
68
|
+
}
|
69
|
+
|
70
|
+
div.sectionbody {
|
71
|
+
margin-left: 0;
|
72
|
+
}
|
73
|
+
|
74
|
+
hr {
|
75
|
+
border: 1px solid silver;
|
76
|
+
}
|
77
|
+
|
78
|
+
p {
|
79
|
+
margin-top: 0.5em;
|
80
|
+
margin-bottom: 0.5em;
|
81
|
+
}
|
82
|
+
|
83
|
+
ul, ol, li > p {
|
84
|
+
margin-top: 0;
|
85
|
+
}
|
86
|
+
ul > li { color: #aaa; }
|
87
|
+
ul > li > * { color: black; }
|
88
|
+
|
89
|
+
pre {
|
90
|
+
padding: 0;
|
91
|
+
margin: 0;
|
92
|
+
overflow: auto;
|
93
|
+
}
|
94
|
+
|
95
|
+
#author {
|
96
|
+
color: #527bbd;
|
97
|
+
font-weight: bold;
|
98
|
+
font-size: 1.1em;
|
99
|
+
}
|
100
|
+
#email {
|
101
|
+
}
|
102
|
+
#revnumber, #revdate, #revremark {
|
103
|
+
}
|
104
|
+
|
105
|
+
#footer {
|
106
|
+
font-size: small;
|
107
|
+
border-top: 2px solid silver;
|
108
|
+
padding-top: 0.5em;
|
109
|
+
margin-top: 4.0em;
|
110
|
+
}
|
111
|
+
#footer-text {
|
112
|
+
float: left;
|
113
|
+
padding-bottom: 0.5em;
|
114
|
+
}
|
115
|
+
#footer-badges {
|
116
|
+
float: right;
|
117
|
+
padding-bottom: 0.5em;
|
118
|
+
}
|
119
|
+
|
120
|
+
#preamble {
|
121
|
+
margin-top: 1.5em;
|
122
|
+
margin-bottom: 1.5em;
|
123
|
+
}
|
124
|
+
div.imageblock, div.exampleblock, div.verseblock,
|
125
|
+
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
|
126
|
+
div.admonitionblock {
|
127
|
+
margin-top: 1.0em;
|
128
|
+
margin-bottom: 1.5em;
|
129
|
+
}
|
130
|
+
div.admonitionblock {
|
131
|
+
margin-top: 2.0em;
|
132
|
+
margin-bottom: 2.0em;
|
133
|
+
margin-right: 10%;
|
134
|
+
color: #606060;
|
135
|
+
}
|
136
|
+
|
137
|
+
div.content { /* Block element content. */
|
138
|
+
padding: 0;
|
139
|
+
}
|
140
|
+
|
141
|
+
/* Block element titles. */
|
142
|
+
div.title, caption.title {
|
143
|
+
color: #527bbd;
|
144
|
+
font-weight: bold;
|
145
|
+
text-align: left;
|
146
|
+
margin-top: 1.0em;
|
147
|
+
margin-bottom: 0.5em;
|
148
|
+
}
|
149
|
+
div.title + * {
|
150
|
+
margin-top: 0;
|
151
|
+
}
|
152
|
+
|
153
|
+
td div.title:first-child {
|
154
|
+
margin-top: 0.0em;
|
155
|
+
}
|
156
|
+
div.content div.title:first-child {
|
157
|
+
margin-top: 0.0em;
|
158
|
+
}
|
159
|
+
div.content + div.title {
|
160
|
+
margin-top: 0.0em;
|
161
|
+
}
|
162
|
+
|
163
|
+
div.sidebarblock > div.content {
|
164
|
+
background: #ffffee;
|
165
|
+
border: 1px solid #dddddd;
|
166
|
+
border-left: 4px solid #f0f0f0;
|
167
|
+
padding: 0.5em;
|
168
|
+
}
|
169
|
+
|
170
|
+
div.listingblock > div.content {
|
171
|
+
border: 1px solid #dddddd;
|
172
|
+
border-left: 5px solid #f0f0f0;
|
173
|
+
background: #f8f8f8;
|
174
|
+
padding: 0.5em;
|
175
|
+
}
|
176
|
+
|
177
|
+
div.quoteblock, div.verseblock {
|
178
|
+
padding-left: 1.0em;
|
179
|
+
margin-left: 1.0em;
|
180
|
+
margin-right: 10%;
|
181
|
+
border-left: 5px solid #f0f0f0;
|
182
|
+
color: #777777;
|
183
|
+
}
|
184
|
+
|
185
|
+
div.quoteblock > div.attribution {
|
186
|
+
padding-top: 0.5em;
|
187
|
+
text-align: right;
|
188
|
+
}
|
189
|
+
|
190
|
+
div.verseblock > pre.content {
|
191
|
+
font-family: inherit;
|
192
|
+
font-size: inherit;
|
193
|
+
}
|
194
|
+
div.verseblock > div.attribution {
|
195
|
+
padding-top: 0.75em;
|
196
|
+
text-align: left;
|
197
|
+
}
|
198
|
+
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
|
199
|
+
div.verseblock + div.attribution {
|
200
|
+
text-align: left;
|
201
|
+
}
|
202
|
+
|
203
|
+
div.admonitionblock .icon {
|
204
|
+
vertical-align: top;
|
205
|
+
font-size: 1.1em;
|
206
|
+
font-weight: bold;
|
207
|
+
text-decoration: underline;
|
208
|
+
color: #527bbd;
|
209
|
+
padding-right: 0.5em;
|
210
|
+
}
|
211
|
+
div.admonitionblock td.content {
|
212
|
+
padding-left: 0.5em;
|
213
|
+
border-left: 3px solid #dddddd;
|
214
|
+
}
|
215
|
+
|
216
|
+
div.exampleblock > div.content {
|
217
|
+
border-left: 3px solid #dddddd;
|
218
|
+
padding-left: 0.5em;
|
219
|
+
}
|
220
|
+
|
221
|
+
div.imageblock div.content { padding-left: 0; }
|
222
|
+
span.image img { border-style: none; }
|
223
|
+
a.image:visited { color: white; }
|
224
|
+
|
225
|
+
dl {
|
226
|
+
margin-top: 0.8em;
|
227
|
+
margin-bottom: 0.8em;
|
228
|
+
}
|
229
|
+
dt {
|
230
|
+
margin-top: 0.5em;
|
231
|
+
margin-bottom: 0;
|
232
|
+
font-style: normal;
|
233
|
+
color: navy;
|
234
|
+
}
|
235
|
+
dd > *:first-child {
|
236
|
+
margin-top: 0.1em;
|
237
|
+
}
|
238
|
+
|
239
|
+
ul, ol {
|
240
|
+
list-style-position: outside;
|
241
|
+
}
|
242
|
+
ol.arabic {
|
243
|
+
list-style-type: decimal;
|
244
|
+
}
|
245
|
+
ol.loweralpha {
|
246
|
+
list-style-type: lower-alpha;
|
247
|
+
}
|
248
|
+
ol.upperalpha {
|
249
|
+
list-style-type: upper-alpha;
|
250
|
+
}
|
251
|
+
ol.lowerroman {
|
252
|
+
list-style-type: lower-roman;
|
253
|
+
}
|
254
|
+
ol.upperroman {
|
255
|
+
list-style-type: upper-roman;
|
256
|
+
}
|
257
|
+
|
258
|
+
div.compact ul, div.compact ol,
|
259
|
+
div.compact p, div.compact p,
|
260
|
+
div.compact div, div.compact div {
|
261
|
+
margin-top: 0.1em;
|
262
|
+
margin-bottom: 0.1em;
|
263
|
+
}
|
264
|
+
|
265
|
+
tfoot {
|
266
|
+
font-weight: bold;
|
267
|
+
}
|
268
|
+
td > div.verse {
|
269
|
+
white-space: pre;
|
270
|
+
}
|
271
|
+
|
272
|
+
div.hdlist {
|
273
|
+
margin-top: 0.8em;
|
274
|
+
margin-bottom: 0.8em;
|
275
|
+
}
|
276
|
+
div.hdlist tr {
|
277
|
+
padding-bottom: 15px;
|
278
|
+
}
|
279
|
+
dt.hdlist1.strong, td.hdlist1.strong {
|
280
|
+
font-weight: bold;
|
281
|
+
}
|
282
|
+
td.hdlist1 {
|
283
|
+
vertical-align: top;
|
284
|
+
font-style: normal;
|
285
|
+
padding-right: 0.8em;
|
286
|
+
color: navy;
|
287
|
+
}
|
288
|
+
td.hdlist2 {
|
289
|
+
vertical-align: top;
|
290
|
+
}
|
291
|
+
div.hdlist.compact tr {
|
292
|
+
margin: 0;
|
293
|
+
padding-bottom: 0;
|
294
|
+
}
|
295
|
+
|
296
|
+
.comment {
|
297
|
+
background: yellow;
|
298
|
+
}
|
299
|
+
|
300
|
+
.footnote, .footnoteref {
|
301
|
+
font-size: 0.8em;
|
302
|
+
}
|
303
|
+
|
304
|
+
span.footnote, span.footnoteref {
|
305
|
+
vertical-align: super;
|
306
|
+
}
|
307
|
+
|
308
|
+
#footnotes {
|
309
|
+
margin: 20px 0 20px 0;
|
310
|
+
padding: 7px 0 0 0;
|
311
|
+
}
|
312
|
+
|
313
|
+
#footnotes div.footnote {
|
314
|
+
margin: 0 0 5px 0;
|
315
|
+
}
|
316
|
+
|
317
|
+
#footnotes hr {
|
318
|
+
border: none;
|
319
|
+
border-top: 1px solid silver;
|
320
|
+
height: 1px;
|
321
|
+
text-align: left;
|
322
|
+
margin-left: 0;
|
323
|
+
width: 20%;
|
324
|
+
min-width: 100px;
|
325
|
+
}
|
326
|
+
|
327
|
+
div.colist td {
|
328
|
+
padding-right: 0.5em;
|
329
|
+
padding-bottom: 0.3em;
|
330
|
+
vertical-align: top;
|
331
|
+
}
|
332
|
+
div.colist td img {
|
333
|
+
margin-top: 0.3em;
|
334
|
+
}
|
335
|
+
|
336
|
+
@media print {
|
337
|
+
#footer-badges { display: none; }
|
338
|
+
}
|
339
|
+
|
340
|
+
#toc {
|
341
|
+
margin-bottom: 2.5em;
|
342
|
+
}
|
343
|
+
|
344
|
+
#toctitle {
|
345
|
+
color: #527bbd;
|
346
|
+
font-size: 1.1em;
|
347
|
+
font-weight: bold;
|
348
|
+
margin-top: 1.0em;
|
349
|
+
margin-bottom: 0.1em;
|
350
|
+
}
|
351
|
+
|
352
|
+
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
|
353
|
+
margin-top: 0;
|
354
|
+
margin-bottom: 0;
|
355
|
+
}
|
356
|
+
div.toclevel2 {
|
357
|
+
margin-left: 2em;
|
358
|
+
font-size: 0.9em;
|
359
|
+
}
|
360
|
+
div.toclevel3 {
|
361
|
+
margin-left: 4em;
|
362
|
+
font-size: 0.9em;
|
363
|
+
}
|
364
|
+
div.toclevel4 {
|
365
|
+
margin-left: 6em;
|
366
|
+
font-size: 0.9em;
|
367
|
+
}
|
368
|
+
|
369
|
+
span.aqua { color: aqua; }
|
370
|
+
span.black { color: black; }
|
371
|
+
span.blue { color: blue; }
|
372
|
+
span.fuchsia { color: fuchsia; }
|
373
|
+
span.gray { color: gray; }
|
374
|
+
span.green { color: green; }
|
375
|
+
span.lime { color: lime; }
|
376
|
+
span.maroon { color: maroon; }
|
377
|
+
span.navy { color: navy; }
|
378
|
+
span.olive { color: olive; }
|
379
|
+
span.purple { color: purple; }
|
380
|
+
span.red { color: red; }
|
381
|
+
span.silver { color: silver; }
|
382
|
+
span.teal { color: teal; }
|
383
|
+
span.white { color: white; }
|
384
|
+
span.yellow { color: yellow; }
|
385
|
+
|
386
|
+
span.aqua-background { background: aqua; }
|
387
|
+
span.black-background { background: black; }
|
388
|
+
span.blue-background { background: blue; }
|
389
|
+
span.fuchsia-background { background: fuchsia; }
|
390
|
+
span.gray-background { background: gray; }
|
391
|
+
span.green-background { background: green; }
|
392
|
+
span.lime-background { background: lime; }
|
393
|
+
span.maroon-background { background: maroon; }
|
394
|
+
span.navy-background { background: navy; }
|
395
|
+
span.olive-background { background: olive; }
|
396
|
+
span.purple-background { background: purple; }
|
397
|
+
span.red-background { background: red; }
|
398
|
+
span.silver-background { background: silver; }
|
399
|
+
span.teal-background { background: teal; }
|
400
|
+
span.white-background { background: white; }
|
401
|
+
span.yellow-background { background: yellow; }
|
402
|
+
|
403
|
+
span.big { font-size: 2em; }
|
404
|
+
span.small { font-size: 0.6em; }
|
405
|
+
|
406
|
+
span.underline { text-decoration: underline; }
|
407
|
+
span.overline { text-decoration: overline; }
|
408
|
+
span.line-through { text-decoration: line-through; }
|
409
|
+
|
410
|
+
|
411
|
+
/*
|
412
|
+
* xhtml11 specific
|
413
|
+
*
|
414
|
+
* */
|
415
|
+
|
416
|
+
tt {
|
417
|
+
font-family: monospace;
|
418
|
+
font-size: inherit;
|
419
|
+
color: navy;
|
420
|
+
}
|
421
|
+
|
422
|
+
div.tableblock {
|
423
|
+
margin-top: 1.0em;
|
424
|
+
margin-bottom: 1.5em;
|
425
|
+
}
|
426
|
+
div.tableblock > table {
|
427
|
+
border: 3px solid #527bbd;
|
428
|
+
}
|
429
|
+
thead, p.table.header {
|
430
|
+
font-weight: bold;
|
431
|
+
color: #527bbd;
|
432
|
+
}
|
433
|
+
p.table {
|
434
|
+
margin-top: 0;
|
435
|
+
}
|
436
|
+
/* Because the table frame attribute is overriden by CSS in most browsers. */
|
437
|
+
div.tableblock > table[frame="void"] {
|
438
|
+
border-style: none;
|
439
|
+
}
|
440
|
+
div.tableblock > table[frame="hsides"] {
|
441
|
+
border-left-style: none;
|
442
|
+
border-right-style: none;
|
443
|
+
}
|
444
|
+
div.tableblock > table[frame="vsides"] {
|
445
|
+
border-top-style: none;
|
446
|
+
border-bottom-style: none;
|
447
|
+
}
|
448
|
+
|
449
|
+
|
450
|
+
/*
|
451
|
+
* html5 specific
|
452
|
+
*
|
453
|
+
* */
|
454
|
+
|
455
|
+
.monospaced {
|
456
|
+
font-family: monospace;
|
457
|
+
font-size: inherit;
|
458
|
+
color: navy;
|
459
|
+
}
|
460
|
+
|
461
|
+
table.tableblock {
|
462
|
+
margin-top: 1.0em;
|
463
|
+
margin-bottom: 1.5em;
|
464
|
+
}
|
465
|
+
thead, p.tableblock.header {
|
466
|
+
font-weight: bold;
|
467
|
+
color: #527bbd;
|
468
|
+
}
|
469
|
+
p.tableblock {
|
470
|
+
margin-top: 0;
|
471
|
+
}
|
472
|
+
table.tableblock {
|
473
|
+
border-width: 3px;
|
474
|
+
border-spacing: 0px;
|
475
|
+
border-style: solid;
|
476
|
+
border-color: #527bbd;
|
477
|
+
border-collapse: collapse;
|
478
|
+
}
|
479
|
+
th.tableblock, td.tableblock {
|
480
|
+
border-width: 1px;
|
481
|
+
padding: 4px;
|
482
|
+
border-style: solid;
|
483
|
+
border-color: #527bbd;
|
484
|
+
}
|
485
|
+
|
486
|
+
table.tableblock.frame-topbot {
|
487
|
+
border-left-style: hidden;
|
488
|
+
border-right-style: hidden;
|
489
|
+
}
|
490
|
+
table.tableblock.frame-sides {
|
491
|
+
border-top-style: hidden;
|
492
|
+
border-bottom-style: hidden;
|
493
|
+
}
|
494
|
+
table.tableblock.frame-none {
|
495
|
+
border-style: hidden;
|
496
|
+
}
|
497
|
+
|
498
|
+
th.tableblock.halign-left, td.tableblock.halign-left {
|
499
|
+
text-align: left;
|
500
|
+
}
|
501
|
+
th.tableblock.halign-center, td.tableblock.halign-center {
|
502
|
+
text-align: center;
|
503
|
+
}
|
504
|
+
th.tableblock.halign-right, td.tableblock.halign-right {
|
505
|
+
text-align: right;
|
506
|
+
}
|
507
|
+
|
508
|
+
th.tableblock.valign-top, td.tableblock.valign-top {
|
509
|
+
vertical-align: top;
|
510
|
+
}
|
511
|
+
th.tableblock.valign-middle, td.tableblock.valign-middle {
|
512
|
+
vertical-align: middle;
|
513
|
+
}
|
514
|
+
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
|
515
|
+
vertical-align: bottom;
|
516
|
+
}
|
517
|
+
|
518
|
+
|
519
|
+
/*
|
520
|
+
* manpage specific
|
521
|
+
*
|
522
|
+
* */
|
523
|
+
|
524
|
+
body.manpage h1 {
|
525
|
+
padding-top: 0.5em;
|
526
|
+
padding-bottom: 0.5em;
|
527
|
+
border-top: 2px solid silver;
|
528
|
+
border-bottom: 2px solid silver;
|
529
|
+
}
|
530
|
+
body.manpage h2 {
|
531
|
+
border-style: none;
|
532
|
+
}
|
533
|
+
body.manpage div.sectionbody {
|
534
|
+
margin-left: 3em;
|
535
|
+
}
|
536
|
+
|
537
|
+
@media print {
|
538
|
+
body.manpage div#toc { display: none; }
|
539
|
+
}
|
540
|
+
|
541
|
+
|
542
|
+
/*
|
543
|
+
* Theme specific overrides of the preceding (asciidoc.css) CSS.
|
544
|
+
*
|
545
|
+
*/
|
546
|
+
body {
|
547
|
+
font-family: Garamond, Georgia, serif;
|
548
|
+
font-size: 17px;
|
549
|
+
color: #3E4349;
|
550
|
+
line-height: 1.3em;
|
551
|
+
}
|
552
|
+
h1, h2, h3, h4, h5, h6,
|
553
|
+
div.title, caption.title,
|
554
|
+
thead, p.table.header,
|
555
|
+
#toctitle,
|
556
|
+
#author, #revnumber, #revdate, #revremark,
|
557
|
+
#footer {
|
558
|
+
font-family: Garmond, Georgia, serif;
|
559
|
+
font-weight: normal;
|
560
|
+
border-bottom-width: 0;
|
561
|
+
color: #3E4349;
|
562
|
+
}
|
563
|
+
div.title, caption.title { color: #596673; font-weight: bold; }
|
564
|
+
h1 { font-size: 240%; }
|
565
|
+
h2 { font-size: 180%; }
|
566
|
+
h3 { font-size: 150%; }
|
567
|
+
h4 { font-size: 130%; }
|
568
|
+
h5 { font-size: 115%; }
|
569
|
+
h6 { font-size: 100%; }
|
570
|
+
#header h1 { margin-top: 0; }
|
571
|
+
#toc {
|
572
|
+
color: #444444;
|
573
|
+
line-height: 1.5;
|
574
|
+
padding-top: 1.5em;
|
575
|
+
}
|
576
|
+
#toctitle {
|
577
|
+
font-size: 20px;
|
578
|
+
}
|
579
|
+
#toc a {
|
580
|
+
border-bottom: 1px dotted #999999;
|
581
|
+
color: #444444 !important;
|
582
|
+
text-decoration: none !important;
|
583
|
+
}
|
584
|
+
#toc a:hover {
|
585
|
+
border-bottom: 1px solid #6D4100;
|
586
|
+
color: #6D4100 !important;
|
587
|
+
text-decoration: none !important;
|
588
|
+
}
|
589
|
+
div.toclevel1 { margin-top: 0.2em; font-size: 16px; }
|
590
|
+
div.toclevel2 { margin-top: 0.15em; font-size: 14px; }
|
591
|
+
em, dt, td.hdlist1 { color: black; }
|
592
|
+
strong { color: #3E4349; }
|
593
|
+
a { color: #004B6B; text-decoration: none; border-bottom: 1px dotted #004B6B; }
|
594
|
+
a:visited { color: #615FA0; border-bottom: 1px dotted #615FA0; }
|
595
|
+
a:hover { color: #6D4100; border-bottom: 1px solid #6D4100; }
|
596
|
+
div.tableblock > table, table.tableblock { border: 3px solid #E8E8E8; }
|
597
|
+
th.tableblock, td.tableblock { border: 1px solid #E8E8E8; }
|
598
|
+
ul > li > * { color: #3E4349; }
|
599
|
+
pre, tt, .monospaced { font-family: Consolas,Menlo,'Deja Vu Sans Mono','Bitstream Vera Sans Mono',monospace; }
|
600
|
+
tt, .monospaced { font-size: 0.9em; color: black;
|
601
|
+
}
|
602
|
+
div.exampleblock > div.content, div.sidebarblock > div.content, div.listingblock > div.content { border-width: 0 0 0 3px; border-color: #E8E8E8; }
|
603
|
+
div.verseblock { border-left-width: 0; margin-left: 3em; }
|
604
|
+
div.quoteblock { border-left-width: 3px; margin-left: 0; margin-right: 0;}
|
605
|
+
div.admonitionblock td.content { border-left: 3px solid #E8E8E8; }
|
606
|
+
</style>
|
607
|
+
<script type="text/javascript">
|
608
|
+
/*<![CDATA[*/
|
609
|
+
var asciidoc = { // Namespace.
|
610
|
+
|
611
|
+
/////////////////////////////////////////////////////////////////////
|
612
|
+
// Table Of Contents generator
|
613
|
+
/////////////////////////////////////////////////////////////////////
|
614
|
+
|
615
|
+
/* Author: Mihai Bazon, September 2002
|
616
|
+
* http://students.infoiasi.ro/~mishoo
|
617
|
+
*
|
618
|
+
* Table Of Content generator
|
619
|
+
* Version: 0.4
|
620
|
+
*
|
621
|
+
* Feel free to use this script under the terms of the GNU General Public
|
622
|
+
* License, as long as you do not remove or alter this notice.
|
623
|
+
*/
|
624
|
+
|
625
|
+
/* modified by Troy D. Hanson, September 2006. License: GPL */
|
626
|
+
/* modified by Stuart Rackham, 2006, 2009. License: GPL */
|
627
|
+
|
628
|
+
// toclevels = 1..4.
|
629
|
+
toc: function (toclevels) {
|
630
|
+
|
631
|
+
function getText(el) {
|
632
|
+
var text = "";
|
633
|
+
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
634
|
+
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
|
635
|
+
text += i.data;
|
636
|
+
else if (i.firstChild != null)
|
637
|
+
text += getText(i);
|
638
|
+
}
|
639
|
+
return text;
|
640
|
+
}
|
641
|
+
|
642
|
+
function TocEntry(el, text, toclevel) {
|
643
|
+
this.element = el;
|
644
|
+
this.text = text;
|
645
|
+
this.toclevel = toclevel;
|
646
|
+
}
|
647
|
+
|
648
|
+
function tocEntries(el, toclevels) {
|
649
|
+
var result = new Array;
|
650
|
+
var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
|
651
|
+
// Function that scans the DOM tree for header elements (the DOM2
|
652
|
+
// nodeIterator API would be a better technique but not supported by all
|
653
|
+
// browsers).
|
654
|
+
var iterate = function (el) {
|
655
|
+
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
656
|
+
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
|
657
|
+
var mo = re.exec(i.tagName);
|
658
|
+
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
|
659
|
+
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
|
660
|
+
}
|
661
|
+
iterate(i);
|
662
|
+
}
|
663
|
+
}
|
664
|
+
}
|
665
|
+
iterate(el);
|
666
|
+
return result;
|
667
|
+
}
|
668
|
+
|
669
|
+
var toc = document.getElementById("toc");
|
670
|
+
if (!toc) {
|
671
|
+
return;
|
672
|
+
}
|
673
|
+
|
674
|
+
// Delete existing TOC entries in case we're reloading the TOC.
|
675
|
+
var tocEntriesToRemove = [];
|
676
|
+
var i;
|
677
|
+
for (i = 0; i < toc.childNodes.length; i++) {
|
678
|
+
var entry = toc.childNodes[i];
|
679
|
+
if (entry.nodeName.toLowerCase() == 'div'
|
680
|
+
&& entry.getAttribute("class")
|
681
|
+
&& entry.getAttribute("class").match(/^toclevel/))
|
682
|
+
tocEntriesToRemove.push(entry);
|
683
|
+
}
|
684
|
+
for (i = 0; i < tocEntriesToRemove.length; i++) {
|
685
|
+
toc.removeChild(tocEntriesToRemove[i]);
|
686
|
+
}
|
687
|
+
|
688
|
+
// Rebuild TOC entries.
|
689
|
+
var entries = tocEntries(document.getElementById("content"), toclevels);
|
690
|
+
for (var i = 0; i < entries.length; ++i) {
|
691
|
+
var entry = entries[i];
|
692
|
+
if (entry.element.id == "")
|
693
|
+
entry.element.id = "_toc_" + i;
|
694
|
+
var a = document.createElement("a");
|
695
|
+
a.href = "#" + entry.element.id;
|
696
|
+
a.appendChild(document.createTextNode(entry.text));
|
697
|
+
var div = document.createElement("div");
|
698
|
+
div.appendChild(a);
|
699
|
+
div.className = "toclevel" + entry.toclevel;
|
700
|
+
toc.appendChild(div);
|
701
|
+
}
|
702
|
+
if (entries.length == 0)
|
703
|
+
toc.parentNode.removeChild(toc);
|
704
|
+
},
|
705
|
+
|
706
|
+
|
707
|
+
/////////////////////////////////////////////////////////////////////
|
708
|
+
// Footnotes generator
|
709
|
+
/////////////////////////////////////////////////////////////////////
|
710
|
+
|
711
|
+
/* Based on footnote generation code from:
|
712
|
+
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
|
713
|
+
*/
|
714
|
+
|
715
|
+
footnotes: function () {
|
716
|
+
// Delete existing footnote entries in case we're reloading the footnodes.
|
717
|
+
var i;
|
718
|
+
var noteholder = document.getElementById("footnotes");
|
719
|
+
if (!noteholder) {
|
720
|
+
return;
|
721
|
+
}
|
722
|
+
var entriesToRemove = [];
|
723
|
+
for (i = 0; i < noteholder.childNodes.length; i++) {
|
724
|
+
var entry = noteholder.childNodes[i];
|
725
|
+
if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
|
726
|
+
entriesToRemove.push(entry);
|
727
|
+
}
|
728
|
+
for (i = 0; i < entriesToRemove.length; i++) {
|
729
|
+
noteholder.removeChild(entriesToRemove[i]);
|
730
|
+
}
|
731
|
+
|
732
|
+
// Rebuild footnote entries.
|
733
|
+
var cont = document.getElementById("content");
|
734
|
+
var spans = cont.getElementsByTagName("span");
|
735
|
+
var refs = {};
|
736
|
+
var n = 0;
|
737
|
+
for (i=0; i<spans.length; i++) {
|
738
|
+
if (spans[i].className == "footnote") {
|
739
|
+
n++;
|
740
|
+
var note = spans[i].getAttribute("data-note");
|
741
|
+
if (!note) {
|
742
|
+
// Use [\s\S] in place of . so multi-line matches work.
|
743
|
+
// Because JavaScript has no s (dotall) regex flag.
|
744
|
+
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
|
745
|
+
spans[i].innerHTML =
|
746
|
+
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
|
747
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
748
|
+
spans[i].setAttribute("data-note", note);
|
749
|
+
}
|
750
|
+
noteholder.innerHTML +=
|
751
|
+
"<div class='footnote' id='_footnote_" + n + "'>" +
|
752
|
+
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
|
753
|
+
n + "</a>. " + note + "</div>";
|
754
|
+
var id =spans[i].getAttribute("id");
|
755
|
+
if (id != null) refs["#"+id] = n;
|
756
|
+
}
|
757
|
+
}
|
758
|
+
if (n == 0)
|
759
|
+
noteholder.parentNode.removeChild(noteholder);
|
760
|
+
else {
|
761
|
+
// Process footnoterefs.
|
762
|
+
for (i=0; i<spans.length; i++) {
|
763
|
+
if (spans[i].className == "footnoteref") {
|
764
|
+
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
|
765
|
+
href = href.match(/#.*/)[0]; // Because IE return full URL.
|
766
|
+
n = refs[href];
|
767
|
+
spans[i].innerHTML =
|
768
|
+
"[<a href='#_footnote_" + n +
|
769
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
770
|
+
}
|
771
|
+
}
|
772
|
+
}
|
773
|
+
},
|
774
|
+
|
775
|
+
install: function(toclevels) {
|
776
|
+
var timerId;
|
777
|
+
|
778
|
+
function reinstall() {
|
779
|
+
asciidoc.footnotes();
|
780
|
+
if (toclevels) {
|
781
|
+
asciidoc.toc(toclevels);
|
782
|
+
}
|
783
|
+
}
|
784
|
+
|
785
|
+
function reinstallAndRemoveTimer() {
|
786
|
+
clearInterval(timerId);
|
787
|
+
reinstall();
|
788
|
+
}
|
789
|
+
|
790
|
+
timerId = setInterval(reinstall, 500);
|
791
|
+
if (document.addEventListener)
|
792
|
+
document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
|
793
|
+
else
|
794
|
+
window.onload = reinstallAndRemoveTimer;
|
795
|
+
}
|
796
|
+
|
797
|
+
}
|
798
|
+
asciidoc.install();
|
799
|
+
/*]]>*/
|
800
|
+
</script>
|
801
|
+
<style type="text/css">
|
802
|
+
body {
|
803
|
+
margin: 1em auto 1em auto;
|
804
|
+
padding: 0 1em 0 1em;
|
805
|
+
max-width: 800px;
|
806
|
+
}
|
807
|
+
|
808
|
+
a.image {
|
809
|
+
border: none;
|
810
|
+
}
|
811
|
+
|
812
|
+
.comments {
|
813
|
+
display: block;
|
814
|
+
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAB0wAAAdMBc2+PegAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAASjSURBVFiFvZdPaBxVHMc/b/7sbNLdxG13s0sbE1jBxELVbVGEgqmQiiBiDxZqKRWhR0Fqe/BSmoNQSNmrt4ISTyV3byWLHorVU5dYtgVpk4DGhXZ1a7rZmXkeMm99eZn9k1b9wY/3Z2f2fX7f3++9mRFSSnQTQgjAAkTkaO2zmtRaCYTSABBqrIEkS6VS9vTp069lMpmClFL4vt8BCsNwWwsQBAHm7+Y4CAKEEEGtVvtlYWHhbqvVagJ/AE90MCGlVDD2xYsXiydPnvza87wXksnk8NDQUFIPQPW7zfXyMAwJw5BGo/FXs9ncvHfv3tKFCxe+aLfbDyKwQEopFZBdLpdfnp2d/Tafz4+5rhsxghAC1d+h/y5gzH69XvdrtdqDs2fPfuT7/jLQkFIGlhBC5HK5oZmZmW8KhUI+kUgIy7KwLAvbtrFte1vfdHVtnKtg9L7yffv2OcViceLSpUufA88DSSGEcABrfn7+zdHR0UnXdWNv1tXqpY6phGVZnRoy/0MIQT6fdw4ePHgUKAK/AU8sQOzfv/+tdDq9x4xKd1MVU51uSvTzVCrlTU9PTwN7AGEBYmRk5FXXdTvk+gI6kJnGQQG6KQQwMjLiTk1NTQIJBQTgmAWst2rhfiBxC3ab00wAbtRugZjb2LzR3O7d2rh7+s2Ztg1IwajChK2DTSlggpuFrHs34H7BOHELqN0Rl5K4P+4GNQioPt8BUqeoqpd+MGYQvQ7DfrCxKVNAcTCws0B7RdrvhO4HtS1lCkYtbKrT7WB8GihdQf2B3FFIPbEH2cY6iAljjk1l4qB2KKSrMwjMblXqpVpfIF2lXjBxULsB06HigDb1lA2ijgm0WyithmS73faJ3iYdgHq9/tOBAwfe9jyvJ4wam1H1O196QT18+HBzeXl5FQgVkLxz5873k5OTzWw2m+oHE6dMHEw3EGBbuh4/fuyvrKysAS1AOkA4Nzf3w5EjR+6m0+mS/tTvBhMH1U2lXgqtra21l5aWvgNWgCYQ2tH/hY1G48epqal3Pc/b4ziOGLQegiCIPVv0ubhDcXV1dfP27dv3y+Xyl0AVqAO+/pKfmpiYeHFubm4+m82+kkgkPNd1nbjI9TaZTNqu61rRQpbrujiOs+O6MAx59OhRuL6+3mq1Wq1KpXJjYWFhMYK5DzSljF7yo7RYwBCQBfKlUml6bGxsMggCLwgC/Ruts4CRPpFMJodnZmbeKBaLLxUKheFMJmPr6a5Wq0+uXLmyWK1WK8DPwBrwO7AhpQxB+y6LoARbhe4Bw0AyGlv0N/Vd56VSqb3nzp378PDhw+/ncrnnCoWCZ1kWvu9z69at9fPnz3+6sbFxE/gVaEkNYhuQBqUvsBtTSnrAKDB25syZ944dO/ZxNpvNjY+PDzebTb9Sqdy8fPnyZ0AN+FOpEwv0rKYFZEdgaSB7/PjxoydOnPgkl8tNAN7169fLi4uLX7G1w/5RadDnz9N4pJbNVupzwHSpVPrg6tWrN65du/broUOHZoEMYHXu+S+BYsA8YC9QHB8ff/3UqVPvREC2uvZfT1kvi9KpNo7LVo1uApsqZf8rkAHWMX2X/Q1tcUY1hl3QyQAAAABJRU5ErkJggg==') top left no-repeat;
|
815
|
+
float: left;
|
816
|
+
margin-left: -55px;
|
817
|
+
width: 36px;
|
818
|
+
height: 48px;
|
819
|
+
line-height: 0;
|
820
|
+
color: black;
|
821
|
+
text-decoration: none !important;
|
822
|
+
border: none !important;
|
823
|
+
}
|
824
|
+
|
825
|
+
#toc .comments {
|
826
|
+
margin-top: 0.25em;
|
827
|
+
}
|
828
|
+
|
829
|
+
.sect1 .comments {
|
830
|
+
margin-top: 0.5em;
|
831
|
+
}
|
832
|
+
|
833
|
+
.sect2 .comments {
|
834
|
+
margin-top: 1.15em;
|
835
|
+
}
|
836
|
+
|
837
|
+
.sect3 .comments {
|
838
|
+
margin-top: -1em;
|
839
|
+
}
|
840
|
+
|
841
|
+
.comments.empty {
|
842
|
+
opacity: 0.2;
|
843
|
+
}
|
844
|
+
|
845
|
+
.comments.empty:hover,
|
846
|
+
.comments.nonempty {
|
847
|
+
opacity: 1;
|
848
|
+
}
|
849
|
+
|
850
|
+
.comments .count {
|
851
|
+
display: block;
|
852
|
+
font-size: 80%;
|
853
|
+
padding-top: 12px;
|
854
|
+
text-align: center;
|
855
|
+
text-shadow: 1px 1px 2px white;
|
856
|
+
}
|
857
|
+
|
858
|
+
#comments_lightbox_shadow {
|
859
|
+
position: fixed;
|
860
|
+
top: 0;
|
861
|
+
left: 0;
|
862
|
+
right: 0;
|
863
|
+
bottom: 0;
|
864
|
+
background: black;
|
865
|
+
opacity: 0.7;
|
866
|
+
z-index: 10;
|
867
|
+
}
|
868
|
+
|
869
|
+
#comments_lightbox_contents {
|
870
|
+
position: fixed;
|
871
|
+
top: 10%;
|
872
|
+
left: 20%;
|
873
|
+
right: 20%;
|
874
|
+
bottom: 10%;
|
875
|
+
background: white;
|
876
|
+
overflow: auto;
|
877
|
+
z-index: 11;
|
878
|
+
}
|
879
|
+
|
880
|
+
#comments_lightbox_contents > .shell {
|
881
|
+
margin: 2em;
|
882
|
+
}
|
883
|
+
|
884
|
+
pre {
|
885
|
+
overflow: auto;
|
886
|
+
}
|
887
|
+
|
888
|
+
@media print {
|
889
|
+
body {
|
890
|
+
font-size: 18pt;
|
891
|
+
}
|
892
|
+
|
893
|
+
#header h1 {
|
894
|
+
page-break-after: always;
|
895
|
+
font-size: 500%;
|
896
|
+
vertical-align: middle;
|
897
|
+
}
|
898
|
+
|
899
|
+
#header {
|
900
|
+
page-break-after: always;
|
901
|
+
}
|
902
|
+
|
903
|
+
#toctitle {
|
904
|
+
font-size: 200%;
|
905
|
+
margin-bottom: 1em;
|
906
|
+
}
|
907
|
+
|
908
|
+
div.toclevel1 {
|
909
|
+
font-size: 100%;
|
910
|
+
}
|
911
|
+
|
912
|
+
div.toclevel2 {
|
913
|
+
font-size: 90%;
|
914
|
+
}
|
915
|
+
|
916
|
+
div.toclevel3 {
|
917
|
+
font-size: 80%;
|
918
|
+
}
|
919
|
+
|
920
|
+
#content .comments {
|
921
|
+
display: none;
|
922
|
+
}
|
923
|
+
|
924
|
+
@page :left {
|
925
|
+
@bottom-left {
|
926
|
+
content: counter(page);
|
927
|
+
}
|
928
|
+
}
|
929
|
+
}
|
930
|
+
|
931
|
+
#topbar {
|
932
|
+
position: fixed;
|
933
|
+
left: 0;
|
934
|
+
top: 0;
|
935
|
+
right: 0;
|
936
|
+
height: 2.5em;
|
937
|
+
padding-left: 10%;
|
938
|
+
padding-right: 10%;
|
939
|
+
z-index: 1;
|
940
|
+
background: #880000;
|
941
|
+
overflow: hidden;
|
942
|
+
white-space: nowrap;
|
943
|
+
box-shadow: 0px 3px 6px #555555;
|
944
|
+
-moz-box-shadow: 0px 3px 6px #555555;
|
945
|
+
-webkit-box-shadow: 0px 3px 6px #555555;
|
946
|
+
-o-box-shadow: 0px 3px 6px #555555;
|
947
|
+
}
|
948
|
+
|
949
|
+
#topbar .title {
|
950
|
+
display: inline-block;
|
951
|
+
margin: 0.6em 1em 0 0;
|
952
|
+
vertical-align: top;
|
953
|
+
}
|
954
|
+
|
955
|
+
#topbar .title img {
|
956
|
+
display: none;
|
957
|
+
margin-right: 6px;
|
958
|
+
vertical-align: middle;
|
959
|
+
}
|
960
|
+
|
961
|
+
#topbar .title a {
|
962
|
+
color: #fffafa;
|
963
|
+
border: 0;
|
964
|
+
}
|
965
|
+
|
966
|
+
#topbar .title:hover img,
|
967
|
+
.mobile #topbar .title img {
|
968
|
+
display: inline-block;
|
969
|
+
margin-left: -17px;
|
970
|
+
}
|
971
|
+
|
972
|
+
#topbar .title:hover a,
|
973
|
+
.mobile #topbar .title a {
|
974
|
+
color: #ffffdd;
|
975
|
+
}
|
976
|
+
|
977
|
+
#floattoc {
|
978
|
+
position: fixed;
|
979
|
+
z-index: 1;
|
980
|
+
top: 2em;
|
981
|
+
bottom: 20%;
|
982
|
+
width: 50%;
|
983
|
+
background: #f0f0f0;
|
984
|
+
color: black;
|
985
|
+
box-shadow: 0px 6px 6px #555555;
|
986
|
+
-moz-box-shadow: 0px 6px 6px #555555;
|
987
|
+
-webkit-box-shadow: 0px 6px 6px #555555;
|
988
|
+
-o-box-shadow: 0px 6px 6px #555555;
|
989
|
+
overflow: auto;
|
990
|
+
padding: 1em;
|
991
|
+
border-radius: 6px;
|
992
|
+
-webkit-border-radius: 8px;
|
993
|
+
-webkit-border-top-left-radius: 0;
|
994
|
+
-webkit-border-top-right-radius: 0;
|
995
|
+
-moz-border-radius: 8px;
|
996
|
+
-moz-border-radius-topleft: 0;
|
997
|
+
-moz-border-top-right-radius: 0;
|
998
|
+
-o-border-radius: 8px;
|
999
|
+
-o-border-radius-topleft: 0;
|
1000
|
+
-o-border-top-right-radius: 0;
|
1001
|
+
border-radius: 8px;
|
1002
|
+
border-top-left-radius: 0;
|
1003
|
+
border-top-right-radius: 0;
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
#floattoc a.current {
|
1007
|
+
font-weight: bold;
|
1008
|
+
color: black;
|
1009
|
+
}
|
1010
|
+
|
1011
|
+
#current_section {
|
1012
|
+
display: inline-block;
|
1013
|
+
margin: 0.5em 0 0 0;
|
1014
|
+
padding: 0.2em 0.5em 0.2em 0.5em;
|
1015
|
+
background: #550000;
|
1016
|
+
font-size: 90%;
|
1017
|
+
vertical-align: top;
|
1018
|
+
color: white;
|
1019
|
+
border: none;
|
1020
|
+
-webkit-border-radius: 8px;
|
1021
|
+
-moz-border-radius: 8px;
|
1022
|
+
-o-border-radius: 8px;
|
1023
|
+
border-radius: 8px;
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
#current_section:hover {
|
1027
|
+
text-decoration: none;
|
1028
|
+
border: none;
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
#current_section.pressed {
|
1032
|
+
background: #f0f0f0;
|
1033
|
+
color: black;
|
1034
|
+
-webkit-border-top-left-radius: 8px;
|
1035
|
+
-webkit-border-top-right-radius: 8px;
|
1036
|
+
-webkit-border-bottom-left-radius: 0;
|
1037
|
+
-webkit-border-bottom-right-radius: 0;
|
1038
|
+
-moz-border-radius-topleft: 8px;
|
1039
|
+
-moz-border-radius-topright: 8px;
|
1040
|
+
-moz-border-bottom-left-radius: 0;
|
1041
|
+
-moz-border-bottom-right-radius: 0;
|
1042
|
+
border-top-left-radius: 8px;
|
1043
|
+
border-top-right-radius: 8px;
|
1044
|
+
border-bottom-left-radius: 0;
|
1045
|
+
border-bottom-right-radius: 0;
|
1046
|
+
}
|
1047
|
+
|
1048
|
+
/* http://nicolasgallagher.com/jump-links-and-viewport-positioning/ */
|
1049
|
+
.anchor_helper {
|
1050
|
+
position: relative;
|
1051
|
+
display: block;
|
1052
|
+
top: -50px;
|
1053
|
+
width: 1px;
|
1054
|
+
height: 1px;
|
1055
|
+
}
|
1056
|
+
|
1057
|
+
</style>
|
1058
|
+
</head>
|
1059
|
+
<body class="article">
|
1060
|
+
<div id="topbar" style="display: none">
|
1061
|
+
<div class="title">
|
1062
|
+
<!-- Don't put a space between the img and a. That will break the hover layout. -->
|
1063
|
+
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAKCAYAAAEV95QVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sGCRMSACDxkZwAAAAidEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVAgb24gYSBNYWOHqHdDAAAAZUlEQVQY032PSxbAIAjEIlfygL6ePF3UUvpzNjgSYWwqAMEhUQnANnsC7TQPeJpsVWzMuh2sog4vDTUbqP081zECrW4dtdaQGSIKlWluPyjK+VXxAz5XfcKufCzA130AfQHWB30HZxlPaP080xsAAAAASUVORK5CYII=" width="11" height="10" alt=""><a href="javascript:void(Mizuho.smoothlyScrollToToc())">Phusion Passenger Standalone users guide</a>
|
1064
|
+
</div>
|
1065
|
+
<a href="javascript:void(0)" id="current_section"></a>
|
1066
|
+
</div>
|
1067
|
+
<div id="header">
|
1068
|
+
<h1>Phusion Passenger Standalone users guide</h1>
|
1069
|
+
<div id="preamble">
|
1070
|
+
<div class="sectionbody">
|
1071
|
+
<div class="paragraph"><p><span class="image">
|
1072
|
+
<a class="image" href="http://www.phusion.nl/">
|
1073
|
+
<img src="images/phusion_banner.png" alt="images/phusion_banner.png">
|
1074
|
+
</a>
|
1075
|
+
</span></p></div>
|
1076
|
+
<div class="paragraph"><p><a href="https://www.phusionpassenger.com/">Phusion Passenger</a> is a web server and application server, designed to be fast, robust and lightweight. It runs your web apps with the least amount of hassle by taking care of almost all administrative heavy lifting for you. Advanced administration tools allow you to gain deep insight into your web applications' operations and to keep your servers healthy. Phusion Passenger is polyglot by design, and currently supports Ruby (Rack), Python (WSGI) and Node.js.</p></div>
|
1077
|
+
<div class="paragraph"><p>In the Standalone mode, Phusion Passenger operates as a fully-featured, secure standalone HTTP server. You do not need to have an existing web server like Apache or Nginx. This mode is ideal…</p></div>
|
1078
|
+
<div class="ulist"><ul>
|
1079
|
+
<li>
|
1080
|
+
<p>
|
1081
|
+
…if you are not familiar with Apache or Nginx
|
1082
|
+
</p>
|
1083
|
+
</li>
|
1084
|
+
<li>
|
1085
|
+
<p>
|
1086
|
+
…when you want to quickly start up a server without editing configuration files (e.g. during development)
|
1087
|
+
</p>
|
1088
|
+
</li>
|
1089
|
+
<li>
|
1090
|
+
<p>
|
1091
|
+
…or when you want to decouple the web server from the application server, by setting up reverse proxies.
|
1092
|
+
</p>
|
1093
|
+
</li>
|
1094
|
+
</ul></div>
|
1095
|
+
</div>
|
1096
|
+
</div>
|
1097
|
+
<div id="toc">
|
1098
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><div id="toctitle">Table of Contents</div>
|
1099
|
+
<div class="foo toclevel2"><a href="#_support_information">1. Support information</a></div>
|
1100
|
+
<div class="foo toclevel3"><a href="#_supported_operating_systems_and_languages">1.1. Supported operating systems and languages</a></div>
|
1101
|
+
<div class="foo toclevel3"><a href="#where_to_get_support">1.2. Where to get support</a></div>
|
1102
|
+
<div class="foo toclevel2"><a href="#installation">2. Installation</a></div>
|
1103
|
+
<div class="foo toclevel3"><a href="#_synopsis">2.1. Synopsis</a></div>
|
1104
|
+
<div class="foo toclevel3"><a href="#install_osx_homebrew">2.2. Installing or upgrading on Mac OS X with Homebrew</a></div>
|
1105
|
+
<div class="foo toclevel3"><a href="#install_on_debian_ubuntu">2.3. Installing or upgrading on Debian or Ubuntu</a></div>
|
1106
|
+
<div class="foo toclevel4"><a href="#install_add_apt_repo">2.3.1. Adding our APT repository</a></div>
|
1107
|
+
<div class="foo toclevel4"><a href="#_installing_packages">2.3.2. Installing packages</a></div>
|
1108
|
+
<div class="foo toclevel3"><a href="#_installing_or_upgrading_on_red_hat_fedora_centos_or_scientificlinux">2.4. Installing or upgrading on Red Hat, Fedora, CentOS or ScientificLinux</a></div>
|
1109
|
+
<div class="foo toclevel3"><a href="#rubygems_generic_install">2.5. Generic installation, upgrade and downgrade method: via RubyGems</a></div>
|
1110
|
+
<div class="foo toclevel3"><a href="#tarball_generic_install">2.6. Generic installation, upgrade and downgrade method: via tarball</a></div>
|
1111
|
+
<div class="foo toclevel3"><a href="#_upgrading_from_open_source_to_enterprise">2.7. Upgrading from open source to Enterprise</a></div>
|
1112
|
+
<div class="foo toclevel3"><a href="#_cryptographic_verification_of_installation_files">2.8. Cryptographic verification of installation files</a></div>
|
1113
|
+
<div class="foo toclevel4"><a href="#_synopsis_2">2.8.1. Synopsis</a></div>
|
1114
|
+
<div class="foo toclevel4"><a href="#_importing_the_phusion_software_signing_key">2.8.2. Importing the Phusion Software Signing key</a></div>
|
1115
|
+
<div class="foo toclevel4"><a href="#_verifying_the_phusion_software_signing_key">2.8.3. Verifying the Phusion Software Signing key</a></div>
|
1116
|
+
<div class="foo toclevel4"><a href="#_verifying_the_gem_and_tarball">2.8.4. Verifying the gem and tarball</a></div>
|
1117
|
+
<div class="foo toclevel4"><a href="#_verifying_git_signatures">2.8.5. Verifying Git signatures</a></div>
|
1118
|
+
<div class="foo toclevel4"><a href="#_verifying_deb_and_rpm_packages">2.8.6. Verifying DEB and RPM packages</a></div>
|
1119
|
+
<div class="foo toclevel4"><a href="#_revocation">2.8.7. Revocation</a></div>
|
1120
|
+
<div class="foo toclevel3"><a href="#_customizing_the_compilation_process">2.9. Customizing the compilation process</a></div>
|
1121
|
+
<div class="foo toclevel4"><a href="#_setting_the_compiler">2.9.1. Setting the compiler</a></div>
|
1122
|
+
<div class="foo toclevel4"><a href="#_adding_additional_compiler_or_linker_flags">2.9.2. Adding additional compiler or linker flags</a></div>
|
1123
|
+
<div class="foo toclevel4"><a href="#forcing_location_of_command_line_tools_and_dependencies">2.9.3. Forcing location of command line tools and dependencies</a></div>
|
1124
|
+
<div class="foo toclevel3"><a href="#uninstalling">2.10. Uninstalling</a></div>
|
1125
|
+
<div class="foo toclevel3"><a href="#moving_phusion_passenger">2.11. Moving to a different directory</a></div>
|
1126
|
+
<div class="foo toclevel2"><a href="#_usage">3. Usage</a></div>
|
1127
|
+
<div class="foo toclevel2"><a href="#_configuration">4. Configuration</a></div>
|
1128
|
+
<div class="foo toclevel3"><a href="#_command_line_options">4.1. Command line options</a></div>
|
1129
|
+
<div class="foo toclevel3"><a href="#config_file">4.2. Configuration file</a></div>
|
1130
|
+
<div class="foo toclevel3"><a href="#advanced_configuration">4.3. Advanced configuration</a></div>
|
1131
|
+
<div class="foo toclevel2"><a href="#_using_passenger_standalone_in_production">5. Using Passenger Standalone in production</a></div>
|
1132
|
+
<div class="foo toclevel3"><a href="#starting_at_system_boot">5.1. Starting Passenger Standalone at system boot</a></div>
|
1133
|
+
<div class="foo toclevel3"><a href="#sharing_port">5.2. Sharing the same port between multiple Passenger Standalone instances</a></div>
|
1134
|
+
<div class="foo toclevel3"><a href="#_installing_passenger_standalone_behind_nginx">5.3. Installing Passenger Standalone behind Nginx</a></div>
|
1135
|
+
<div class="foo toclevel2"><a href="#mass_deployment">6. Mass deployment</a></div>
|
1136
|
+
<div class="foo toclevel2"><a href="#troubleshooting">7. Troubleshooting</a></div>
|
1137
|
+
<div class="foo toclevel3"><a href="#_generic_troubleshooting_tips">7.1. Generic troubleshooting tips</a></div>
|
1138
|
+
<div class="foo toclevel3"><a href="#_upon_uploading_a_file_phusion_passenger_reports_client_body_temp_00000000xx_failed_2_no_such_file_or_directory">7.2. Upon uploading a file, Phusion Passenger reports "client_body_temp/00000000xx failed (2: No such file or directory)"</a></div>
|
1139
|
+
<div class="foo toclevel3"><a href="#_i_get_command_not_found_when_running_a_phusion_passenger_command_through_sudo">7.3. I get "command not found" when running a Phusion Passenger command through sudo</a></div>
|
1140
|
+
<div class="foo toclevel2"><a href="#about_environment_variables">8. Appendix: About environment variables</a></div>
|
1141
|
+
<div class="foo toclevel3"><a href="#_working_with_environment_variables">8.1. Working with environment variables</a></div>
|
1142
|
+
<div class="foo toclevel3"><a href="#the_path_env_var">8.2. The PATH environment variable</a></div>
|
1143
|
+
<div class="foo toclevel4"><a href="#_adding_phusion_passenger_8217_s_administration_tools_to_path">8.2.1. Adding Phusion Passenger’s administration tools to PATH</a></div>
|
1144
|
+
<div class="foo toclevel3"><a href="#_making_environment_variables_permanent">8.3. Making environment variables permanent</a></div>
|
1145
|
+
<div class="foo toclevel4"><a href="#_bash">8.3.1. bash</a></div>
|
1146
|
+
<div class="foo toclevel4"><a href="#_apache">8.3.2. Apache</a></div>
|
1147
|
+
<div class="foo toclevel4"><a href="#_nginx">8.3.3. Nginx</a></div>
|
1148
|
+
<div class="foo toclevel4"><a href="#_cron">8.3.4. cron</a></div>
|
1149
|
+
<div class="foo toclevel4"><a href="#env_vars_passenger_apps">8.3.5. Phusion Passenger-served apps</a></div>
|
1150
|
+
<div class="foo toclevel3"><a href="#env_vars_and_sudo">8.4. Environment variables and sudo</a></div>
|
1151
|
+
</div>
|
1152
|
+
</div>
|
1153
|
+
<div id="content">
|
1154
|
+
|
1155
|
+
<div class="sect1">
|
1156
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_support_information"></span><h2 data-comment-topic="support-information-1x8e9ee" data-anchor="_support_information">1. Support information</h2>
|
1157
|
+
<div class="sectionbody">
|
1158
|
+
<div class="sect2">
|
1159
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_supported_operating_systems_and_languages"></span><h3 data-comment-topic="supported-operating-systems-1387080" data-anchor="_supported_operating_systems_and_languages">1.1. Supported operating systems and languages</h3>
|
1160
|
+
<div class="paragraph"><p>Phusion Passenger works on almost any POSIX-compliant operating system. In other
|
1161
|
+
words: practically any operating system on earth, except Microsoft Windows.</p></div>
|
1162
|
+
<div class="paragraph"><p>Supported operating systems:</p></div>
|
1163
|
+
<table class="tableblock frame-all grid-all" style="
|
1164
|
+
width:100%;
|
1165
|
+
">
|
1166
|
+
<col style="width:50%;">
|
1167
|
+
<col style="width:50%;">
|
1168
|
+
<thead>
|
1169
|
+
<tr>
|
1170
|
+
<th class="tableblock halign-left valign-top"> OS </th>
|
1171
|
+
<th class="tableblock halign-left valign-top"> Minimum version</th>
|
1172
|
+
</tr>
|
1173
|
+
</thead>
|
1174
|
+
<tbody>
|
1175
|
+
<tr>
|
1176
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Ubuntu</p></td>
|
1177
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">10.04</p></td>
|
1178
|
+
</tr>
|
1179
|
+
<tr>
|
1180
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Debian</p></td>
|
1181
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">6</p></td>
|
1182
|
+
</tr>
|
1183
|
+
<tr>
|
1184
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS</p></td>
|
1185
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">5</p></td>
|
1186
|
+
</tr>
|
1187
|
+
<tr>
|
1188
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Amazon Linux</p></td>
|
1189
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">All versions supported</p></td>
|
1190
|
+
</tr>
|
1191
|
+
<tr>
|
1192
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X</p></td>
|
1193
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">10.8 Mountain Lion</p></td>
|
1194
|
+
</tr>
|
1195
|
+
<tr>
|
1196
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">FreeBSD</p></td>
|
1197
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">8</p></td>
|
1198
|
+
</tr>
|
1199
|
+
<tr>
|
1200
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">OpenBSD</p></td>
|
1201
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">5.2</p></td>
|
1202
|
+
</tr>
|
1203
|
+
<tr>
|
1204
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Other Unix</p></td>
|
1205
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
|
1206
|
+
</tr>
|
1207
|
+
</tbody>
|
1208
|
+
</table>
|
1209
|
+
<div class="paragraph"><p>"Other Unix" is supported on a "best-effort" basis. We do not regularly check whether Phusion Passenger still works on other Unices, but if users report issues then we’ll try to address them.</p></div>
|
1210
|
+
<div class="paragraph"><p>Supported architectures:</p></div>
|
1211
|
+
<table class="tableblock frame-all grid-all" style="
|
1212
|
+
width:100%;
|
1213
|
+
">
|
1214
|
+
<col style="width:50%;">
|
1215
|
+
<col style="width:50%;">
|
1216
|
+
<thead>
|
1217
|
+
<tr>
|
1218
|
+
<th class="tableblock halign-left valign-top"> Architecture </th>
|
1219
|
+
<th class="tableblock halign-left valign-top"> Notes</th>
|
1220
|
+
</tr>
|
1221
|
+
</thead>
|
1222
|
+
<tbody>
|
1223
|
+
<tr>
|
1224
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">x86 (32-bit)</p></td>
|
1225
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
|
1226
|
+
</tr>
|
1227
|
+
<tr>
|
1228
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">x86_64 (64-bit)</p></td>
|
1229
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">-</p></td>
|
1230
|
+
</tr>
|
1231
|
+
<tr>
|
1232
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Other</p></td>
|
1233
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Supported on a "best-effort" basis.</p></td>
|
1234
|
+
</tr>
|
1235
|
+
</tbody>
|
1236
|
+
</table>
|
1237
|
+
<div class="paragraph"><p>Supported languages and frameworks:</p></div>
|
1238
|
+
<table class="tableblock frame-all grid-all" style="
|
1239
|
+
width:100%;
|
1240
|
+
">
|
1241
|
+
<col style="width:50%;">
|
1242
|
+
<col style="width:50%;">
|
1243
|
+
<thead>
|
1244
|
+
<tr>
|
1245
|
+
<th class="tableblock halign-left valign-top"> Language/framework </th>
|
1246
|
+
<th class="tableblock halign-left valign-top"> Minimum version</th>
|
1247
|
+
</tr>
|
1248
|
+
</thead>
|
1249
|
+
<tbody>
|
1250
|
+
<tr>
|
1251
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Ruby (MRI)</p></td>
|
1252
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">1.8.5</p></td>
|
1253
|
+
</tr>
|
1254
|
+
<tr>
|
1255
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">JRuby</p></td>
|
1256
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">1.7.0</p></td>
|
1257
|
+
</tr>
|
1258
|
+
<tr>
|
1259
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Rubinius</p></td>
|
1260
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">2.2.0</p></td>
|
1261
|
+
</tr>
|
1262
|
+
<tr>
|
1263
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Ruby on Rails</p></td>
|
1264
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">2.3</p></td>
|
1265
|
+
</tr>
|
1266
|
+
<tr>
|
1267
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Python</p></td>
|
1268
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">2.6</p></td>
|
1269
|
+
</tr>
|
1270
|
+
<tr>
|
1271
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Node.js</p></td>
|
1272
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">0.10</p></td>
|
1273
|
+
</tr>
|
1274
|
+
<tr>
|
1275
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Meteor</p></td>
|
1276
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">0.6</p></td>
|
1277
|
+
</tr>
|
1278
|
+
</tbody>
|
1279
|
+
</table>
|
1280
|
+
<div class="paragraph"><p>If you run into any issues, please
|
1281
|
+
<a href="https://github.com/phusion/passenger/issues">report a bug</a>
|
1282
|
+
or
|
1283
|
+
<a href="http://groups.google.com/group/phusion-passenger">join our discussion forum</a>.</p></div>
|
1284
|
+
</div>
|
1285
|
+
<div class="sect2">
|
1286
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="where_to_get_support"></span><h3 data-comment-topic="where-to-get-support-xkx7rx" data-anchor="where_to_get_support">1.2. Where to get support</h3>
|
1287
|
+
<div class="ulist"><ul>
|
1288
|
+
<li>
|
1289
|
+
<p>
|
1290
|
+
<a href="http://groups.google.com/group/phusion-passenger">Community discussion forum</a> - post a
|
1291
|
+
message here if you’re experiencing problems. Support on this forum is provided by the community on a best-effort basis, so a (timely) response is not guaranteed.
|
1292
|
+
</p>
|
1293
|
+
</li>
|
1294
|
+
<li>
|
1295
|
+
<p>
|
1296
|
+
<a href="https://github.com/phusion/passenger/issues">Issue tracker</a> - report
|
1297
|
+
bugs here.
|
1298
|
+
</p>
|
1299
|
+
</li>
|
1300
|
+
<li>
|
1301
|
+
<p>
|
1302
|
+
Email <a href="mailto:support@phusion.nl">support@phusion.nl</a> if you are a <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> customer. Please mention your order reference. If you are not an Enterprise customer, we kindly redirect you to the community discussion forum instead.
|
1303
|
+
</p>
|
1304
|
+
</li>
|
1305
|
+
<li>
|
1306
|
+
<p>
|
1307
|
+
<a href="https://www.phusionpassenger.com/commercial_support">Commercial support contracts</a> are also available.
|
1308
|
+
</p>
|
1309
|
+
</li>
|
1310
|
+
<li>
|
1311
|
+
<p>
|
1312
|
+
Report security vulnerabilities to <a href="mailto:security@phusion.nl">security@phusion.nl</a>. We will do our best to respond to you as quickly as we can, so please do not disclose the vulnerability until then.
|
1313
|
+
</p>
|
1314
|
+
</li>
|
1315
|
+
</ul></div>
|
1316
|
+
<div class="paragraph"><p>Please consult <a href="https://www.phusionpassenger.com/support">the Phusion Passenger website</a> for a full list of support resources.</p></div>
|
1317
|
+
</div>
|
1318
|
+
</div>
|
1319
|
+
</div>
|
1320
|
+
<div class="sect1">
|
1321
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="installation"></span><h2 data-comment-topic="installation-2vrmef" data-anchor="installation">2. Installation</h2>
|
1322
|
+
<div class="sectionbody">
|
1323
|
+
<div class="sect2">
|
1324
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_synopsis"></span><h3 data-comment-topic="synopsis-92sr34" data-anchor="_synopsis">2.1. Synopsis</h3>
|
1325
|
+
<div class="paragraph"><p>Because Phusion Passenger is designed to run in a wide variety of operating systems and configurations, there are multiple ways to install it. Most users — especially first-time users — will prefer <em>OS-specific installation instructions</em>. These are not only the easiest, but also allow Phusion Passenger to integrate into the operating system in the best way possible. Other users should consult the <em>generic installation instructions</em>.</p></div>
|
1326
|
+
<div class="paragraph"><p>The steps for upgrading or downgrading Phusion Passenger is almost the same as the steps for installing. All the installation guides in this section will also teach you how to upgrade and downgrade.</p></div>
|
1327
|
+
</div>
|
1328
|
+
<div class="sect2">
|
1329
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="install_osx_homebrew"></span><h3 data-comment-topic="installing-or-upgrading-on-mac-os-x-with-homebrew-fxjdi1" data-anchor="install_osx_homebrew">2.2. Installing or upgrading on Mac OS X with Homebrew</h3>
|
1330
|
+
<div class="dlist"><dl>
|
1331
|
+
<dt class="hdlist1">
|
1332
|
+
<strong>Open source</strong>
|
1333
|
+
</dt>
|
1334
|
+
<dd>
|
1335
|
+
<p>
|
1336
|
+
Every time we release a new Phusion Passenger version, we make it available through <a href="http://brew.sh/">Homebrew</a>. Please note that the Homebrew maintainers have to merge our pull requests manually, so it may take a day or two before a new version shows up in the official Homebrew repository.
|
1337
|
+
</p>
|
1338
|
+
<div class="olist arabic"><ol class="arabic">
|
1339
|
+
<li>
|
1340
|
+
<p>
|
1341
|
+
Update the Homebrew recipes:
|
1342
|
+
</p>
|
1343
|
+
<div class="listingblock">
|
1344
|
+
<div class="content monospaced">
|
1345
|
+
<pre>brew update</pre>
|
1346
|
+
</div>
|
1347
|
+
</div>
|
1348
|
+
</li>
|
1349
|
+
<li>
|
1350
|
+
<p>
|
1351
|
+
Run one of the following, and follow the instructions:
|
1352
|
+
</p>
|
1353
|
+
<div class="listingblock">
|
1354
|
+
<div class="content monospaced">
|
1355
|
+
<pre>brew install passenger
|
1356
|
+
-OR-
|
1357
|
+
brew upgrade passenger</pre>
|
1358
|
+
</div>
|
1359
|
+
</div>
|
1360
|
+
</li>
|
1361
|
+
</ol></div>
|
1362
|
+
</dd>
|
1363
|
+
<dt class="hdlist1">
|
1364
|
+
<strong>Enterprise</strong>
|
1365
|
+
</dt>
|
1366
|
+
<dd>
|
1367
|
+
<p>
|
1368
|
+
<a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> is currently not available through Homebrew. Please try one of the other installation methods instead.
|
1369
|
+
</p>
|
1370
|
+
</dd>
|
1371
|
+
</dl></div>
|
1372
|
+
</div>
|
1373
|
+
<div class="sect2">
|
1374
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="install_on_debian_ubuntu"></span><h3 data-comment-topic="installing-or-upgrading-on-debian-or-ubuntu-gme2a9" data-anchor="install_on_debian_ubuntu">2.3. Installing or upgrading on Debian or Ubuntu</h3>
|
1375
|
+
<div class="paragraph"><p>We provide an official Phusion Passenger APT repository. This APT repository contains Phusion Passenger packages for multiple versions of Debian and Ubuntu. These packages are automatically built by our build server after we push out a source release, and thus are always up to date with the official source releases.</p></div>
|
1376
|
+
<div class="paragraph"><p>If you use these packages to install Phusion Passenger then you do not need to run <span class="monospaced">passenger-install-apache2-module</span> or <span class="monospaced">passenger-install-nginx-module</span>. These packages contain all the binaries that you need.</p></div>
|
1377
|
+
<div class="paragraph"><p>Packages are available for the x86 and x86_64 architectures. Our policy is to support all Ubuntu LTS releases that are still supported by Canonical, plus the latest Ubuntu release, plus all Debian releases that are still supported by Debian.</p></div>
|
1378
|
+
<div class="sect3">
|
1379
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="install_add_apt_repo"></span><h4 data-comment-topic="adding-our-apt-repository-1qu2se8" data-anchor="install_add_apt_repo">2.3.1. Adding our APT repository</h4>
|
1380
|
+
<div class="olist arabic"><ol class="arabic">
|
1381
|
+
<li>
|
1382
|
+
<p>
|
1383
|
+
Install our PGP key. Packages are signed by "Phusion Automated Software Signing (<a href="mailto:auto-software-signing@phusion.nl">auto-software-signing@phusion.nl</a>)", fingerprint 1637 8A33 A6EF 1676 2922 526E 561F 9B9C AC40 B2F7.
|
1384
|
+
</p>
|
1385
|
+
<div class="listingblock">
|
1386
|
+
<div class="content monospaced">
|
1387
|
+
<pre>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7</pre>
|
1388
|
+
</div>
|
1389
|
+
</div>
|
1390
|
+
</li>
|
1391
|
+
<li>
|
1392
|
+
<p>
|
1393
|
+
Add HTTPS support for APT. Our APT repository is stored on an HTTPS server.
|
1394
|
+
</p>
|
1395
|
+
<div class="listingblock">
|
1396
|
+
<div class="content monospaced">
|
1397
|
+
<pre>sudo apt-get install apt-transport-https ca-certificates</pre>
|
1398
|
+
</div>
|
1399
|
+
</div>
|
1400
|
+
</li>
|
1401
|
+
<li>
|
1402
|
+
<p>
|
1403
|
+
Create a file <span class="monospaced">/etc/apt/sources.list.d/passenger.list</span> and insert <strong>one of</strong> the following lines, depending on your distribution.
|
1404
|
+
</p>
|
1405
|
+
<div class="dlist"><dl>
|
1406
|
+
<dt class="hdlist1">
|
1407
|
+
<strong>Open source</strong>
|
1408
|
+
</dt>
|
1409
|
+
<dd>
|
1410
|
+
<div class="listingblock">
|
1411
|
+
<div class="content">
|
1412
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
1413
|
+
by Lorenzo Bettini
|
1414
|
+
http://www.lorenzobettini.it
|
1415
|
+
http://www.gnu.org/software/src-highlite -->
|
1416
|
+
<pre><tt><span style="font-style: italic"><span style="color: #9A1900">##### !!!! Only add ONE of these lines, not all of them !!!! #####</span></span>
|
1417
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 14.04</span></span>
|
1418
|
+
deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger trusty main
|
1419
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 12.04</span></span>
|
1420
|
+
deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger precise main
|
1421
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 10.04</span></span>
|
1422
|
+
deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger lucid main
|
1423
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Debian 7</span></span>
|
1424
|
+
deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger wheezy main
|
1425
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Debian 6</span></span>
|
1426
|
+
deb https<span style="color: #990000">:</span>//oss-binaries<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/apt/passenger squeeze main</tt></pre>
|
1427
|
+
</div>
|
1428
|
+
</div>
|
1429
|
+
</dd>
|
1430
|
+
<dt class="hdlist1">
|
1431
|
+
<strong>Enterprise</strong>
|
1432
|
+
</dt>
|
1433
|
+
<dd>
|
1434
|
+
<div class="listingblock">
|
1435
|
+
<div class="content">
|
1436
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
1437
|
+
by Lorenzo Bettini
|
1438
|
+
http://www.lorenzobettini.it
|
1439
|
+
http://www.gnu.org/software/src-highlite -->
|
1440
|
+
<pre><tt><span style="font-style: italic"><span style="color: #9A1900">##### !!!! Only add ONE of these lines, not all of them !!!! #####</span></span>
|
1441
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 14.04</span></span>
|
1442
|
+
deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt trusty main
|
1443
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 12.04</span></span>
|
1444
|
+
deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt precise main
|
1445
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Ubuntu 10.04</span></span>
|
1446
|
+
deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt lucid main
|
1447
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Debian 7</span></span>
|
1448
|
+
deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt wheezy main
|
1449
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Debian 6</span></span>
|
1450
|
+
deb https<span style="color: #990000">:</span>//download<span style="color: #990000">:</span>YOUR_DOWNLOAD_TOKEN@www<span style="color: #990000">.</span>phusionpassenger<span style="color: #990000">.</span>com/enterprise_apt squeeze main</tt></pre>
|
1451
|
+
</div>
|
1452
|
+
</div>
|
1453
|
+
<div class="paragraph"><p>You can find the correct value for <em>YOUR_DOWNLOAD_TOKEN</em> in the <a href="https://www.phusionpassenger.com/orders">Customer Area</a>.</p></div>
|
1454
|
+
</dd>
|
1455
|
+
</dl></div>
|
1456
|
+
</li>
|
1457
|
+
<li>
|
1458
|
+
<p>
|
1459
|
+
Secure <span class="monospaced">passenger.list</span> and update your APT cache:
|
1460
|
+
</p>
|
1461
|
+
<div class="listingblock">
|
1462
|
+
<div class="content monospaced">
|
1463
|
+
<pre>sudo chown root: /etc/apt/sources.list.d/passenger.list
|
1464
|
+
sudo chmod 600 /etc/apt/sources.list.d/passenger.list
|
1465
|
+
sudo apt-get update</pre>
|
1466
|
+
</div>
|
1467
|
+
</div>
|
1468
|
+
</li>
|
1469
|
+
</ol></div>
|
1470
|
+
</div>
|
1471
|
+
<div class="sect3">
|
1472
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_packages"></span><h4 data-comment-topic="installing-packages-k1zxbg" data-anchor="_installing_packages">2.3.2. Installing packages</h4>
|
1473
|
+
<div class="dlist"><dl>
|
1474
|
+
<dt class="hdlist1">
|
1475
|
+
<strong>Open source</strong>
|
1476
|
+
</dt>
|
1477
|
+
<dd>
|
1478
|
+
<div class="olist arabic"><ol class="arabic">
|
1479
|
+
<li>
|
1480
|
+
<p>
|
1481
|
+
<a href="#install_add_apt_repo">Add our APT repository.</a>
|
1482
|
+
</p>
|
1483
|
+
</li>
|
1484
|
+
<li>
|
1485
|
+
<p>
|
1486
|
+
Install the package:
|
1487
|
+
</p>
|
1488
|
+
<div class="listingblock">
|
1489
|
+
<div class="content monospaced">
|
1490
|
+
<pre>sudo apt-get install passenger</pre>
|
1491
|
+
</div>
|
1492
|
+
</div>
|
1493
|
+
</li>
|
1494
|
+
</ol></div>
|
1495
|
+
</dd>
|
1496
|
+
<dt class="hdlist1">
|
1497
|
+
<strong>Enterprise</strong>
|
1498
|
+
</dt>
|
1499
|
+
<dd>
|
1500
|
+
<div class="olist arabic"><ol class="arabic">
|
1501
|
+
<li>
|
1502
|
+
<p>
|
1503
|
+
Download your license key from the <a href="https://www.phusionpassenger.com/orders">Customer Area</a> and save it as <span class="monospaced">/etc/passenger-enterprise-license</span>.
|
1504
|
+
</p>
|
1505
|
+
</li>
|
1506
|
+
<li>
|
1507
|
+
<p>
|
1508
|
+
<a href="#install_add_apt_repo">Add our APT repository.</a>
|
1509
|
+
</p>
|
1510
|
+
</li>
|
1511
|
+
<li>
|
1512
|
+
<p>
|
1513
|
+
Install the packages:
|
1514
|
+
</p>
|
1515
|
+
<div class="listingblock">
|
1516
|
+
<div class="content monospaced">
|
1517
|
+
<pre>sudo apt-get install passenger-enterprise</pre>
|
1518
|
+
</div>
|
1519
|
+
</div>
|
1520
|
+
</li>
|
1521
|
+
</ol></div>
|
1522
|
+
</dd>
|
1523
|
+
</dl></div>
|
1524
|
+
</div>
|
1525
|
+
</div>
|
1526
|
+
<div class="sect2">
|
1527
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_or_upgrading_on_red_hat_fedora_centos_or_scientificlinux"></span><h3 data-comment-topic="installing-or-upgrading-on-red-hat-fedora-centos-or-scientificlinux-16cek45" data-anchor="_installing_or_upgrading_on_red_hat_fedora_centos_or_scientificlinux">2.4. Installing or upgrading on Red Hat, Fedora, CentOS or ScientificLinux</h3>
|
1528
|
+
<div class="admonitionblock">
|
1529
|
+
<table><tr>
|
1530
|
+
<td class="icon">
|
1531
|
+
<img src="./images/icons/warning.png" alt="Warning">
|
1532
|
+
</td>
|
1533
|
+
<td class="content">The RPMs are currently unmaintained. As such, the repository only contains Phusion Passenger 3.x (the latest version is 4.x), which did not support Node.js, Meteor, multiple Rubies, etc. For more recent versions of Phusion Passenger, you are suggested to install from gem or tarball instead.</td>
|
1534
|
+
</tr></table>
|
1535
|
+
</div>
|
1536
|
+
<div class="paragraph"><p>YUM repositories with RPMs are maintained by <a href="https://github.com/erikogan/passenger">Erik Ogan</a> and <a href="http://stealthymonkeys.com/">Stealthy Monkeys Consulting</a>. Only packages for the open source version of Phusion Passenger are provided. <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> customers should use the <a href="#rubygems_generic_install">generic RubyGems installation method</a> or <a href="#tarball_generic_install">the generic tarball installation method</a> instead.</p></div>
|
1537
|
+
<div class="paragraph"><p>If you use YUM to install Phusion Passenger then you do not need to run <span class="monospaced">passenger-install-apache2-module</span> or <span class="monospaced">passenger-install-nginx-module</span>. The YUM packages contain all the binaries that you need. You also don’t need to modify any Apache or Nginx configuration to get them to load Phusion Passenger, the packages provide configuration snippets for you as well.</p></div>
|
1538
|
+
<span class="anchor_helper" id="_step_1_import_the_stealthy_monkeys_consulting_8217_s_gpg_key"></span><h4 class="float" data-anchor="_step_1_import_the_stealthy_monkeys_consulting_8217_s_gpg_key">Step 1: Import the Stealthy Monkeys Consulting’s GPG key</h4>
|
1539
|
+
<div class="listingblock">
|
1540
|
+
<div class="content monospaced">
|
1541
|
+
<pre>rpm --import http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc</pre>
|
1542
|
+
</div>
|
1543
|
+
</div>
|
1544
|
+
<span class="anchor_helper" id="_step_2_install_the_release_package"></span><h4 class="float" data-anchor="_step_2_install_the_release_package">Step 2: Install the release package</h4>
|
1545
|
+
<div class="paragraph"><p>Install the passenger-release package from the <a href="http://passenger.stealthymonkeys.com/">main repository</a>.</p></div>
|
1546
|
+
<div class="paragraph"><p>Fedora Core 17:</p></div>
|
1547
|
+
<div class="listingblock">
|
1548
|
+
<div class="content monospaced">
|
1549
|
+
<pre>yum install http://passenger.stealthymonkeys.com/fedora/17/passenger-release.noarch.rpm</pre>
|
1550
|
+
</div>
|
1551
|
+
</div>
|
1552
|
+
<div class="paragraph"><p>Fedora Core 16:</p></div>
|
1553
|
+
<div class="listingblock">
|
1554
|
+
<div class="content monospaced">
|
1555
|
+
<pre>yum install http://passenger.stealthymonkeys.com/fedora/16/passenger-release.noarch.rpm</pre>
|
1556
|
+
</div>
|
1557
|
+
</div>
|
1558
|
+
<div class="paragraph"><p>Fedora Core 15:</p></div>
|
1559
|
+
<div class="listingblock">
|
1560
|
+
<div class="content monospaced">
|
1561
|
+
<pre>yum install http://passenger.stealthymonkeys.com/fedora/15/passenger-release.noarch.rpm</pre>
|
1562
|
+
</div>
|
1563
|
+
</div>
|
1564
|
+
<div class="paragraph"><p>Fedora Core 14:</p></div>
|
1565
|
+
<div class="listingblock">
|
1566
|
+
<div class="content monospaced">
|
1567
|
+
<pre>yum install http://passenger.stealthymonkeys.com/fedora/14/passenger-release.noarch.rpm</pre>
|
1568
|
+
</div>
|
1569
|
+
</div>
|
1570
|
+
<div class="paragraph"><p>RHEL 6 / CentOS 6 / ScientificLinux 6: (Note: these packages depend on <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>.)</p></div>
|
1571
|
+
<div class="listingblock">
|
1572
|
+
<div class="content monospaced">
|
1573
|
+
<pre>yum install http://passenger.stealthymonkeys.com/rhel/6/passenger-release.noarch.rpm</pre>
|
1574
|
+
</div>
|
1575
|
+
</div>
|
1576
|
+
<div class="paragraph"><p>RHEL 5 / CentOS 5 / ScientificLinux 5: (Note: these packages depend on <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>.)</p></div>
|
1577
|
+
<div class="listingblock">
|
1578
|
+
<div class="content monospaced">
|
1579
|
+
<pre>rpm -Uvh http://passenger.stealthymonkeys.com/rhel/5/passenger-release.noarch.rpm</pre>
|
1580
|
+
</div>
|
1581
|
+
</div>
|
1582
|
+
<span class="anchor_helper" id="_step_3_install_the_right_phusion_passenger_package"></span><h4 class="float" data-anchor="_step_3_install_the_right_phusion_passenger_package">Step 3: Install the right Phusion Passenger package</h4>
|
1583
|
+
<div class="paragraph"><p>From there you can use <a href="http://prefetch.net/articles/yum.html">YUM</a> to install packages. For example, try one of these:</p></div>
|
1584
|
+
<div class="paragraph"><p>Phusion Passenger for Apache:</p></div>
|
1585
|
+
<div class="listingblock">
|
1586
|
+
<div class="content monospaced">
|
1587
|
+
<pre>yum install mod_passenger</pre>
|
1588
|
+
</div>
|
1589
|
+
</div>
|
1590
|
+
<div class="paragraph"><p>Phusion Passenger for Nginx:</p></div>
|
1591
|
+
<div class="listingblock">
|
1592
|
+
<div class="content monospaced">
|
1593
|
+
<pre>yum install nginx-passenger</pre>
|
1594
|
+
</div>
|
1595
|
+
</div>
|
1596
|
+
<div class="paragraph"><p>Phusion Passenger Standalone:</p></div>
|
1597
|
+
<div class="listingblock">
|
1598
|
+
<div class="content monospaced">
|
1599
|
+
<pre>yum install passenger-standalone</pre>
|
1600
|
+
</div>
|
1601
|
+
</div>
|
1602
|
+
<span class="anchor_helper" id="_building_your_own_packages"></span><h4 class="float" data-anchor="_building_your_own_packages">Building your own packages</h4>
|
1603
|
+
<div class="paragraph"><p>There are instructions for building your own packages and Yum repositories in the <a href="https://github.com/phusion/passenger/tree/master/rpm#readme">rpm directory ReadMe</a> within the <a href="https://github.com/phusion/passenger">GitHub repository</a>.</p></div>
|
1604
|
+
</div>
|
1605
|
+
<div class="sect2">
|
1606
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="rubygems_generic_install"></span><h3 data-comment-topic="generic-installation-upgrade-and-downgrade-method-via-rubygems-1229ugi" data-anchor="rubygems_generic_install">2.5. Generic installation, upgrade and downgrade method: via RubyGems</h3>
|
1607
|
+
<div class="paragraph"><p>RubyGems is only used as a method to obtain the Phusion Passenger files, so in case you have multiple Ruby versions it does not matter which Ruby’s RubyGems you use for installation. Once installed, Phusion Passenger can work with all other Ruby versions on your system. This is explained in <a href="#relationship_with_ruby">Phusion Passenger and its relationship with Ruby</a>.</p></div>
|
1608
|
+
<span class="anchor_helper" id="is_ruby_home_or_system_wide_installed"></span><h4 class="float" data-anchor="is_ruby_home_or_system_wide_installed">Step 1: figuring out whether your Ruby is installed in the home directory or system-wide</h4>
|
1609
|
+
<div class="paragraph"><p>Ruby may either be installed in the home directory, or system-wide. If it’s installed system-wide then we will want to install gems system-wide as well, so you need to switch to a root prompt first. If Ruby is installed in the home directory then we will want to install gems to the home directory as well, as a normal user.</p></div>
|
1610
|
+
<div class="paragraph"><p>To find out which case applies, run the following command to find out where the <span class="monospaced">ruby</span> command is:</p></div>
|
1611
|
+
<div class="listingblock">
|
1612
|
+
<div class="content monospaced">
|
1613
|
+
<pre>which ruby</pre>
|
1614
|
+
</div>
|
1615
|
+
</div>
|
1616
|
+
<div class="paragraph"><p>Do you see a filename that references <em>/home</em> or <em>/Users</em>? If so then your Ruby interpreter is installed in your home directory and you can proceed to step 2. Otherwise, you need to switch to a root prompt by running one of the following commands:</p></div>
|
1617
|
+
<div class="ulist"><ul>
|
1618
|
+
<li>
|
1619
|
+
<p>
|
1620
|
+
Are you using RVM? Run <span class="monospaced">rvmsudo -s</span>
|
1621
|
+
</p>
|
1622
|
+
</li>
|
1623
|
+
<li>
|
1624
|
+
<p>
|
1625
|
+
Are you not using RVM, or do you not know what RVM is? Run <span class="monospaced">sudo -s</span>
|
1626
|
+
</p>
|
1627
|
+
</li>
|
1628
|
+
<li>
|
1629
|
+
<p>
|
1630
|
+
Is <em>sudo</em> not installed on your system? Run <span class="monospaced">su -c bash</span>
|
1631
|
+
</p>
|
1632
|
+
</li>
|
1633
|
+
</ul></div>
|
1634
|
+
<div class="paragraph"><p>You must maintain this root prompt throughout this installation guide.</p></div>
|
1635
|
+
<span class="anchor_helper" id="_step_2_install_the_gem"></span><h4 class="float" data-anchor="_step_2_install_the_gem">Step 2: install the gem</h4>
|
1636
|
+
<div class="dlist"><dl>
|
1637
|
+
<dt class="hdlist1">
|
1638
|
+
<strong>Open Source</strong>
|
1639
|
+
</dt>
|
1640
|
+
<dd>
|
1641
|
+
<p>
|
1642
|
+
Install the latest gem to obtain the files for the latest stable version of the open source Phusion Passenger:
|
1643
|
+
</p>
|
1644
|
+
<div class="listingblock">
|
1645
|
+
<div class="content monospaced">
|
1646
|
+
<pre>gem install passenger</pre>
|
1647
|
+
</div>
|
1648
|
+
</div>
|
1649
|
+
<div class="sidebarblock">
|
1650
|
+
<div class="content">
|
1651
|
+
<div class="title">Previous versions and beta versions</div>
|
1652
|
+
<div class="paragraph"><p>Sometimes you will want to obtain the latest beta version of Phusion Passenger. Beta versions are not normally selected by <span class="monospaced">gem install</span>, so to opt-in for beta versions you have to add the <span class="monospaced">--pre</span> argument:</p></div>
|
1653
|
+
<div class="listingblock">
|
1654
|
+
<div class="content monospaced">
|
1655
|
+
<pre>gem install passenger --pre</pre>
|
1656
|
+
</div>
|
1657
|
+
</div>
|
1658
|
+
<div class="paragraph"><p>If you want to obtain a specific version of Phusion Passenger, e.g. because you are downgrading, then specify the version number with <span class="monospaced">--version</span>:</p></div>
|
1659
|
+
<div class="listingblock">
|
1660
|
+
<div class="content monospaced">
|
1661
|
+
<pre>gem install passenger --version 3.0.0</pre>
|
1662
|
+
</div>
|
1663
|
+
</div>
|
1664
|
+
<div class="paragraph"><p>If you want to obtain a specific <strong>beta</strong> version of Phusion Passenger then you must also pass <span class="monospaced">--pre</span>:</p></div>
|
1665
|
+
<div class="listingblock">
|
1666
|
+
<div class="content monospaced">
|
1667
|
+
<pre>gem install passenger --version 3.9.1.beta --pre</pre>
|
1668
|
+
</div>
|
1669
|
+
</div>
|
1670
|
+
</div>
|
1671
|
+
</div>
|
1672
|
+
</dd>
|
1673
|
+
<dt class="hdlist1">
|
1674
|
+
<strong>Enterprise</strong>
|
1675
|
+
</dt>
|
1676
|
+
<dd>
|
1677
|
+
<p>
|
1678
|
+
First, download the <strong>license key</strong> from the <a href="https://www.phusionpassenger.com/orders">Customer Area</a> and save it as <span class="monospaced">/etc/passenger-enterprise-license</span>.
|
1679
|
+
</p>
|
1680
|
+
<div class="paragraph"><p>Next, add the Phusion Passenger Enterprise gem server to your RubyGems source list:</p></div>
|
1681
|
+
<div class="listingblock">
|
1682
|
+
<div class="content monospaced">
|
1683
|
+
<pre>gem source --add https://download:YOUR_DOWNLOAD_TOKEN@www.phusionpassenger.com/enterprise_gems/</pre>
|
1684
|
+
</div>
|
1685
|
+
</div>
|
1686
|
+
<div class="paragraph"><p>Substitute <em>YOUR_DOWNLOAD_TOKEN</em> with the one you find in the <a href="https://www.phusionpassenger.com/orders">Customer Area</a>. And notice the <strong>trailing slash</strong> in the URL! It is very important.</p></div>
|
1687
|
+
<div class="paragraph"><p>Finally, install the latest gem to obtain the files for the latest stable version of the open source Phusion Passenger:</p></div>
|
1688
|
+
<div class="listingblock">
|
1689
|
+
<div class="content monospaced">
|
1690
|
+
<pre>gem install passenger-enterprise-server</pre>
|
1691
|
+
</div>
|
1692
|
+
</div>
|
1693
|
+
<div class="sidebarblock">
|
1694
|
+
<div class="content">
|
1695
|
+
<div class="title">Previous versions and beta versions</div>
|
1696
|
+
<div class="paragraph"><p>Sometimes you will want to obtain the latest beta version of Phusion Passenger Enterprise. Beta versions are not normally selected by <span class="monospaced">gem install</span>, so to opt-in for beta versions you have to add the <span class="monospaced">--pre</span> argument:</p></div>
|
1697
|
+
<div class="listingblock">
|
1698
|
+
<div class="content monospaced">
|
1699
|
+
<pre>gem install passenger-enterprise-server --pre</pre>
|
1700
|
+
</div>
|
1701
|
+
</div>
|
1702
|
+
<div class="paragraph"><p>If you want to obtain a specific version of Phusion Passenger Enterprise, e.g. because you are downgrading, then specify the version number with <span class="monospaced">--version</span>:</p></div>
|
1703
|
+
<div class="listingblock">
|
1704
|
+
<div class="content monospaced">
|
1705
|
+
<pre>gem install passenger-enterprise-server --version 3.0.0</pre>
|
1706
|
+
</div>
|
1707
|
+
</div>
|
1708
|
+
<div class="paragraph"><p>If you want to obtain a specific <strong>beta</strong> version of Phusion Passenger then you must also pass <span class="monospaced">--pre</span>:</p></div>
|
1709
|
+
<div class="listingblock">
|
1710
|
+
<div class="content monospaced">
|
1711
|
+
<pre>gem install passenger-enterprise-server --version 3.9.1.beta --pre</pre>
|
1712
|
+
</div>
|
1713
|
+
</div>
|
1714
|
+
</div>
|
1715
|
+
</div>
|
1716
|
+
</dd>
|
1717
|
+
</dl></div>
|
1718
|
+
</div>
|
1719
|
+
<div class="sect2">
|
1720
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="tarball_generic_install"></span><h3 data-comment-topic="generic-installation-upgrade-and-downgrade-method-via-tarball-1rwvasy" data-anchor="tarball_generic_install">2.6. Generic installation, upgrade and downgrade method: via tarball</h3>
|
1721
|
+
<span class="anchor_helper" id="_step_1_installing_ruby"></span><h4 class="float" data-anchor="_step_1_installing_ruby">Step 1: installing Ruby</h4>
|
1722
|
+
<div class="paragraph"><p>Phusion Passenger supports multiple languages and its core is written in C++, but its installer and administration tools are written in Ruby, so you must install Ruby.</p></div>
|
1723
|
+
<div class="paragraph"><p>Even though Ruby is required, Ruby will normally not be loaded during normal operation unless you deploy a Ruby web application on Phusion Passenger. Phusion Passenger’s dependency on Ruby is very minimal. See <a href="#relationship_with_ruby">Phusion Passenger and its relationship with Ruby</a> for details.</p></div>
|
1724
|
+
<table class="tableblock frame-all grid-all" style="
|
1725
|
+
width:100%;
|
1726
|
+
">
|
1727
|
+
<col style="width:50%;">
|
1728
|
+
<col style="width:50%;">
|
1729
|
+
<tbody>
|
1730
|
+
<tr>
|
1731
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td>
|
1732
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo apt-get update</span><br>
|
1733
|
+
<span class="monospaced">sudo apt-get install ruby rake</span></p></td>
|
1734
|
+
</tr>
|
1735
|
+
<tr>
|
1736
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td>
|
1737
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Enable <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>, then run as root:<br>
|
1738
|
+
<span class="monospaced">yum install ruby rubygem-rake</span></p></td>
|
1739
|
+
</tr>
|
1740
|
+
<tr>
|
1741
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X</p></td>
|
1742
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">No action needed. Ruby is installed by default.</p></td>
|
1743
|
+
</tr>
|
1744
|
+
<tr>
|
1745
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td>
|
1746
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Install Ruby from <a href="http://www.ruby-lang.org/">the Ruby website</a>.</p></td>
|
1747
|
+
</tr>
|
1748
|
+
</tbody>
|
1749
|
+
</table>
|
1750
|
+
<span class="anchor_helper" id="_step_2_download_and_extract_the_tarball"></span><h4 class="float" data-anchor="_step_2_download_and_extract_the_tarball">Step 2: download and extract the tarball</h4>
|
1751
|
+
<div class="dlist"><dl>
|
1752
|
+
<dt class="hdlist1">
|
1753
|
+
<strong>Open Source</strong>
|
1754
|
+
</dt>
|
1755
|
+
<dd>
|
1756
|
+
<p>
|
1757
|
+
Download the open source Phusion Passenger tarball from <a href="https://www.phusionpassenger.com/download#open_source">the Phusion Passenger website</a>.
|
1758
|
+
</p>
|
1759
|
+
<div class="paragraph"><p>Older versions can be found in <a href="https://www.phusionpassenger.com/file_releases">the release archive</a>.</p></div>
|
1760
|
+
</dd>
|
1761
|
+
<dt class="hdlist1">
|
1762
|
+
<strong>Enterprise</strong>
|
1763
|
+
</dt>
|
1764
|
+
<dd>
|
1765
|
+
<p>
|
1766
|
+
<a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> customers can download the Phusion Passenger Enterprise tarball from the <a href="https://www.phusionpassenger.com/orders">Customer Area</a>.
|
1767
|
+
</p>
|
1768
|
+
<div class="paragraph"><p>Also be sure to download the <strong>license key</strong> and save it as <span class="monospaced">/etc/passenger-enterprise-license</span>.</p></div>
|
1769
|
+
</dd>
|
1770
|
+
</dl></div>
|
1771
|
+
<div class="paragraph"><p>Once you have downloaded the tarball, pick a location to extract it to. You can pick any location. A good location is <em>/opt/passenger</em>. Create this directory and extract the tarball as follows:</p></div>
|
1772
|
+
<div class="listingblock">
|
1773
|
+
<div class="content monospaced">
|
1774
|
+
<pre>mkdir /opt/passenger
|
1775
|
+
cd /opt/passenger
|
1776
|
+
tar xzvf /location-to/passenger-x.x.x.tar.gz
|
1777
|
+
cd /opt/passenger/passenger-x.x.x</pre>
|
1778
|
+
</div>
|
1779
|
+
</div>
|
1780
|
+
<div class="paragraph"><p>Note that <span class="monospaced">passenger-x.x.x</span> should be <span class="monospaced">passenger-enterprise-server-x.x.x</span> if you’re using Phusion Passenger Enterprise.</p></div>
|
1781
|
+
<span class="anchor_helper" id="_step_3_adding_the_phusion_passenger_tools_to_path"></span><h4 class="float" data-anchor="_step_3_adding_the_phusion_passenger_tools_to_path">Step 3: adding the Phusion Passenger tools to PATH</h4>
|
1782
|
+
<div class="paragraph"><p>Edit <span class="monospaced">/etc/bashrc</span> (or <span class="monospaced">/etc/bash.bashrc</span> on some systems) and append the following to the end of the file:</p></div>
|
1783
|
+
<div class="listingblock">
|
1784
|
+
<div class="content monospaced">
|
1785
|
+
<pre>export PATH=/opt/passenger/passenger-x.x.x/bin:$PATH</pre>
|
1786
|
+
</div>
|
1787
|
+
</div>
|
1788
|
+
<div class="paragraph"><p>Finally, restart all your shell sessions in order to activate this change. The installation is now complete.</p></div>
|
1789
|
+
</div>
|
1790
|
+
<div class="sect2">
|
1791
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_upgrading_from_open_source_to_enterprise"></span><h3 data-comment-topic="upgrading-from-open-source-to-enterprise-1kezors" data-anchor="_upgrading_from_open_source_to_enterprise">2.7. Upgrading from open source to Enterprise</h3>
|
1792
|
+
<div class="paragraph"><p>Phusion Passenger comes in two variants: an open source version, as well as an <a href="https://www.phusionpassenger.com/enterprise">Enterprise version</a> which introduces a myriad of useful features that can improve stability and performance and efficiency.</p></div>
|
1793
|
+
<div class="paragraph"><p>Customers who have bought Phusion Passenger Enterprise can upgrade their open source installation to Enterprise as follows:</p></div>
|
1794
|
+
<div class="olist arabic"><ol class="arabic">
|
1795
|
+
<li>
|
1796
|
+
<p>
|
1797
|
+
<a href="#uninstalling">Uninstall the open source Phusion Passenger</a>.
|
1798
|
+
</p>
|
1799
|
+
</li>
|
1800
|
+
<li>
|
1801
|
+
<p>
|
1802
|
+
Install the Enterprise version by following one of the installation guides in this section (e.g. <a href="#rubygems_generic_install">RubyGems generic installation</a> or <a href="#tarball_generic_install">tarball generic installation</a>).
|
1803
|
+
</p>
|
1804
|
+
</li>
|
1805
|
+
</ol></div>
|
1806
|
+
<div class="paragraph"><p>The uninstallation is necessary because the Enterprise Ruby gem has a different gem name (<em>passenger-enterprise-server</em> instead of <em>passenger</em>), but the same administration command names (e.g. <span class="monospaced">passenger-status</span>). Uninstalling the open source version avoids any conflicts.</p></div>
|
1807
|
+
</div>
|
1808
|
+
<div class="sect2">
|
1809
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_cryptographic_verification_of_installation_files"></span><h3 data-comment-topic="cryptographic-verification-of-installation-files-85nwoi" data-anchor="_cryptographic_verification_of_installation_files">2.8. Cryptographic verification of installation files</h3>
|
1810
|
+
<div class="sect3">
|
1811
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_synopsis_2"></span><h4 data-comment-topic="synopsis-1ij8j9r" data-anchor="_synopsis_2">2.8.1. Synopsis</h4>
|
1812
|
+
<div class="paragraph"><p>We digitally sign various files with our GPG key so that you can check whether they’re legit, i.e. whether they really came from Phusion and haven’t been tampered with by a third party. We apply signing since the open source version 4.0.0 RC 4, or the Enterprise version 4.0.0 RC 1.</p></div>
|
1813
|
+
</div>
|
1814
|
+
<div class="sect3">
|
1815
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_importing_the_phusion_software_signing_key"></span><h4 data-comment-topic="importing-the-phusion-software-signing-key-1u5hkcr" data-anchor="_importing_the_phusion_software_signing_key">2.8.2. Importing the Phusion Software Signing key</h4>
|
1816
|
+
<div class="paragraph"><p>Phusion’s GPG key for signing software is as follows:</p></div>
|
1817
|
+
<div class="literalblock">
|
1818
|
+
<div class="content monospaced">
|
1819
|
+
<pre>Phusion Software Signing (software-signing@phusion.nl)
|
1820
|
+
Short key ID: 0x0A212A8C
|
1821
|
+
Long key ID: 0x2AC745A50A212A8C
|
1822
|
+
Fingerprint: D5F0 8514 2693 9232 F437 AB72 2AC7 45A5 0A21 2A8C</pre>
|
1823
|
+
</div>
|
1824
|
+
</div>
|
1825
|
+
<div class="paragraph"><p>This key is stored at <a href="http://www.phusion.nl/about/gpg">the Phusion website</a> and at the key servers <a href="http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x2AC745A50A212A8C">sks-keyservers.net</a> and <a href="http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2AC745A50A212A8C">keyserver.ubuntu.com</a>. You can import it to your keyring with one of these command:</p></div>
|
1826
|
+
<div class="listingblock">
|
1827
|
+
<div class="content monospaced">
|
1828
|
+
<pre>gpg --keyserver pool.sks-keyservers.net --search-keys 0x2AC745A50A212A8C
|
1829
|
+
# -OR-
|
1830
|
+
gpg --keyserver keyserver.ubuntu.com --search-keys 0x2AC745A50A212A8C</pre>
|
1831
|
+
</div>
|
1832
|
+
</div>
|
1833
|
+
<div class="paragraph"><p>The Phusion Software Signing key is only used for signing software. It’s never used for signing emails or for encrypting files, so please be suspicious if you encounter usage of this key outside the context of signing software, and alert us at <a href="mailto:support@phusion.nl">support@phusion.nl</a>. Include "notspam" in the message to bypass our spam filter.</p></div>
|
1834
|
+
<div class="paragraph"><p>The email address <a href="mailto:software-signing@phusion.nl">software-signing@phusion.nl</a> redirects to <a href="mailto:info@phusion.nl">info@phusion.nl</a> so it’s safe to send email there.</p></div>
|
1835
|
+
</div>
|
1836
|
+
<div class="sect3">
|
1837
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_verifying_the_phusion_software_signing_key"></span><h4 data-comment-topic="verifying-the-phusion-software-signing-key-qor1n1" data-anchor="_verifying_the_phusion_software_signing_key">2.8.3. Verifying the Phusion Software Signing key</h4>
|
1838
|
+
<div class="paragraph"><p>The Phusion Software Signing key is also <strong>signed by the Phusion founders</strong>. Their keys are as follows:</p></div>
|
1839
|
+
<div class="literalblock">
|
1840
|
+
<div class="content monospaced">
|
1841
|
+
<pre>Hongli Lai (hongli@phusion.nl)
|
1842
|
+
Short key ID: 8C59158F
|
1843
|
+
Long key ID: CD70085E8C59158F
|
1844
|
+
Fingerprint: 218A 7255 83D0 2ECE F3A9 C2A7 CD70 085E 8C59 158F</pre>
|
1845
|
+
</div>
|
1846
|
+
</div>
|
1847
|
+
<div class="literalblock">
|
1848
|
+
<div class="content monospaced">
|
1849
|
+
<pre>Ninh Bui (ninh@phusion.nl)
|
1850
|
+
Short key ID: 69481265
|
1851
|
+
Long key ID: AE405F7869481265
|
1852
|
+
Fingerprint: A77C 9CEF 766D 0E7D A95B 8778 AE40 5F78 6948 1265</pre>
|
1853
|
+
</div>
|
1854
|
+
</div>
|
1855
|
+
<div class="paragraph"><p>Both keys are stored at both sks-servers.net and keyserver.ubuntu.com. Import them with:</p></div>
|
1856
|
+
<div class="listingblock">
|
1857
|
+
<div class="content monospaced">
|
1858
|
+
<pre>gpg --keyserver pool.sks-servers.net --search-keys 0xCD70085E8C59158F
|
1859
|
+
gpg --keyserver pool.sks-servers.net --search-keys 0xAE405F7869481265
|
1860
|
+
# -OR-
|
1861
|
+
gpg --keyserver keyserver.ubuntu.com --search-keys 0xCD70085E8C59158F
|
1862
|
+
gpg --keyserver keyserver.ubuntu.com --search-keys 0xAE405F7869481265</pre>
|
1863
|
+
</div>
|
1864
|
+
</div>
|
1865
|
+
</div>
|
1866
|
+
<div class="sect3">
|
1867
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_verifying_the_gem_and_tarball"></span><h4 data-comment-topic="verifying-the-gem-and-tarball-i7tj7a" data-anchor="_verifying_the_gem_and_tarball">2.8.4. Verifying the gem and tarball</h4>
|
1868
|
+
<div class="paragraph"><p>You can find the open source version’s gem and tarball GPG signatures at <a href="https://www.phusionpassenger.com/file_releases">https://www.phusionpassenger.com/file_releases</a>. The Enterprise version’s GPG signatures can be found in the <a href="https://www.phusionpassenger.com/orders">Customer Area</a>. All signatures have the <em>.asc</em> extension. Once you have imported our key, you can verify the validity of a file against its signature as follows:</p></div>
|
1869
|
+
<div class="listingblock">
|
1870
|
+
<div class="content monospaced">
|
1871
|
+
<pre>$ gpg --verify passenger-x.x.x.tar.gz.asc passenger-x.x.x.tar.gz
|
1872
|
+
gpg: Signature made Mon Mar 11 09:45:46 2013 CET using RSA key ID 0A212A8C
|
1873
|
+
gpg: Good signature from "Phusion Software Signing <software-signing@phusion.nl>"</pre>
|
1874
|
+
</div>
|
1875
|
+
</div>
|
1876
|
+
</div>
|
1877
|
+
<div class="sect3">
|
1878
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_verifying_git_signatures"></span><h4 data-comment-topic="verifying-git-signatures-dltpan" data-anchor="_verifying_git_signatures">2.8.5. Verifying Git signatures</h4>
|
1879
|
+
<div class="paragraph"><p>Tags in the <a href="https://github.com/phusion/passenger">Git repository for the open source version</a> are also tagged. You can verify a Git tag as follows:</p></div>
|
1880
|
+
<div class="listingblock">
|
1881
|
+
<div class="content monospaced">
|
1882
|
+
<pre>$ git tag --verify release-x.x.x
|
1883
|
+
object d886f34b5705e4314feccaf0d77b9a38416e15e0
|
1884
|
+
type commit
|
1885
|
+
tag release-4.0.0.rc5
|
1886
|
+
tagger Hongli Lai (Phusion) <hongli@phusion.nl> 1362993117 +0100
|
1887
|
+
|
1888
|
+
This is a tag message.
|
1889
|
+
gpg: Signature made Mon Mar 11 10:12:02 2013 CET using RSA key ID 0A212A8C
|
1890
|
+
gpg: Good signature from "Phusion Software Signing <software-signing@phusion.nl>"</pre>
|
1891
|
+
</div>
|
1892
|
+
</div>
|
1893
|
+
</div>
|
1894
|
+
<div class="sect3">
|
1895
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_verifying_deb_and_rpm_packages"></span><h4 data-comment-topic="verifying-deb-and-rpm-packages-uga0ho" data-anchor="_verifying_deb_and_rpm_packages">2.8.6. Verifying DEB and RPM packages</h4>
|
1896
|
+
<div class="paragraph"><p>The DEB and RPM packages are signed with the signatures of the respective packagers. They are automatically checked upon installation.</p></div>
|
1897
|
+
</div>
|
1898
|
+
<div class="sect3">
|
1899
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_revocation"></span><h4 data-comment-topic="revocation-ukzeg9" data-anchor="_revocation">2.8.7. Revocation</h4>
|
1900
|
+
<div class="paragraph"><p>In the event our key is compromised, we will revoke the key and upload the revocation information to sks-servers.net and keyserver.ubuntu.com. However your system will not know about the revocation until you update the keys from the keyservers. You should update your keys regularly (e.g. once a week) by invoking:</p></div>
|
1901
|
+
<div class="listingblock">
|
1902
|
+
<div class="content monospaced">
|
1903
|
+
<pre>gpg --refresh-keys --keyserver pool.sks-servers.net
|
1904
|
+
# -OR-
|
1905
|
+
gpg --refresh-keys --keyserver keyserver.ubuntu.com</pre>
|
1906
|
+
</div>
|
1907
|
+
</div>
|
1908
|
+
<div class="paragraph"><p>If you installed Phusion Passenger through our APT repository, then you should update APT’s keyring from time to time as well:</p></div>
|
1909
|
+
<div class="listingblock">
|
1910
|
+
<div class="content monospaced">
|
1911
|
+
<pre>sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com</pre>
|
1912
|
+
</div>
|
1913
|
+
</div>
|
1914
|
+
</div>
|
1915
|
+
</div>
|
1916
|
+
<div class="sect2">
|
1917
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_customizing_the_compilation_process"></span><h3 data-comment-topic="customizing-the-compilation-process-j4xj2t" data-anchor="_customizing_the_compilation_process">2.9. Customizing the compilation process</h3>
|
1918
|
+
<div class="paragraph"><p>The Phusion Passenger compilation process can be customized with environment variables. You can learn more about environment variables in <a href="#about_environment_variables">About environment variables</a>.</p></div>
|
1919
|
+
<div class="sect3">
|
1920
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_setting_the_compiler"></span><h4 data-comment-topic="setting-the-compiler-1fxfulc" data-anchor="_setting_the_compiler">2.9.1. Setting the compiler</h4>
|
1921
|
+
<div class="paragraph"><p>You can force the Phusion Passenger build system to use a specific C or C++ compiler by setting the <span class="monospaced">CC</span> and <span class="monospaced">CXX</span> environment variables. These may be set to any arbitrary shell commands.</p></div>
|
1922
|
+
<div class="paragraph"><p>For example, contributors who want to hack on Phusion Passenger may want to use Clang for faster compilation and <a href="http://ccache.samba.org/">ccache</a> for faster recompilation, and may want to enable more error-catching compilation flags:</p></div>
|
1923
|
+
<div class="listingblock">
|
1924
|
+
<div class="content">
|
1925
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
1926
|
+
by Lorenzo Bettini
|
1927
|
+
http://www.lorenzobettini.it
|
1928
|
+
http://www.gnu.org/software/src-highlite -->
|
1929
|
+
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">CC</span><span style="color: #990000">=</span><span style="color: #FF0000">'ccache clang -fcolor-diagnostics -Qunused-arguments -fcatch-undefined-behavior -ftrapv'</span>
|
1930
|
+
<span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">CXX</span><span style="color: #990000">=</span><span style="color: #FF0000">'ccache clang++ -fcolor-diagnostics -Qunused-arguments -fcatch-undefined-behavior -ftrapv'</span></tt></pre>
|
1931
|
+
</div>
|
1932
|
+
</div>
|
1933
|
+
<div class="admonitionblock">
|
1934
|
+
<table><tr>
|
1935
|
+
<td class="icon">
|
1936
|
+
<img src="./images/icons/note.png" alt="Note">
|
1937
|
+
</td>
|
1938
|
+
<td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
|
1939
|
+
</tr></table>
|
1940
|
+
</div>
|
1941
|
+
</div>
|
1942
|
+
<div class="sect3">
|
1943
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_adding_additional_compiler_or_linker_flags"></span><h4 data-comment-topic="adding-additional-compiler-or-linker-flags-nxfour" data-anchor="_adding_additional_compiler_or_linker_flags">2.9.2. Adding additional compiler or linker flags</h4>
|
1944
|
+
<div class="paragraph"><p>On some systems, C/C++ libraries and headers that Phusion Passenger requires may be located in a non-standard directory. You can force the Phusion Passenger build system to look in those locations by injecting compiler and linker flags using the following environment variables:</p></div>
|
1945
|
+
<div class="dlist"><dl>
|
1946
|
+
<dt class="hdlist1">
|
1947
|
+
<span class="monospaced">EXTRA_PRE_CFLAGS</span>
|
1948
|
+
</dt>
|
1949
|
+
<dd>
|
1950
|
+
<p>
|
1951
|
+
These flags are injected into all C compiler invocations that involve compiling C source files. This also covers compiler invocations that compile <strong>and</strong> link. The flags are injected at the beginning of the command string, even before <span class="monospaced">EXTRA_PRE_LDFLAGS</span>.
|
1952
|
+
</p>
|
1953
|
+
</dd>
|
1954
|
+
<dt class="hdlist1">
|
1955
|
+
<span class="monospaced">EXTRA_CFLAGS</span>
|
1956
|
+
</dt>
|
1957
|
+
<dd>
|
1958
|
+
<p>
|
1959
|
+
Similar to <span class="monospaced">EXTRA_PRE_CFLAGS</span>, but injected at the end of the command string, before <span class="monospaced">EXTRA_LDFLAGS</span>.
|
1960
|
+
</p>
|
1961
|
+
</dd>
|
1962
|
+
<dt class="hdlist1">
|
1963
|
+
<span class="monospaced">EXTRA_PRE_CXXFLAGS</span>
|
1964
|
+
</dt>
|
1965
|
+
<dd>
|
1966
|
+
<p>
|
1967
|
+
Similar to <span class="monospaced">EXTRA_PRE_CFLAGS</span>, but for C++ compiler invocations.
|
1968
|
+
</p>
|
1969
|
+
</dd>
|
1970
|
+
<dt class="hdlist1">
|
1971
|
+
<span class="monospaced">EXTRA_CXXFLAGS</span>
|
1972
|
+
</dt>
|
1973
|
+
<dd>
|
1974
|
+
<p>
|
1975
|
+
Similar to <span class="monospaced">EXTRA_CFLAGS</span>, but for C++ compiler invocations.
|
1976
|
+
</p>
|
1977
|
+
</dd>
|
1978
|
+
<dt class="hdlist1">
|
1979
|
+
<span class="monospaced">EXTRA_PRE_LDFLAGS</span>
|
1980
|
+
</dt>
|
1981
|
+
<dd>
|
1982
|
+
<p>
|
1983
|
+
These flags are injected into all C/C++ compiler invocations that involve linking. This includes compiler invocations that compile <strong>and</strong> link. The flags are injected at the beginning of the command string, but after <span class="monospaced">EXTRA_PRE_CFLAGS</span>/<span class="monospaced">EXTRA_PRE_CXXFLAGS</span>.
|
1984
|
+
</p>
|
1985
|
+
</dd>
|
1986
|
+
<dt class="hdlist1">
|
1987
|
+
<span class="monospaced">EXTRA_PRE_C_LDFLAGS</span>
|
1988
|
+
</dt>
|
1989
|
+
<dd>
|
1990
|
+
<p>
|
1991
|
+
These flags are injected into all C compiler invocations that involve linking, right after <span class="monospaced">EXTRA_PRE_LDFLAGS</span>.
|
1992
|
+
</p>
|
1993
|
+
</dd>
|
1994
|
+
<dt class="hdlist1">
|
1995
|
+
<span class="monospaced">EXTRA_PRE_CXX_LDFLAGS</span>
|
1996
|
+
</dt>
|
1997
|
+
<dd>
|
1998
|
+
<p>
|
1999
|
+
Similar to <span class="monospaced">EXTRA_PRE_CXX_LDFLAGS</span>, but for C++ compiler invocations.
|
2000
|
+
</p>
|
2001
|
+
</dd>
|
2002
|
+
<dt class="hdlist1">
|
2003
|
+
<span class="monospaced">EXTRA_LDFLAGS</span>
|
2004
|
+
</dt>
|
2005
|
+
<dd>
|
2006
|
+
<p>
|
2007
|
+
Similar to <span class="monospaced">EXTRA_PRE_LDFLAGS</span>, but injected at the very end of the command string, even after <span class="monospaced">EXTRA_CFLAGS</span> and <span class="monospaced">EXTRA_CXXFLAGS</span>.
|
2008
|
+
</p>
|
2009
|
+
</dd>
|
2010
|
+
<dt class="hdlist1">
|
2011
|
+
<span class="monospaced">EXTRA_C_LDFLAGS</span>
|
2012
|
+
</dt>
|
2013
|
+
<dd>
|
2014
|
+
<p>
|
2015
|
+
Similar to <span class="monospaced">EXTRA_LDFLAGS</span>, but only injected for C executable linking commands. Injected right after <span class="monospaced">EXTRA_LDFLAGS</span>.
|
2016
|
+
</p>
|
2017
|
+
</dd>
|
2018
|
+
<dt class="hdlist1">
|
2019
|
+
<span class="monospaced">EXTRA_CXX_LDFLAGS</span>
|
2020
|
+
</dt>
|
2021
|
+
<dd>
|
2022
|
+
<p>
|
2023
|
+
Similar to <span class="monospaced">EXTRA_LDFLAGS</span>, but only injected for C++ executable linking commands. Injected right after <span class="monospaced">EXTRA_LDFLAGS</span>.
|
2024
|
+
</p>
|
2025
|
+
</dd>
|
2026
|
+
<dt class="hdlist1">
|
2027
|
+
<span class="monospaced">PASSENGER_THREAD_LOCAL_STORAGE</span>
|
2028
|
+
</dt>
|
2029
|
+
<dd>
|
2030
|
+
<p>
|
2031
|
+
Setting this to 1 will enable the <span class="monospaced">PASSENGER_THREAD_LOCAL_STORAGE</span> macro, which forcefully disables the use of thread-local storage inside the Phusion Passenger codebase. Setting this environment variable is useful on systems that have broken support for thread-local storage, despite passing our build system’s check for proper thread-local storage support. At the time of writing, one user has reported that Ubuntu 12.04 32-bit has broken thread-local storage report although neither the reporter nor us were able to reproduce the problem on any other systems running Ubuntu 12.04 32-bit. Note that this flag has no effect on non-Phusion Passenger code.
|
2032
|
+
</p>
|
2033
|
+
</dd>
|
2034
|
+
</dl></div>
|
2035
|
+
<div class="admonitionblock">
|
2036
|
+
<table><tr>
|
2037
|
+
<td class="icon">
|
2038
|
+
<img src="./images/icons/note.png" alt="Note">
|
2039
|
+
</td>
|
2040
|
+
<td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
|
2041
|
+
</tr></table>
|
2042
|
+
</div>
|
2043
|
+
</div>
|
2044
|
+
<div class="sect3">
|
2045
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="forcing_location_of_command_line_tools_and_dependencies"></span><h4 data-comment-topic="forcing-location-of-command-line-tools-and-dependencies-xajpg1" data-anchor="forcing_location_of_command_line_tools_and_dependencies">2.9.3. Forcing location of command line tools and dependencies</h4>
|
2046
|
+
<div class="paragraph"><p>The Phusion Passenger build system attempts to autodetect many things by locating relevant helper tools. For example, to find out which compiler flags it should use for compiling Apache modules, it locates the <span class="monospaced">apxs2</span> command and queries it. To find out which compiler flags it should use for libcurl, it queries the <span class="monospaced">curl-config</span> command. These commands may not be in <span class="monospaced">$PATH</span>, or even when they are you may want to use a different one.</p></div>
|
2047
|
+
<div class="paragraph"><p>You can force the build to find certain command line tools at certain locations by using the following environment variables:</p></div>
|
2048
|
+
<div class="dlist"><dl>
|
2049
|
+
<dt class="hdlist1">
|
2050
|
+
<span class="monospaced">HTTPD</span>
|
2051
|
+
</dt>
|
2052
|
+
<dd>
|
2053
|
+
<p>
|
2054
|
+
The location of the <span class="monospaced">httpd</span> executable (the Apache server executable).
|
2055
|
+
</p>
|
2056
|
+
</dd>
|
2057
|
+
<dt class="hdlist1">
|
2058
|
+
<span class="monospaced">APXS2</span>
|
2059
|
+
</dt>
|
2060
|
+
<dd>
|
2061
|
+
<p>
|
2062
|
+
The location of the <span class="monospaced">apxs2</span> executable (the Apache module developer tool). Only used by <span class="monospaced">passenger-install-apache2-module</span>.
|
2063
|
+
</p>
|
2064
|
+
<div class="paragraph"><p>This environment variable, together with <span class="monospaced">HTTPD</span>, are what you need to customize if you have multiple Apache installations on your system, or if your Apache is located in a non-standard location which Phusion Passenger cannot detect. By setting <span class="monospaced">APXS2</span> and <span class="monospaced">HTTP</span> to the right paths, you can force Phusion Passenger to be compiled against that specific Apache installation.</p></div>
|
2065
|
+
<div class="paragraph"><p>For example, if your Apache installation is located in <span class="monospaced">/opt/lamp/apache2</span>, then you can run the installer as follows:</p></div>
|
2066
|
+
<div class="listingblock">
|
2067
|
+
<div class="content monospaced">
|
2068
|
+
<pre>$ sudo bash
|
2069
|
+
# export HTTPD=/opt/lampp/apache2/bin/apache
|
2070
|
+
# export APXS2=/opt/lampp/apache2/bin/apxs
|
2071
|
+
# passenger-install-apache2-module</pre>
|
2072
|
+
</div>
|
2073
|
+
</div>
|
2074
|
+
</dd>
|
2075
|
+
<dt class="hdlist1">
|
2076
|
+
<span class="monospaced">APR_CONFIG</span>
|
2077
|
+
</dt>
|
2078
|
+
<dd>
|
2079
|
+
<p>
|
2080
|
+
The location of the <span class="monospaced">apr-config</span> executable (the Apache Portable Runtime developer tool).
|
2081
|
+
</p>
|
2082
|
+
</dd>
|
2083
|
+
<dt class="hdlist1">
|
2084
|
+
<span class="monospaced">APU_CONFIG</span>
|
2085
|
+
</dt>
|
2086
|
+
<dd>
|
2087
|
+
<p>
|
2088
|
+
The location of the <span class="monospaced">apu-config</span> executable (the Apache Portable Runtime Utility developer tool).
|
2089
|
+
</p>
|
2090
|
+
</dd>
|
2091
|
+
<dt class="hdlist1">
|
2092
|
+
<span class="monospaced">MAKE</span>
|
2093
|
+
</dt>
|
2094
|
+
<dd>
|
2095
|
+
<p>
|
2096
|
+
The location of a <span class="monospaced">make</span> tool. It does not matter which implementation of <span class="monospaced">make</span> this is.
|
2097
|
+
</p>
|
2098
|
+
</dd>
|
2099
|
+
<dt class="hdlist1">
|
2100
|
+
<span class="monospaced">GMAKE</span>
|
2101
|
+
</dt>
|
2102
|
+
<dd>
|
2103
|
+
<p>
|
2104
|
+
The location of the GNU-compatible <span class="monospaced">make</span> tool.
|
2105
|
+
</p>
|
2106
|
+
</dd>
|
2107
|
+
</dl></div>
|
2108
|
+
<div class="admonitionblock">
|
2109
|
+
<table><tr>
|
2110
|
+
<td class="icon">
|
2111
|
+
<img src="./images/icons/tip.png" alt="Tip">
|
2112
|
+
</td>
|
2113
|
+
<td class="content">If you do not know what environment variables are, or how to use them, then please read <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
|
2114
|
+
</tr></table>
|
2115
|
+
</div>
|
2116
|
+
<div class="admonitionblock">
|
2117
|
+
<table><tr>
|
2118
|
+
<td class="icon">
|
2119
|
+
<img src="./images/icons/note.png" alt="Note">
|
2120
|
+
</td>
|
2121
|
+
<td class="content">If you run the installer with <span class="monospaced">sudo</span> then environment variables may not be passed properly. Learn more at <a href="#env_vars_and_sudo">Environment variables and sudo</a>.</td>
|
2122
|
+
</tr></table>
|
2123
|
+
</div>
|
2124
|
+
</div>
|
2125
|
+
</div>
|
2126
|
+
<div class="sect2">
|
2127
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="uninstalling"></span><h3 data-comment-topic="uninstalling-3hpprb" data-anchor="uninstalling">2.10. Uninstalling</h3>
|
2128
|
+
<div class="ulist"><ul>
|
2129
|
+
<li>
|
2130
|
+
<p>
|
2131
|
+
If you installed Phusion Passenger through Homebrew, then run <span class="monospaced">brew uninstall passenger</span>.
|
2132
|
+
</p>
|
2133
|
+
</li>
|
2134
|
+
<li>
|
2135
|
+
<p>
|
2136
|
+
If you installed Phusion Passenger via a Ruby gem, then run <span class="monospaced">gem uninstall passenger</span> (or, if you’re a <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a> user, <span class="monospaced">gem uninstall passenger-enterprise-server</span>).
|
2137
|
+
You <a href="#is_ruby_home_or_system_wide_installed">might have to run this as root</a>.
|
2138
|
+
</p>
|
2139
|
+
</li>
|
2140
|
+
<li>
|
2141
|
+
<p>
|
2142
|
+
If you installed Phusion Passenger via a source tarball, then remove the directory
|
2143
|
+
in which you placed the extracted Phusion Passenger files. This directory is the
|
2144
|
+
same as the one pointed to the by <span class="monospaced">PassengerRoot</span>/<span class="monospaced">passenger_root</span> configuration directive.
|
2145
|
+
</p>
|
2146
|
+
</li>
|
2147
|
+
<li>
|
2148
|
+
<p>
|
2149
|
+
If you installed Phusion Passenger through APT or YUM, then use them to uninstall Phusion Passenger.
|
2150
|
+
</p>
|
2151
|
+
</li>
|
2152
|
+
</ul></div>
|
2153
|
+
</div>
|
2154
|
+
<div class="sect2">
|
2155
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="moving_phusion_passenger"></span><h3 data-comment-topic="moving-to-a-different-directory-b3lpy1" data-anchor="moving_phusion_passenger">2.11. Moving to a different directory</h3>
|
2156
|
+
<div class="paragraph"><p>If you installed Phusion Passenger through a tarball then you can move the Phusion Passenger directory to another location. This is not possible if you used any of the other installation methods.</p></div>
|
2157
|
+
<div class="paragraph"><p>First, move the directory to whereever you like:</p></div>
|
2158
|
+
<div class="listingblock">
|
2159
|
+
<div class="content monospaced">
|
2160
|
+
<pre>mv /opt/passenger/passenger-4.0.0 /usr/local/passenger-4.0.0</pre>
|
2161
|
+
</div>
|
2162
|
+
</div>
|
2163
|
+
<div class="paragraph"><p>If you used <a href="#tarball_generic_install">the tarball installation method</a> and you added Phusion Passenger’s <span class="monospaced">bin</span> subdirectory to <span class="monospaced">PATH</span>, then you must update your PATH with the new location. Open <span class="monospaced">/etc/bashrc</span> (or <span class="monospaced">/etc/bash.bashrc</span> on some systems) and change:</p></div>
|
2164
|
+
<div class="listingblock">
|
2165
|
+
<div class="content monospaced">
|
2166
|
+
<pre>export PATH=/opt/passenger/passenger-4.0.0/bin:$PATH</pre>
|
2167
|
+
</div>
|
2168
|
+
</div>
|
2169
|
+
<div class="paragraph"><p>to:</p></div>
|
2170
|
+
<div class="listingblock">
|
2171
|
+
<div class="content monospaced">
|
2172
|
+
<pre>export PATH=/usr/local/passenger-4.0.0/bin:$PATH</pre>
|
2173
|
+
</div>
|
2174
|
+
</div>
|
2175
|
+
<div class="paragraph"><p>Finally, restart all your shell sessions to activate the PATH change.</p></div>
|
2176
|
+
</div>
|
2177
|
+
</div>
|
2178
|
+
</div>
|
2179
|
+
<div class="sect1">
|
2180
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_usage"></span><h2 data-comment-topic="usage-1eyt33o" data-anchor="_usage">3. Usage</h2>
|
2181
|
+
<div class="sectionbody">
|
2182
|
+
<div class="paragraph"><p>Go to your application’s root directory, and run:</p></div>
|
2183
|
+
<div class="listingblock">
|
2184
|
+
<div class="content monospaced">
|
2185
|
+
<pre>passenger start</pre>
|
2186
|
+
</div>
|
2187
|
+
</div>
|
2188
|
+
</div>
|
2189
|
+
</div>
|
2190
|
+
<div class="sect1">
|
2191
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_configuration"></span><h2 data-comment-topic="configuration-10trfau" data-anchor="_configuration">4. Configuration</h2>
|
2192
|
+
<div class="sectionbody">
|
2193
|
+
<div class="sect2">
|
2194
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_command_line_options"></span><h3 data-comment-topic="command-line-options-1njv6kt" data-anchor="_command_line_options">4.1. Command line options</h3>
|
2195
|
+
<div class="paragraph"><p>Most configuration is done by customizing the arguments passed to the <span class="monospaced">passenger</span> command. The most important ones are:</p></div>
|
2196
|
+
<div class="dlist"><dl>
|
2197
|
+
<dt class="hdlist1">
|
2198
|
+
<span class="monospaced">--port NUMBER</span>
|
2199
|
+
</dt>
|
2200
|
+
<dd>
|
2201
|
+
<p>
|
2202
|
+
The port number that Phusion Passenger Standalone should listen on. If not given, port 3000 is assumed.
|
2203
|
+
</p>
|
2204
|
+
</dd>
|
2205
|
+
<dt class="hdlist1">
|
2206
|
+
<span class="monospaced">--environment NAME</span>
|
2207
|
+
</dt>
|
2208
|
+
<dd>
|
2209
|
+
<p>
|
2210
|
+
Customizes the value of the <span class="monospaced">RAILS_ENV</span>, <span class="monospaced">RACK_ENV</span>, <span class="monospaced">WSGI_ENV</span>, <span class="monospaced">NODE_ENV</span> and <span class="monospaced">PASSENGER_APP_ENV</span> environment variables. Some web frameworks, for example Rails and Connect.js, adjust their behavior according to the environment. The default value is <em>development</em>.
|
2211
|
+
</p>
|
2212
|
+
</dd>
|
2213
|
+
<dt class="hdlist1">
|
2214
|
+
<span class="monospaced">--max-pool-size NUMBER</span>
|
2215
|
+
</dt>
|
2216
|
+
<dd>
|
2217
|
+
<p>
|
2218
|
+
The maximum number of application processes to run. The maximum number that you can run depends on the amount of memory your server has. The article <a href="http://blog.phusion.nl/2013/03/12/tuning-phusion-passengers-concurrency-settings/">Tuning Phusion Passenger’s concurrency settings</a> explains how you can infer a good number for this option.
|
2219
|
+
</p>
|
2220
|
+
</dd>
|
2221
|
+
<dt class="hdlist1">
|
2222
|
+
<span class="monospaced">--min-instances NUMBER</span>
|
2223
|
+
</dt>
|
2224
|
+
<dd>
|
2225
|
+
<p>
|
2226
|
+
If you don’t want the number of application processes to scale dynamically, then use this option to set it to a value equal to <span class="monospaced">--max-pool-size</span>.
|
2227
|
+
</p>
|
2228
|
+
</dd>
|
2229
|
+
<dt class="hdlist1">
|
2230
|
+
<span class="monospaced">--spawn-method NAME</span>
|
2231
|
+
</dt>
|
2232
|
+
<dd>
|
2233
|
+
<p>
|
2234
|
+
When set to "smart" (the default), Phusion Passenger preloads your app and utilizes copy-on-write in order to save memory. You can disable this by setting this option to "direct". Preloading is only supported for Ruby apps. For apps written in other languages, it is as if "direct" is always used.
|
2235
|
+
</p>
|
2236
|
+
</dd>
|
2237
|
+
<dt class="hdlist1">
|
2238
|
+
<span class="monospaced">--friendly-error-pages</span>
|
2239
|
+
</dt>
|
2240
|
+
<dd>
|
2241
|
+
<p>
|
2242
|
+
Phusion Passenger can display a friendly error page whenever your application fails to start. The friendly error page presents the startup error message, some suggestions for solving the problem, a backtrace, and a dump of the environment variables. This feature is very useful during application development and useful for less experienced system administrators, but the page might reveal potentially sensitive information, depending on the application. For this reason, friendly error pages are turned off by default when <span class="monospaced">--environment</span> is set to <em>staging</em> or <em>production</em>, but enabled by default otherwise.
|
2243
|
+
</p>
|
2244
|
+
<div class="paragraph"><p>You can use <span class="monospaced">--friendly-error-pages</span> and <span class="monospaced">--no-friendly-error-pages</span> to explicitly enable or disable this feature, respectively.</p></div>
|
2245
|
+
</dd>
|
2246
|
+
<dt class="hdlist1">
|
2247
|
+
<span class="monospaced">--sticky-sessions</span>
|
2248
|
+
</dt>
|
2249
|
+
<dd>
|
2250
|
+
<p>
|
2251
|
+
Enables <a href="Users%20guide%20Nginx.html#PassengerStickySessions">sticky sessions</a>. Required for SockJS, Socket.io, faye-websocket and Meteor JS applications.
|
2252
|
+
</p>
|
2253
|
+
</dd>
|
2254
|
+
<dt class="hdlist1">
|
2255
|
+
<span class="monospaced">--sticky-sessions-cookie-name NAME</span>
|
2256
|
+
</dt>
|
2257
|
+
<dd>
|
2258
|
+
<p>
|
2259
|
+
Allows customizing the sticky session cookie name.
|
2260
|
+
</p>
|
2261
|
+
</dd>
|
2262
|
+
<dt class="hdlist1">
|
2263
|
+
<span class="monospaced">--ssl</span>
|
2264
|
+
</dt>
|
2265
|
+
<dd>
|
2266
|
+
<p>
|
2267
|
+
Enables SSL support. If this is set, you must also set <span class="monospaced">--ssl-certificate</span> and <span class="monospaced">--ssl-certificate-key</span> to the SSL certificate and key files, respectively.
|
2268
|
+
</p>
|
2269
|
+
</dd>
|
2270
|
+
<dt class="hdlist1">
|
2271
|
+
<span class="monospaced">--ssl-port</span>
|
2272
|
+
</dt>
|
2273
|
+
<dd>
|
2274
|
+
<p>
|
2275
|
+
If <span class="monospaced">--ssl</span> is given, and you set this option, then Phusion Passenger Standalone will listen for HTTP on the regular <span class="monospaced">--port</span> number, <strong>as well as</strong> listen for HTTPS on the port you specified with this option. For example:
|
2276
|
+
</p>
|
2277
|
+
<div class="listingblock">
|
2278
|
+
<div class="content monospaced">
|
2279
|
+
<pre># Listen for HTTP on port 3000, HTTPS on port 3001.
|
2280
|
+
passenger start --ssl --ssl-certificate ... --ssl-certificate-key ... --ssl-port 3001</pre>
|
2281
|
+
</div>
|
2282
|
+
</div>
|
2283
|
+
</dd>
|
2284
|
+
<dt class="hdlist1">
|
2285
|
+
<span class="monospaced">--nginx-config-template</span>
|
2286
|
+
</dt>
|
2287
|
+
<dd>
|
2288
|
+
<p>
|
2289
|
+
Specifies the Nginx configuration template file to use. See <a href="#advanced_configuration">Advanced configuration</a>.
|
2290
|
+
</p>
|
2291
|
+
</dd>
|
2292
|
+
</dl></div>
|
2293
|
+
<div class="paragraph"><p>See <span class="monospaced">--help</span> for all available options.</p></div>
|
2294
|
+
</div>
|
2295
|
+
<div class="sect2">
|
2296
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="config_file"></span><h3 data-comment-topic="configuration-file-xng7yp" data-anchor="config_file">4.2. Configuration file</h3>
|
2297
|
+
<div class="paragraph"><p><strong>Introduced in version 4.0.24.</strong></p></div>
|
2298
|
+
<div class="paragraph"><p>It is possible to store some options in a configuration file <span class="monospaced">Passengerfile.json</span> in the application directory. Configuration in this file overrides command line options. The configuration file format is JSON.</p></div>
|
2299
|
+
<div class="paragraph"><p>In case Passenger Standalone is in <a href="#mass_deployment">mass deployment mode</a>, such a configuration file allows customizing options on a per-application basis.</p></div>
|
2300
|
+
<div class="paragraph"><p>The following configuration options are supported:</p></div>
|
2301
|
+
<div class="dlist"><dl>
|
2302
|
+
<dt class="hdlist1">
|
2303
|
+
<span class="monospaced">port</span>
|
2304
|
+
</dt>
|
2305
|
+
<dd>
|
2306
|
+
<p>
|
2307
|
+
Equivalent to the <span class="monospaced">--port</span> command line option.
|
2308
|
+
</p>
|
2309
|
+
</dd>
|
2310
|
+
<dt class="hdlist1">
|
2311
|
+
<span class="monospaced">environment</span>
|
2312
|
+
</dt>
|
2313
|
+
<dd>
|
2314
|
+
<p>
|
2315
|
+
Equivalent to the <span class="monospaced">--environment</span> command line option.
|
2316
|
+
</p>
|
2317
|
+
</dd>
|
2318
|
+
<dt class="hdlist1">
|
2319
|
+
<span class="monospaced">max_pool_size</span>
|
2320
|
+
</dt>
|
2321
|
+
<dd>
|
2322
|
+
<p>
|
2323
|
+
Equivalent to the <span class="monospaced">--max-pool-size</span> command line option. But when in mass deployment mode, this option in the configuration file has no effect; the command line option should be used to customize this.
|
2324
|
+
</p>
|
2325
|
+
</dd>
|
2326
|
+
<dt class="hdlist1">
|
2327
|
+
<span class="monospaced">min_instances</span>
|
2328
|
+
</dt>
|
2329
|
+
<dd>
|
2330
|
+
<p>
|
2331
|
+
Equivalent to the <span class="monospaced">--min-instances</span> command line option.
|
2332
|
+
</p>
|
2333
|
+
</dd>
|
2334
|
+
<dt class="hdlist1">
|
2335
|
+
<span class="monospaced">spawn_method</span>
|
2336
|
+
</dt>
|
2337
|
+
<dd>
|
2338
|
+
<p>
|
2339
|
+
Equivalent to the <span class="monospaced">--spawn-method</span> command line option.
|
2340
|
+
</p>
|
2341
|
+
</dd>
|
2342
|
+
<dt class="hdlist1">
|
2343
|
+
<span class="monospaced">sticky_sessions</span>
|
2344
|
+
</dt>
|
2345
|
+
<dd>
|
2346
|
+
<p>
|
2347
|
+
Equivalent to the <span class="monospaced">--sticky-sessions</span> command line option.
|
2348
|
+
</p>
|
2349
|
+
</dd>
|
2350
|
+
<dt class="hdlist1">
|
2351
|
+
<span class="monospaced">sticky_sessions_cookie_name</span>
|
2352
|
+
</dt>
|
2353
|
+
<dd>
|
2354
|
+
<p>
|
2355
|
+
Equivalent to the <span class="monospaced">--sticky-sessions-cookie-name</span> command line option.
|
2356
|
+
</p>
|
2357
|
+
</dd>
|
2358
|
+
<dt class="hdlist1">
|
2359
|
+
<span class="monospaced">ssl</span>
|
2360
|
+
</dt>
|
2361
|
+
<dd>
|
2362
|
+
<p>
|
2363
|
+
Equivalent to the <span class="monospaced">--ssl</span> command line option. When given, you must also set <span class="monospaced">ssl_certificate</span> and <span class="monospaced">ssl_certificate_key</span> in the configuration file.
|
2364
|
+
</p>
|
2365
|
+
</dd>
|
2366
|
+
<dt class="hdlist1">
|
2367
|
+
<span class="monospaced">ssl_port</span>
|
2368
|
+
</dt>
|
2369
|
+
<dd>
|
2370
|
+
<p>
|
2371
|
+
Equivalent to the <span class="monospaced">--ssl-port</span> command line option.
|
2372
|
+
</p>
|
2373
|
+
<div class="paragraph"><p>When in <a href="#mass_deployment">mass deployment mode</a>, you will probably want to set a different <span class="monospaced">port</span> too. If you don’t, and you end up in a situation in which a port is used for both HTTP and HTTPS traffic, then the builtin Nginx core will abort with an error.</p></div>
|
2374
|
+
</dd>
|
2375
|
+
<dt class="hdlist1">
|
2376
|
+
<span class="monospaced">server_names</span> (Enterprise only)
|
2377
|
+
</dt>
|
2378
|
+
<dd>
|
2379
|
+
<p>
|
2380
|
+
Only relevant in <a href="#mass_deployment">mass deployment mode</a>. This option specifies which server names (host names) should be routed to this application. This option must be an array of names, e.g. <span class="monospaced">"server_names": ["foo.com", "bar.com"]</span>. By default, the name of the application directory is used as the server name. For example, for an application located in /webapps/foobar.com, "foobar.com" is used as the server name.
|
2381
|
+
</p>
|
2382
|
+
</dd>
|
2383
|
+
<dt class="hdlist1">
|
2384
|
+
<span class="monospaced">envvars</span> (since 5.0.0 RC 1)
|
2385
|
+
</dt>
|
2386
|
+
<dd>
|
2387
|
+
<p>
|
2388
|
+
Environment variables to pass to the application. This option must be a key-value map, e.g. <span class="monospaced">"envvars": { "ADMIN_EMAIL": "root@phusion.nl", "SECRET_KEY": "12345" }</span>.
|
2389
|
+
</p>
|
2390
|
+
</dd>
|
2391
|
+
<dt class="hdlist1">
|
2392
|
+
<span class="monospaced">nginx_config_template</span>
|
2393
|
+
</dt>
|
2394
|
+
<dd>
|
2395
|
+
<p>
|
2396
|
+
Equivalent to the <span class="monospaced">--nginx-config-template</span> command line option.
|
2397
|
+
</p>
|
2398
|
+
</dd>
|
2399
|
+
</dl></div>
|
2400
|
+
<div class="paragraph"><p>Here is an example configuration file:</p></div>
|
2401
|
+
<div class="listingblock">
|
2402
|
+
<div class="content">
|
2403
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2404
|
+
by Lorenzo Bettini
|
2405
|
+
http://www.lorenzobettini.it
|
2406
|
+
http://www.gnu.org/software/src-highlite -->
|
2407
|
+
<pre><tt><span style="color: #FF0000">{</span>
|
2408
|
+
<span style="color: #FF0000">"port"</span><span style="color: #990000">:</span> <span style="color: #993399">8000</span><span style="color: #990000">,</span>
|
2409
|
+
<span style="color: #FF0000">"environment"</span><span style="color: #990000">:</span> <span style="color: #FF0000">"production"</span><span style="color: #990000">,</span>
|
2410
|
+
<span style="color: #FF0000">"ssl"</span><span style="color: #990000">:</span> <span style="font-weight: bold"><span style="color: #0000FF">true</span></span><span style="color: #990000">,</span>
|
2411
|
+
<span style="color: #FF0000">"ssl_certificate"</span><span style="color: #990000">:</span> <span style="color: #FF0000">"/path-to-cert.crt"</span><span style="color: #990000">,</span>
|
2412
|
+
<span style="color: #FF0000">"ssl_certificate_key"</span><span style="color: #990000">:</span> <span style="color: #FF0000">"/path-to-cert.key"</span>
|
2413
|
+
<span style="color: #FF0000">}</span></tt></pre>
|
2414
|
+
</div>
|
2415
|
+
</div>
|
2416
|
+
</div>
|
2417
|
+
<div class="sect2">
|
2418
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="advanced_configuration"></span><h3 data-comment-topic="advanced-configuration-e3v4pk" data-anchor="advanced_configuration">4.3. Advanced configuration</h3>
|
2419
|
+
<div class="paragraph"><p><strong>Introduced in version 4.0.39.</strong></p></div>
|
2420
|
+
<div class="paragraph"><p>Phusion Passenger Standalone is built on the same technology that powers <a href="Users%20guide%20Nginx.html">Phusion Passenger for Nginx</a>, so any configuration option supported by Phusion Passenger for Nginx can be applied to Standalone as well. You can do this by editing the Standalone configuration template directly.</p></div>
|
2421
|
+
<div class="paragraph"><p>First, create a copy of the default Phusion Passenger Nginx configuration template file:</p></div>
|
2422
|
+
<div class="listingblock">
|
2423
|
+
<div class="content monospaced">
|
2424
|
+
<pre>cp $(passenger-config about resourcesdir)/templates/standalone/config.erb nginx.conf.erb</pre>
|
2425
|
+
</div>
|
2426
|
+
</div>
|
2427
|
+
<div class="paragraph"><p>Then open <span class="monospaced">nginx.conf.erb</span> and modify it as you see fit. The file is a normal Nginx configuration file, in the ERB template format.</p></div>
|
2428
|
+
<div class="paragraph"><p>Every time you start Standalone, you must pass the <span class="monospaced">--nginx-config-template</span> parameter, which tells Standalone to use your specific Nginx configuration template file. For example:</p></div>
|
2429
|
+
<div class="listingblock">
|
2430
|
+
<div class="content">
|
2431
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2432
|
+
by Lorenzo Bettini
|
2433
|
+
http://www.lorenzobettini.it
|
2434
|
+
http://www.gnu.org/software/src-highlite -->
|
2435
|
+
<pre><tt>passenger start --nginx-config-template nginx<span style="color: #990000">.</span>conf<span style="color: #990000">.</span>erb</tt></pre>
|
2436
|
+
</div>
|
2437
|
+
</div>
|
2438
|
+
<div class="paragraph"><p>Alternatively, if you don’t want to pass this parameter every time, you can also set the <span class="monospaced">nginx_config_template</span> option in <a href="#config_file">Passengerfile.json</a>.</p></div>
|
2439
|
+
<div class="admonitionblock">
|
2440
|
+
<table><tr>
|
2441
|
+
<td class="icon">
|
2442
|
+
<img src="./images/icons/note.png" alt="Note">
|
2443
|
+
</td>
|
2444
|
+
<td class="content">The original configuration template file may change from time to time, e.g. because new features are introduced into Phusion Passenger. If your configuration template file does not contain the required changes, then these new features may not work properly. In the worst case, Standalone might even malfunction. Therefore, every time you upgrade Phusion Passenger, you should check whether the original configuration template file has changed, and merge back any changes into your own file.</td>
|
2445
|
+
</tr></table>
|
2446
|
+
</div>
|
2447
|
+
</div>
|
2448
|
+
</div>
|
2449
|
+
</div>
|
2450
|
+
<div class="sect1">
|
2451
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_using_passenger_standalone_in_production"></span><h2 data-comment-topic="using-passenger-standalone-in-production-1i7yjcz" data-anchor="_using_passenger_standalone_in_production">5. Using Passenger Standalone in production</h2>
|
2452
|
+
<div class="sectionbody">
|
2453
|
+
<div class="sect2">
|
2454
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="starting_at_system_boot"></span><h3 data-comment-topic="starting-passenger-standalone-at-system-boot-jpem2b" data-anchor="starting_at_system_boot">5.1. Starting Passenger Standalone at system boot</h3>
|
2455
|
+
<div class="paragraph"><p>The easiest way to have Passenger Standalone started during system boot is add it to the file <span class="monospaced">/etc/rc.local</span>. This script is called during system boot.</p></div>
|
2456
|
+
<div class="paragraph"><p>Here’s an example of what you may want to add to <span class="monospaced">/etc/rc.local</span>. If there is an <span class="monospaced">exit</span> command in <span class="monospaced">rc.local</span>, make sure you add these <em>before</em> the <span class="monospaced">exit</span> command.</p></div>
|
2457
|
+
<div class="listingblock">
|
2458
|
+
<div class="content">
|
2459
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2460
|
+
by Lorenzo Bettini
|
2461
|
+
http://www.lorenzobettini.it
|
2462
|
+
http://www.gnu.org/software/src-highlite -->
|
2463
|
+
<pre><tt><span style="font-style: italic"><span style="color: #9A1900"># If you installed Phusion Passenger from tarball, add its `bin` directory to PATH.</span></span>
|
2464
|
+
<span style="font-style: italic"><span style="color: #9A1900">#export PATH=/path-to-passenger/bin:$PATH</span></span>
|
2465
|
+
|
2466
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Change working directory to your webapp.</span></span>
|
2467
|
+
cd /path-to-your-webapp
|
2468
|
+
|
2469
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Start Passenger Standalone in daemonized mode. Passenger will be started as</span></span>
|
2470
|
+
<span style="font-style: italic"><span style="color: #9A1900"># root when run from this file, so we also tell it to drop its privileges to a</span></span>
|
2471
|
+
<span style="font-style: italic"><span style="color: #9A1900"># normal user. Replace 'someusername' with the user you want to run your</span></span>
|
2472
|
+
<span style="font-style: italic"><span style="color: #9A1900"># application under.</span></span>
|
2473
|
+
passenger start --daemonize --port <span style="color: #993399">80</span> --user someusername</tt></pre>
|
2474
|
+
</div>
|
2475
|
+
</div>
|
2476
|
+
<div class="paragraph"><p>To stop Passenger Standalone, run:</p></div>
|
2477
|
+
<div class="listingblock">
|
2478
|
+
<div class="content">
|
2479
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2480
|
+
by Lorenzo Bettini
|
2481
|
+
http://www.lorenzobettini.it
|
2482
|
+
http://www.gnu.org/software/src-highlite -->
|
2483
|
+
<pre><tt>cd /path-to-your-webapp
|
2484
|
+
|
2485
|
+
<span style="font-style: italic"><span style="color: #9A1900"># If you use RVM, use 'rvmsudo' instead of 'sudo'</span></span>
|
2486
|
+
sudo passenger stop</tt></pre>
|
2487
|
+
</div>
|
2488
|
+
</div>
|
2489
|
+
</div>
|
2490
|
+
<div class="sect2">
|
2491
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="sharing_port"></span><h3 data-comment-topic="sharing-the-same-port-between-multiple-passenger-standalone-instances-3lcmc5" data-anchor="sharing_port">5.2. Sharing the same port between multiple Passenger Standalone instances</h3>
|
2492
|
+
<div class="paragraph"><p>If you have multiple applications on your server then it is desirable to have all of them listen on the same port (e.g. port 80), with the HTTP request’s host name determining which Passenger Standalone instance should handle the request. There are three ways to achieve this.</p></div>
|
2493
|
+
<div class="olist arabic"><ol class="arabic">
|
2494
|
+
<li>
|
2495
|
+
<p>
|
2496
|
+
The first way is to use the <a href="#mass_deployment">Mass deployment</a> feature, which allows Passenger Standalone to directly host multiple applications at the same time. Please refer to that section to learn more.
|
2497
|
+
</p>
|
2498
|
+
</li>
|
2499
|
+
<li>
|
2500
|
+
<p>
|
2501
|
+
The second way is to run multiple Passenger Standalone instances — one for each application — and to put all of them behind a <strong>reverse proxy</strong> or <strong>load balancer</strong>. The reverse proxy/load balancer can for example be Nginx, Apache or HAProxy. The reverse proxy/load balancer listens on port 80, determines which Passenger Standalone instance should handle the request, and forwards the request to that instance.
|
2502
|
+
</p>
|
2503
|
+
</li>
|
2504
|
+
<li>
|
2505
|
+
<p>
|
2506
|
+
The third way is to use <a href="Users%20guide%20Nginx.html">Phusion Passenger for Nginx</a> or <a href="Users%20guide%20Apache.html">Phusion Passenger for Apache</a>. These are two modes of Phusion Passenger that are distinct from the Standalone mode, which this document describes. In the Nginx and Apache modes, Phusion Passenger integrates directly into Nginx and Apache, and makes it very easy to host multiple applications directly on Nginx or Apache.
|
2507
|
+
</p>
|
2508
|
+
<div class="paragraph"><p>Compared method 2 — putting Passenger Standalone behind a reverse proxy or load balancer — the Nginx or Apache modes are easier to use and require less configuration. On the other hand, the Nginx modes requires reinstalling or recompiling Nginx, while the Apache mode requires that the Phusion Passenger Apache module is installed.</p></div>
|
2509
|
+
</li>
|
2510
|
+
</ol></div>
|
2511
|
+
<div class="paragraph"><p><strong>The rest of this subsection describes method 2.</strong></p></div>
|
2512
|
+
<span class="anchor_helper" id="_step_1_starting_all_applications"></span><h4 class="float" data-anchor="_step_1_starting_all_applications">Step 1: starting all applications</h4>
|
2513
|
+
<div class="paragraph"><p>Putting Passenger Standalone behind a reverse proxy requires three steps. First, you must start all Passenger Standalone instances that you want. Each one must be listening on a different port, because two applications can’t listen on the same port. Suppose that you have two applications, <span class="monospaced">/webapps/foo</span> and <span class="monospaced">/webapps/bar</span>. Here’s how you may start them:</p></div>
|
2514
|
+
<div class="listingblock">
|
2515
|
+
<div class="content">
|
2516
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2517
|
+
by Lorenzo Bettini
|
2518
|
+
http://www.lorenzobettini.it
|
2519
|
+
http://www.gnu.org/software/src-highlite -->
|
2520
|
+
<pre><tt><span style="font-style: italic"><span style="color: #9A1900"># Start foo on port 4000</span></span>
|
2521
|
+
cd /webapps/foo
|
2522
|
+
passenger start --daemonize --address <span style="color: #993399">127.0</span><span style="color: #990000">.</span><span style="color: #993399">0.1</span> --port <span style="color: #993399">4000</span>
|
2523
|
+
|
2524
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Start bar on port 4010</span></span>
|
2525
|
+
cd /webapps/bar
|
2526
|
+
passenger start --daemonize --address <span style="color: #993399">127.0</span><span style="color: #990000">.</span><span style="color: #993399">0.1</span> --port <span style="color: #993399">4010</span></tt></pre>
|
2527
|
+
</div>
|
2528
|
+
</div>
|
2529
|
+
<div class="paragraph"><p>Notice the fact that we pass <span class="monospaced">--address 127.0.0.1</span>, which tells Passenger Standalone to only listen for requests that originate from the local machine. This is because the reverse proxy/load balancer, not Passenger Standalone, is supposed to be responsible for receiving external HTTP requests. The reverse proxy/load balancer will be running on the same machine only, so limiting Passenger Standalone in this manner improves security.</p></div>
|
2530
|
+
<span class="anchor_helper" id="_step_2_install_and_configure_the_reverse_proxy_load_balancer"></span><h4 class="float" data-anchor="_step_2_install_and_configure_the_reverse_proxy_load_balancer">Step 2: install and configure the reverse proxy/load balancer</h4>
|
2531
|
+
<div class="paragraph"><p>The next step is to <strong>install a reverse proxy/load balancer</strong>, and to <strong>configure</strong> it to do the following:</p></div>
|
2532
|
+
<div class="ulist"><ul>
|
2533
|
+
<li>
|
2534
|
+
<p>
|
2535
|
+
To listen on port 80.
|
2536
|
+
</p>
|
2537
|
+
</li>
|
2538
|
+
<li>
|
2539
|
+
<p>
|
2540
|
+
To forward requests to either <em>foo</em> or <em>bar</em>, depending on the request’s HTTP host name.
|
2541
|
+
</p>
|
2542
|
+
</li>
|
2543
|
+
</ul></div>
|
2544
|
+
<div class="paragraph"><p>You can use any reverse proxy/load balancer you want, but we’re going to show an example using <a href="http://www.nginx.org/">Nginx</a> because it’s a pretty popular choice. Install Nginx as follows:</p></div>
|
2545
|
+
<table class="tableblock frame-all grid-all" style="
|
2546
|
+
width:100%;
|
2547
|
+
">
|
2548
|
+
<col style="width:50%;">
|
2549
|
+
<col style="width:50%;">
|
2550
|
+
<tbody>
|
2551
|
+
<tr>
|
2552
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td>
|
2553
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo apt-get update</span><br>
|
2554
|
+
<span class="monospaced">sudo apt-get install nginx-extras</span></p></td>
|
2555
|
+
</tr>
|
2556
|
+
<tr>
|
2557
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td>
|
2558
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Enable <a href="http://fedoraproject.org/wiki/EPEL">EPEL</a>, then run as root:<br>
|
2559
|
+
<span class="monospaced">yum install nginx</span></p></td>
|
2560
|
+
</tr>
|
2561
|
+
<tr>
|
2562
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X (Homebrew)</p></td>
|
2563
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">brew install nginx</span></p></td>
|
2564
|
+
</tr>
|
2565
|
+
<tr>
|
2566
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td>
|
2567
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Install Nginx from <a href="http://www.nginx.org/">the Nginx website</a>.</p></td>
|
2568
|
+
</tr>
|
2569
|
+
</tbody>
|
2570
|
+
</table>
|
2571
|
+
<div class="paragraph"><p>Open the Nginx configuration file:</p></div>
|
2572
|
+
<table class="tableblock frame-all grid-all" style="
|
2573
|
+
width:100%;
|
2574
|
+
">
|
2575
|
+
<col style="width:50%;">
|
2576
|
+
<col style="width:50%;">
|
2577
|
+
<tbody>
|
2578
|
+
<tr>
|
2579
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td>
|
2580
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">/etc/nginx/nginx.conf</span></p></td>
|
2581
|
+
</tr>
|
2582
|
+
<tr>
|
2583
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td>
|
2584
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">/etc/nginx/nginx.conf</span></p></td>
|
2585
|
+
</tr>
|
2586
|
+
<tr>
|
2587
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X (Homebrew)</p></td>
|
2588
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">/usr/local/etc/nginx/nginx.conf</span></p></td>
|
2589
|
+
</tr>
|
2590
|
+
<tr>
|
2591
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td>
|
2592
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">It depends on how you installed Nginx, but it’s usually <span class="monospaced">$PREFIX/conf/nginx.conf</span>, where <span class="monospaced">$PREFIX</span> is the prefix you installed Nginx to.</p></td>
|
2593
|
+
</tr>
|
2594
|
+
</tbody>
|
2595
|
+
</table>
|
2596
|
+
<div class="paragraph"><p>Add virtual host entries for your applications foo and bar. While making the virtual host entries, you must determine what host names foo and bar should respond to. Let’s say that foo should respond to <em>www.foo.com</em> and bar should respond to <em>www.bar.com</em>. Then the following entries will tell Nginx to listen on port 80, and to handle requests for the domains <em>www.foo.com</em> and <em>www.bar.com</em> differently.</p></div>
|
2597
|
+
<div class="listingblock">
|
2598
|
+
<div class="content monospaced">
|
2599
|
+
<pre>http {
|
2600
|
+
...
|
2601
|
+
|
2602
|
+
# These are some "magic" Nginx configuration options that aid in making
|
2603
|
+
# WebSockets work properly with Passenger Standalone. Please learn more
|
2604
|
+
# at http://nginx.org/en/docs/http/websocket.html
|
2605
|
+
map $http_upgrade $connection_upgrade {
|
2606
|
+
default upgrade;
|
2607
|
+
'' close;
|
2608
|
+
}
|
2609
|
+
|
2610
|
+
server {
|
2611
|
+
listen 80;
|
2612
|
+
server_name www.foo.com;
|
2613
|
+
|
2614
|
+
# Tells Nginx to serve static assets from this directory.
|
2615
|
+
root /webapps/foo/public;
|
2616
|
+
|
2617
|
+
location / {
|
2618
|
+
# Tells Nginx to forward all requests for www.foo.com
|
2619
|
+
# to the Passenger Standalone instance listening on port 4000.
|
2620
|
+
proxy_pass http://127.0.0.1:4000;
|
2621
|
+
|
2622
|
+
# These are "magic" Nginx configuration options that
|
2623
|
+
# should be present in order to make the reverse proxying
|
2624
|
+
# work properly. Also contains some options that make WebSockets
|
2625
|
+
# work properly with Passenger Standalone. Please learn more at
|
2626
|
+
# http://nginx.org/en/docs/http/ngx_http_proxy_module.html
|
2627
|
+
proxy_http_version 1.1;
|
2628
|
+
proxy_set_header Host $http_host;
|
2629
|
+
proxy_set_header Upgrade $http_upgrade;
|
2630
|
+
proxy_set_header Connection $connection_upgrade;
|
2631
|
+
proxy_buffering off;
|
2632
|
+
}
|
2633
|
+
}
|
2634
|
+
|
2635
|
+
# We handle bar in a similar manner.
|
2636
|
+
server {
|
2637
|
+
listen 80;
|
2638
|
+
server_name www.bar.com;
|
2639
|
+
|
2640
|
+
root /webapps/bar/public;
|
2641
|
+
|
2642
|
+
location / {
|
2643
|
+
# bar is listening on port 4010 instead of 4000, we
|
2644
|
+
# change the URL here.
|
2645
|
+
proxy_pass http://127.0.0.1:4010;
|
2646
|
+
|
2647
|
+
proxy_http_version 1.1;
|
2648
|
+
proxy_set_header Host $http_host;
|
2649
|
+
proxy_set_header Upgrade $http_upgrade;
|
2650
|
+
proxy_set_header Connection $connection_upgrade;
|
2651
|
+
proxy_buffering off;
|
2652
|
+
}
|
2653
|
+
}
|
2654
|
+
}</pre>
|
2655
|
+
</div>
|
2656
|
+
</div>
|
2657
|
+
<div class="paragraph"><p>Once you’re done editing the Nginx configuration file, restart Nginx:</p></div>
|
2658
|
+
<table class="tableblock frame-all grid-all" style="
|
2659
|
+
width:100%;
|
2660
|
+
">
|
2661
|
+
<col style="width:50%;">
|
2662
|
+
<col style="width:50%;">
|
2663
|
+
<tbody>
|
2664
|
+
<tr>
|
2665
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Debian, Ubuntu</p></td>
|
2666
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo /etc/init.d/nginx restart</span></p></td>
|
2667
|
+
</tr>
|
2668
|
+
<tr>
|
2669
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Red Hat, CentOS, ScientificLinux, Amazon Linux</p></td>
|
2670
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><span class="monospaced">sudo service nginx restart</span></p></td>
|
2671
|
+
</tr>
|
2672
|
+
<tr>
|
2673
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Mac OS X (Homebrew)</p></td>
|
2674
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">1. Run <span class="monospaced">sudo kill $(cat /usr/local/var/run/nginx.pid)</span><br>
|
2675
|
+
2. You you installed the Nginx launchd plist that Homebrew provides (see <span class="monospaced">brew info nginx</span> to learn more), then you don’t have to do anything, and launchd will automatically restart Nginx. Otherwise, you have to manually start Nginx again: <span class="monospaced">sudo /usr/local/bin/nginx</span>.</p></td>
|
2676
|
+
</tr>
|
2677
|
+
<tr>
|
2678
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Other operating systems</p></td>
|
2679
|
+
<td class="tableblock halign-left valign-top">
|
2680
|
+
<p class="tableblock">It depends on how you installed Nginx, but it’s usually as follows:</p>
|
2681
|
+
<p class="tableblock"> 1. Lookup the PID of the Nginx master process using <span class="monospaced">ps aux</span>.<br>
|
2682
|
+
2. Run <span class="monospaced">sudo kill <PID></span><br>
|
2683
|
+
3. Start Nginx again: <span class="monospaced">sudo $PREFIX/sbin/nginx</span>, where <span class="monospaced">$PREFIX</span> is the prefix you installed Nginx to.</p>
|
2684
|
+
</td>
|
2685
|
+
</tr>
|
2686
|
+
</tbody>
|
2687
|
+
</table>
|
2688
|
+
<span class="anchor_helper" id="_step_3_testing"></span><h4 class="float" data-anchor="_step_3_testing">Step 3: testing</h4>
|
2689
|
+
<div class="paragraph"><p>Nginx should now be listening on port 80, and should forward requests to foo and bar respectively. Let’s test it out by accessing <a href="http://www.foo.com">http://www.foo.com</a> and <a href="http://www.bar.com">http://www.bar.com</a>. But first, we need to ensure that any requests to <em>www.foo.com</em> and <em>www.bar.com</em>, that originate from the local machine, actually end up at the local host, and not at the IP address specified in the DNS records. To do this, edit <span class="monospaced">/etc/hosts</span> and add:</p></div>
|
2690
|
+
<div class="listingblock">
|
2691
|
+
<div class="content monospaced">
|
2692
|
+
<pre>127.0.0.1 www.foo.com www.bar.com</pre>
|
2693
|
+
</div>
|
2694
|
+
</div>
|
2695
|
+
<div class="paragraph"><p>Now visit <a href="http://www.foo.com">http://www.foo.com</a> and <a href="http://www.bar.com">http://www.bar.com</a>, and verify that it works.</p></div>
|
2696
|
+
<span class="anchor_helper" id="_step_4_making_all_apps_start_at_system_boot"></span><h4 class="float" data-anchor="_step_4_making_all_apps_start_at_system_boot">Step 4: making all apps start at system boot</h4>
|
2697
|
+
<div class="paragraph"><p>Once you restart the server, the reverse proxy/load balancer will no longer be able to serve <em>www.foo.com</em> or <em>www.bar.com</em> because the Passenger Standalone instances that host them are no longer running. You must therefore configure the system to start Passenger Standalone at system boot. Please refer to <a href="#starting_at_system_boot">Starting Passenger Standalone at system boot</a> for more information.</p></div>
|
2698
|
+
<div class="paragraph"><p>For example, you can put this in <span class="monospaced">/etc/rc.local</span> to make the system start foo and bar at system boot:</p></div>
|
2699
|
+
<div class="listingblock">
|
2700
|
+
<div class="content">
|
2701
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2702
|
+
by Lorenzo Bettini
|
2703
|
+
http://www.lorenzobettini.it
|
2704
|
+
http://www.gnu.org/software/src-highlite -->
|
2705
|
+
<pre><tt><span style="font-style: italic"><span style="color: #9A1900"># If you installed Phusion Passenger from tarball, add its `bin` directory to PATH.</span></span>
|
2706
|
+
<span style="font-style: italic"><span style="color: #9A1900">#export PATH=/path-to-passenger/bin:$PATH</span></span>
|
2707
|
+
|
2708
|
+
cd /webapps/foo
|
2709
|
+
passenger start --daemonize --port <span style="color: #993399">4000</span> --user someusername1
|
2710
|
+
|
2711
|
+
cd /webapps/bar
|
2712
|
+
passenger start --daemonize --port <span style="color: #993399">4010</span> --user someusername2</tt></pre>
|
2713
|
+
</div>
|
2714
|
+
</div>
|
2715
|
+
<span class="anchor_helper" id="_step_5_wrapping_up"></span><h4 class="float" data-anchor="_step_5_wrapping_up">Step 5: wrapping up</h4>
|
2716
|
+
<div class="paragraph"><p>Edit <span class="monospaced">/etc/hosts</span> and remove the entry that you added in step 3.</p></div>
|
2717
|
+
</div>
|
2718
|
+
<div class="sect2">
|
2719
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_installing_passenger_standalone_behind_nginx"></span><h3 data-comment-topic="installing-passenger-standalone-behind-nginx-1xylsfk" data-anchor="_installing_passenger_standalone_behind_nginx">5.3. Installing Passenger Standalone behind Nginx</h3>
|
2720
|
+
<div class="paragraph"><p>This is described in <a href="#sharing_port">Sharing the same port between multiple Passenger Standalone instances</a>.</p></div>
|
2721
|
+
</div>
|
2722
|
+
</div>
|
2723
|
+
</div>
|
2724
|
+
<div class="sect1">
|
2725
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="mass_deployment"></span><h2 data-comment-topic="mass-deployment-1xqriy4" data-anchor="mass_deployment">6. Mass deployment</h2>
|
2726
|
+
<div class="sectionbody">
|
2727
|
+
<div class="paragraph"><p><strong>This feature is only available in <a href="https://www.phusionpassenger.com/enterprise">Phusion Passenger Enterprise</a>. It was introduced in version 3.0.0. <a href="https://www.phusionpassenger.com/download">Buy Phusion Passenger Enterprise here.</a></strong></p></div>
|
2728
|
+
<div class="paragraph"><p>Mass deployment is a special mode in Phusion Passenger Standalone that allows you to deploy multiple web applications without having to create configuration entries for each one of them. Given a directory with multiple web applications, Passenger Standalone will automatically give each web application its own virtual host entry, and serve all of them from a single server. The virtual host’s server name is equal to the web application’s directory name. Whenever a new web application is added or removed, Passenger Standalone automatically reconfigures itself without administrator intervention. This makes the mass deployment mode especially useful when there are a large number of web applications.</p></div>
|
2729
|
+
<div class="paragraph"><p>For example, suppose we have a directory <span class="monospaced">/webapps</span> with three web applications: Ruby app, a Python app and a Node.js app.</p></div>
|
2730
|
+
<div class="listingblock">
|
2731
|
+
<div class="content monospaced">
|
2732
|
+
<pre>/webapps
|
2733
|
+
|
|
2734
|
+
+-- rubyapp.com
|
2735
|
+
| |
|
2736
|
+
| +-- config.ru
|
2737
|
+
|
|
2738
|
+
+-- pythonapp.com
|
2739
|
+
| |
|
2740
|
+
| +-- passenger_wsgi.py
|
2741
|
+
|
|
2742
|
+
+-- nodeapp.com
|
2743
|
+
|
|
2744
|
+
+-- app.js</pre>
|
2745
|
+
</div>
|
2746
|
+
</div>
|
2747
|
+
<div class="paragraph"><p>You can activate Passenger Standalone in mass deployment mode by changing the working directory to <span class="monospaced">/webapps</span> and running <span class="monospaced">passenger start</span>:</p></div>
|
2748
|
+
<div class="listingblock">
|
2749
|
+
<div class="content monospaced">
|
2750
|
+
<pre>$ cd /webapps
|
2751
|
+
$ passenger start
|
2752
|
+
=============== Phusion Passenger Standalone web server started ===============
|
2753
|
+
PID file: /webapps/passenger.3000.pid
|
2754
|
+
Log file: /webapps/passenger.3000.log
|
2755
|
+
Environment: development
|
2756
|
+
|
2757
|
+
Serving these applications on 0.0.0.0 port 3000:
|
2758
|
+
Host name Directory
|
2759
|
+
.-----------------------------------------------------------
|
2760
|
+
rubyapp.com /webapps/rubyapp.com
|
2761
|
+
pythonapp.com /webapps/pythonapp.com
|
2762
|
+
nodeapp.com /webapps/nodeapp.com
|
2763
|
+
.-----------------------------------------------------------</pre>
|
2764
|
+
</div>
|
2765
|
+
</div>
|
2766
|
+
<div class="paragraph"><p>If you for example remove <span class="monospaced">/webapps/rubyapp.com</span>, Passenger Standalone will reconfigure itself without that web application. Or if you add a new web applications <span class="monospaced">/webapps/newapp.org</span>, Passenger Standalone will reconfigure itself with that web application.</p></div>
|
2767
|
+
<div class="paragraph"><p>Any options that you pass to the <span class="monospaced">passenger</span> command will affect all deployed web applications. It is also possible to change options on a per-application basis through the use of <a href="#config_file">a <span class="monospaced">Passengerfile.json</span> file inside each application’s directory</a>.</p></div>
|
2768
|
+
</div>
|
2769
|
+
</div>
|
2770
|
+
<div class="sect1">
|
2771
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="troubleshooting"></span><h2 data-comment-topic="troubleshooting-o7g75o" data-anchor="troubleshooting">7. Troubleshooting</h2>
|
2772
|
+
<div class="sectionbody">
|
2773
|
+
<div class="sect2">
|
2774
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_generic_troubleshooting_tips"></span><h3 data-comment-topic="generic-troubleshooting-tips-2vokcr" data-anchor="_generic_troubleshooting_tips">7.1. Generic troubleshooting tips</h3>
|
2775
|
+
<div class="paragraph"><p>One of the first things you should do upon encountering a problem, is to check
|
2776
|
+
Phusion Passenger Standalone log file. This is typically located in <span class="monospaced">log/passenger.[PORT NUMBER].log</span>. Most problems are logged to this log file.</p></div>
|
2777
|
+
<div class="paragraph"><p>If neither the logs nor this troubleshooting guide can help you, then please check out our <a href="#where_to_get_support">support resources</a>.</p></div>
|
2778
|
+
</div>
|
2779
|
+
<div class="sect2">
|
2780
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_upon_uploading_a_file_phusion_passenger_reports_client_body_temp_00000000xx_failed_2_no_such_file_or_directory"></span><h3 data-comment-topic="upon-uploading-a-file-phusion-passenger-reports-client-body-temp-00000000xx-failed-2-no-such-file-or-directory--d01goe" data-anchor="_upon_uploading_a_file_phusion_passenger_reports_client_body_temp_00000000xx_failed_2_no_such_file_or_directory">7.2. Upon uploading a file, Phusion Passenger reports "client_body_temp/00000000xx failed (2: No such file or directory)"</h3>
|
2781
|
+
<div class="dlist"><dl>
|
2782
|
+
<dt class="hdlist1">
|
2783
|
+
<strong>Symptoms</strong>
|
2784
|
+
</dt>
|
2785
|
+
<dd>
|
2786
|
+
<p>
|
2787
|
+
When performing an HTTP POST call, the request sometimes fails, with Phusion Passenger reporting an error along the lines of:
|
2788
|
+
</p>
|
2789
|
+
<div class="listingblock">
|
2790
|
+
<div class="content monospaced">
|
2791
|
+
<pre>/tmp/passenger-standalone.8583/client_body_temp/0000000022" failed (2: No such
|
2792
|
+
file or directory), client: 127.0.0.1, server: www.foo.com</pre>
|
2793
|
+
</div>
|
2794
|
+
</div>
|
2795
|
+
</dd>
|
2796
|
+
<dt class="hdlist1">
|
2797
|
+
<strong>Cause</strong>
|
2798
|
+
</dt>
|
2799
|
+
<dd>
|
2800
|
+
<p>
|
2801
|
+
Phusion Passenger buffers HTTP POST bodies (file uploads) to a temporary directory, by default <span class="monospaced">/tmp/passenger-standalone.xxx</span>. This error means that Phusion Passenger that that directory has been removed, probably by some other program.
|
2802
|
+
</p>
|
2803
|
+
</dd>
|
2804
|
+
<dt class="hdlist1">
|
2805
|
+
<strong>Solution</strong>
|
2806
|
+
</dt>
|
2807
|
+
<dd>
|
2808
|
+
<p>
|
2809
|
+
Tell Phusion Passenger to use a different directory to store its temporary files passing the <span class="monospaced">--temp-dir</span> command line option. For example:
|
2810
|
+
</p>
|
2811
|
+
<div class="listingblock">
|
2812
|
+
<div class="content monospaced">
|
2813
|
+
<pre>mkdir $HOME/tmp
|
2814
|
+
cd /path-to-your-app
|
2815
|
+
passenger start --temp-dir=$HOME/tmp</pre>
|
2816
|
+
</div>
|
2817
|
+
</div>
|
2818
|
+
</dd>
|
2819
|
+
</dl></div>
|
2820
|
+
</div>
|
2821
|
+
<div class="sect2">
|
2822
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_i_get_command_not_found_when_running_a_phusion_passenger_command_through_sudo"></span><h3 data-comment-topic="i-get-command-not-found-when-running-a-phusion-passenger-command-through-sudo-14k8kde" data-anchor="_i_get_command_not_found_when_running_a_phusion_passenger_command_through_sudo">7.3. I get "command not found" when running a Phusion Passenger command through sudo</h3>
|
2823
|
+
<div class="dlist"><dl>
|
2824
|
+
<dt class="hdlist1">
|
2825
|
+
<strong>Symptoms</strong>
|
2826
|
+
</dt>
|
2827
|
+
<dd>
|
2828
|
+
<p>
|
2829
|
+
Phusion Passenger commands can be found as a normal user, but not when run through sudo:
|
2830
|
+
</p>
|
2831
|
+
<div class="listingblock">
|
2832
|
+
<div class="content monospaced">
|
2833
|
+
<pre>$ passenger-status
|
2834
|
+
...some output, but no "command not found" error...
|
2835
|
+
$ passenger-install-apache2-module
|
2836
|
+
...some output, but no "command not found" error...
|
2837
|
+
$ sudo passenger-status
|
2838
|
+
sudo: passenger-status: command not found
|
2839
|
+
$ sudo passenger-install-apache2-module
|
2840
|
+
sudo: passenger-install-apache2-module: command not found</pre>
|
2841
|
+
</div>
|
2842
|
+
</div>
|
2843
|
+
</dd>
|
2844
|
+
<dt class="hdlist1">
|
2845
|
+
<strong>Cause</strong>
|
2846
|
+
</dt>
|
2847
|
+
<dd>
|
2848
|
+
<p>
|
2849
|
+
The operating system looks up commands using <a href="#the_path_env_var">the PATH environment variable</a>. However, sudo resets all environment variables to a default value, dictated by sudo. If Phusion Passenger was installed to a location that is not in the default sudo PATH value, then sudo will not be able to find the Phusion Passenger commands.
|
2850
|
+
</p>
|
2851
|
+
<div class="paragraph"><p>In addition, if you installed Phusion Passenger using a Ruby interpreter that was installed through RVM, then you <strong>must</strong> use rvmsudo instead of sudo. As a rule, when you’re an RVM user, always use rvmsudo instead of sudo.</p></div>
|
2852
|
+
</dd>
|
2853
|
+
<dt class="hdlist1">
|
2854
|
+
<strong>Solution</strong>
|
2855
|
+
</dt>
|
2856
|
+
<dd>
|
2857
|
+
<p>
|
2858
|
+
Execute the command using its full path. You can use <span class="monospaced">which</span> as a normal user to lookup the full path:
|
2859
|
+
</p>
|
2860
|
+
<div class="listingblock">
|
2861
|
+
<div class="content monospaced">
|
2862
|
+
<pre>$ which passenger-status
|
2863
|
+
/somewhere/bin/passenger-status</pre>
|
2864
|
+
</div>
|
2865
|
+
</div>
|
2866
|
+
<div class="paragraph"><p>Next, run full path of the command using either sudo or rvmsudo:</p></div>
|
2867
|
+
<div class="listingblock">
|
2868
|
+
<div class="content monospaced">
|
2869
|
+
<pre>$ sudo /somewhere/bin/passenger-status
|
2870
|
+
|
2871
|
+
# -OR, if you're using RVM:-
|
2872
|
+
|
2873
|
+
$ rvmsudo /somewhere/bin/passenger-status</pre>
|
2874
|
+
</div>
|
2875
|
+
</div>
|
2876
|
+
</dd>
|
2877
|
+
<dt class="hdlist1">
|
2878
|
+
<strong>Recommended reading</strong>
|
2879
|
+
</dt>
|
2880
|
+
<dd>
|
2881
|
+
<p>
|
2882
|
+
When using sudo, you will probably run into similar "command not found" issues in the future, with components other than Phusion Passenger. We <strong>strongly recommend</strong> you to <a href="#about_environment_variables">learn about environment variables</a> so that you know what to do in the future.
|
2883
|
+
</p>
|
2884
|
+
</dd>
|
2885
|
+
</dl></div>
|
2886
|
+
</div>
|
2887
|
+
</div>
|
2888
|
+
</div>
|
2889
|
+
<div class="sect1">
|
2890
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="about_environment_variables"></span><h2 data-comment-topic="appendix-about-environment-variables-1ct91x3" data-anchor="about_environment_variables">8. Appendix: About environment variables</h2>
|
2891
|
+
<div class="sectionbody">
|
2892
|
+
<div class="paragraph"><p>Environment variables are named values that affect how the system works. For example they tell the system where to look for commands (the <span class="monospaced">PATH</span> variable) or where to look for libraries (<span class="monospaced">LD_LIBRARY_PATH</span>). Their names are often in all-uppercase. Sometimes people refer to an environment variable with a dollar sign <span class="monospaced">$</span> in front, but that’s the same thing: when people say "the $PATH environment variable" they mean "the PATH environment variable". This is because the dollar sign <span class="monospaced">$</span> is a shell syntax for refering to an environment variable, as you will learn later.</p></div>
|
2893
|
+
<div class="paragraph"><p>Environment variables are set on a <strong>per-process</strong> basis, but they are <strong>inherited</strong> by child processes. This means that if you set environment variables in process A, another already running process B will not see these new environment variables. But if A spawns a child process C, then C will have all environment variables that A had. If you once again change the environment variables in A, then C will not see the changes.</p></div>
|
2894
|
+
<div class="paragraph"><p>The per-process nature of environment variables some implications. When you set environment variables in your <span class="monospaced">bashrc</span> or other bash startup files…</p></div>
|
2895
|
+
<div class="ulist"><ul>
|
2896
|
+
<li>
|
2897
|
+
<p>
|
2898
|
+
…only newly spawned bash shells see them.
|
2899
|
+
</p>
|
2900
|
+
</li>
|
2901
|
+
<li>
|
2902
|
+
<p>
|
2903
|
+
…the web server usually does not see them, because the web server tends to be started from init scripts, not from bash.
|
2904
|
+
</p>
|
2905
|
+
</li>
|
2906
|
+
<li>
|
2907
|
+
<p>
|
2908
|
+
…cron jobs do not see them, because cron jobs' environment variables are entirely dictated by their crontabs.
|
2909
|
+
</p>
|
2910
|
+
</li>
|
2911
|
+
</ul></div>
|
2912
|
+
<div class="admonitionblock">
|
2913
|
+
<table><tr>
|
2914
|
+
<td class="icon">
|
2915
|
+
<img src="./images/icons/note.png" alt="Note">
|
2916
|
+
</td>
|
2917
|
+
<td class="content">Because this chapter is meant for beginners, it assumes that the reader uses the bash shell. This chapter does not describe instructions for zsh, csh or other shells. We assume that users of other shells are familiar with the Bourne shell syntax, and know how to apply the instructions in this chapter in their shells' native syntaxes.</td>
|
2918
|
+
</tr></table>
|
2919
|
+
</div>
|
2920
|
+
<div class="sect2">
|
2921
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_working_with_environment_variables"></span><h3 data-comment-topic="working-with-environment-variables-11cmwlv" data-anchor="_working_with_environment_variables">8.1. Working with environment variables</h3>
|
2922
|
+
<div class="paragraph"><p>You can see all environment variables in your shell by running the following command:</p></div>
|
2923
|
+
<div class="listingblock">
|
2924
|
+
<div class="content">
|
2925
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2926
|
+
by Lorenzo Bettini
|
2927
|
+
http://www.lorenzobettini.it
|
2928
|
+
http://www.gnu.org/software/src-highlite -->
|
2929
|
+
<pre><tt>env</tt></pre>
|
2930
|
+
</div>
|
2931
|
+
</div>
|
2932
|
+
<div class="paragraph"><p>You can set an evironment variable with the syntax <span class="monospaced">export <NAME>=<VALUE></span>. For example, to set the <span class="monospaced">APXS2</span> variable to the value <span class="monospaced">/usr/sbin/apxs2</span>:</p></div>
|
2933
|
+
<div class="listingblock">
|
2934
|
+
<div class="content">
|
2935
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2936
|
+
by Lorenzo Bettini
|
2937
|
+
http://www.lorenzobettini.it
|
2938
|
+
http://www.gnu.org/software/src-highlite -->
|
2939
|
+
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">APXS2</span><span style="color: #990000">=</span>/usr/sbin/apxs<span style="color: #993399">2</span></tt></pre>
|
2940
|
+
</div>
|
2941
|
+
</div>
|
2942
|
+
<div class="paragraph"><p>Any process that you run from your shell from that point on will have said environment variable:</p></div>
|
2943
|
+
<div class="listingblock">
|
2944
|
+
<div class="content">
|
2945
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2946
|
+
by Lorenzo Bettini
|
2947
|
+
http://www.lorenzobettini.it
|
2948
|
+
http://www.gnu.org/software/src-highlite -->
|
2949
|
+
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">APXS2</span><span style="color: #990000">=</span>/usr/sbin/apxs<span style="color: #993399">2</span>
|
2950
|
+
ruby -e <span style="color: #FF0000">'p ENV["APXS2"]'</span>
|
2951
|
+
<span style="font-style: italic"><span style="color: #9A1900"># => "/usr/sbin/apxs2"</span></span></tt></pre>
|
2952
|
+
</div>
|
2953
|
+
</div>
|
2954
|
+
<div class="admonitionblock">
|
2955
|
+
<table><tr>
|
2956
|
+
<td class="icon">
|
2957
|
+
<img src="./images/icons/note.png" alt="Note">
|
2958
|
+
</td>
|
2959
|
+
<td class="content">
|
2960
|
+
<div class="title">The "export" keyword is important</div>
|
2961
|
+
<div class="paragraph"><p>You <strong>must</strong> set the <span class="monospaced">export</span> keyword. If you omit the <span class="monospaced">export</span> keyword then the environment variable will not be visible to other processes:</p></div>
|
2962
|
+
<div class="listingblock">
|
2963
|
+
<div class="content">
|
2964
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2965
|
+
by Lorenzo Bettini
|
2966
|
+
http://www.lorenzobettini.it
|
2967
|
+
http://www.gnu.org/software/src-highlite -->
|
2968
|
+
<pre><tt><span style="color: #009900">APXS2</span><span style="color: #990000">=</span>/usr/sbin/apxs<span style="color: #993399">2</span>
|
2969
|
+
ruby -e <span style="color: #FF0000">'p ENV["APXS2"]'</span>
|
2970
|
+
<span style="font-style: italic"><span style="color: #9A1900"># => nil</span></span></tt></pre>
|
2971
|
+
</div>
|
2972
|
+
</div>
|
2973
|
+
</td>
|
2974
|
+
</tr></table>
|
2975
|
+
</div>
|
2976
|
+
<div class="paragraph"><p>You can reference an environment variable in your shell by typing the <span class="monospaced">$</span> sign followed by the environment variable’s name. For example, to see the value of the <span class="monospaced">PATH</span> variable:</p></div>
|
2977
|
+
<div class="listingblock">
|
2978
|
+
<div class="content">
|
2979
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2980
|
+
by Lorenzo Bettini
|
2981
|
+
http://www.lorenzobettini.it
|
2982
|
+
http://www.gnu.org/software/src-highlite -->
|
2983
|
+
<pre><tt>echo <span style="color: #009900">$PATH</span></tt></pre>
|
2984
|
+
</div>
|
2985
|
+
</div>
|
2986
|
+
<div class="paragraph"><p>You can also use this trick to extend the value of an environment variable:</p></div>
|
2987
|
+
<div class="listingblock">
|
2988
|
+
<div class="content">
|
2989
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
2990
|
+
by Lorenzo Bettini
|
2991
|
+
http://www.lorenzobettini.it
|
2992
|
+
http://www.gnu.org/software/src-highlite -->
|
2993
|
+
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">PATH</span><span style="color: #990000">=</span>/usr/bin
|
2994
|
+
|
2995
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Prepends '/opt/local/bin', so that it becomes /opt/local/bin:/usr/bin</span></span>
|
2996
|
+
<span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">PATH</span><span style="color: #990000">=</span>/opt/local/bin<span style="color: #990000">:</span><span style="color: #009900">$PATH</span>
|
2997
|
+
<span style="font-style: italic"><span style="color: #9A1900"># Appends '/usr/local/bin', so that it becomes /opt/local/bin:/usr/bin:/usr/local/bin</span></span>
|
2998
|
+
<span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">PATH</span><span style="color: #990000">=</span><span style="color: #009900">$PATH</span><span style="color: #990000">:</span>/usr/local/bin</tt></pre>
|
2999
|
+
</div>
|
3000
|
+
</div>
|
3001
|
+
</div>
|
3002
|
+
<div class="sect2">
|
3003
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="the_path_env_var"></span><h3 data-comment-topic="the-path-environment-variable-yzfn3k" data-anchor="the_path_env_var">8.2. The PATH environment variable</h3>
|
3004
|
+
<div class="paragraph"><p>The <span class="monospaced">PATH</span> environment variable dictates where the system looks for command. It is a colon-separated list of directories. If you get a "command not found" error while you know that the command is installed, then setting <span class="monospaced">PATH</span> will help. For example suppose that the command <span class="monospaced">frobnicator</span> is in <span class="monospaced">/opt/local/bin</span>:</p></div>
|
3005
|
+
<div class="listingblock">
|
3006
|
+
<div class="content">
|
3007
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
3008
|
+
by Lorenzo Bettini
|
3009
|
+
http://www.lorenzobettini.it
|
3010
|
+
http://www.gnu.org/software/src-highlite -->
|
3011
|
+
<pre><tt>user@localhost bash$ frobnicator
|
3012
|
+
bash<span style="color: #990000">:</span> frobnicator<span style="color: #990000">:</span> <span style="font-weight: bold"><span style="color: #0000FF">command</span></span> not found</tt></pre>
|
3013
|
+
</div>
|
3014
|
+
</div>
|
3015
|
+
<div class="paragraph"><p>We verify that <span class="monospaced">/opt/local/bin</span> is not in <span class="monospaced">PATH</span>:</p></div>
|
3016
|
+
<div class="listingblock">
|
3017
|
+
<div class="content">
|
3018
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
3019
|
+
by Lorenzo Bettini
|
3020
|
+
http://www.lorenzobettini.it
|
3021
|
+
http://www.gnu.org/software/src-highlite -->
|
3022
|
+
<pre><tt>user@localhost bash$ echo <span style="color: #009900">$PATH</span>
|
3023
|
+
/bin<span style="color: #990000">:</span>/usr/bin<span style="color: #990000">:</span>/usr/local/bin</tt></pre>
|
3024
|
+
</div>
|
3025
|
+
</div>
|
3026
|
+
<div class="paragraph"><p>We can run <span class="monospaced">frobnicator</span> through it’s full path…</p></div>
|
3027
|
+
<div class="listingblock">
|
3028
|
+
<div class="content">
|
3029
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
3030
|
+
by Lorenzo Bettini
|
3031
|
+
http://www.lorenzobettini.it
|
3032
|
+
http://www.gnu.org/software/src-highlite -->
|
3033
|
+
<pre><tt>user@localhost bash$ /opt/local/bin/frobnicator
|
3034
|
+
<span style="font-style: italic"><span style="color: #9A1900"># => success!</span></span></tt></pre>
|
3035
|
+
</div>
|
3036
|
+
</div>
|
3037
|
+
<div class="paragraph"><p>…or we can add <span class="monospaced">/opt/local/bin</span> to <span class="monospaced">PATH</span>.</p></div>
|
3038
|
+
<div class="listingblock">
|
3039
|
+
<div class="content">
|
3040
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
3041
|
+
by Lorenzo Bettini
|
3042
|
+
http://www.lorenzobettini.it
|
3043
|
+
http://www.gnu.org/software/src-highlite -->
|
3044
|
+
<pre><tt>user@localhost bash$ <span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">PATH</span><span style="color: #990000">=</span><span style="color: #009900">$PATH</span><span style="color: #990000">:</span>/opt/local/bin
|
3045
|
+
user@localhost bash$ frobnicator
|
3046
|
+
<span style="font-style: italic"><span style="color: #9A1900"># => success!</span></span></tt></pre>
|
3047
|
+
</div>
|
3048
|
+
</div>
|
3049
|
+
<div class="sect3">
|
3050
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_adding_phusion_passenger_8217_s_administration_tools_to_path"></span><h4 data-comment-topic="adding-phusion-passenger-s-administration-tools-to-path-d7k5mh" data-anchor="_adding_phusion_passenger_8217_s_administration_tools_to_path">8.2.1. Adding Phusion Passenger’s administration tools to PATH</h4>
|
3051
|
+
<div class="paragraph"><p>If you get a "command not found" error when invoking one of the Phusion Passenger administration tools (e.g. <span class="monospaced">passenger-status</span> or <span class="monospaced">passenger-memory-stats</span> then that means the tools are not in <span class="monospaced">PATH</span>, so you need to add them.</p></div>
|
3052
|
+
<div class="ulist"><ul>
|
3053
|
+
<li>
|
3054
|
+
<p>
|
3055
|
+
If you <a href="#rubygems_generic_install">installed Phusion Passenger with RubyGems</a>, then the tools are in your RubyGems executable path. You can view the gem path using the command <span class="monospaced">gem env</span>:
|
3056
|
+
</p>
|
3057
|
+
<div class="listingblock">
|
3058
|
+
<div class="content monospaced">
|
3059
|
+
<pre>$ gem env
|
3060
|
+
RubyGems Environment:
|
3061
|
+
- RUBYGEMS VERSION: 1.8.15
|
3062
|
+
- RUBY VERSION: 1.8.7 (2011-12-28 patchlevel 357) [i686-darwin10.8.0]
|
3063
|
+
- INSTALLATION DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8
|
3064
|
+
- RUBY EXECUTABLE: /opt/ruby-enterprise-1.8.7-2010.01/bin/ruby
|
3065
|
+
- EXECUTABLE DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.01/bin <--------- !!
|
3066
|
+
- RUBYGEMS PLATFORMS:
|
3067
|
+
- ruby
|
3068
|
+
- x86-darwin-10
|
3069
|
+
- GEM PATHS:
|
3070
|
+
- /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8
|
3071
|
+
- /Users/hongli/.gem/ruby/1.8
|
3072
|
+
- GEM CONFIGURATION:
|
3073
|
+
- :update_sources => true
|
3074
|
+
- :verbose => true
|
3075
|
+
- :benchmark => false
|
3076
|
+
- :backtrace => false
|
3077
|
+
- :bulk_threshold => 1000
|
3078
|
+
- "gem" => "--no-ri --no-rdoc"
|
3079
|
+
- REMOTE SOURCES:
|
3080
|
+
- http://rubygems.org/</pre>
|
3081
|
+
</div>
|
3082
|
+
</div>
|
3083
|
+
<div class="paragraph"><p>As you can see, the RubyGems executable path in the example happens to be <span class="monospaced">/opt/ruby-enterprise-1.8.7-2010.01/bin</span>. So that directory must be added to <span class="monospaced">PATH</span>.</p></div>
|
3084
|
+
</li>
|
3085
|
+
<li>
|
3086
|
+
<p>
|
3087
|
+
If you <a href="#tarball_generic_install">installed Phusion Passenger using the tarball</a>, then the tools are in the <span class="monospaced">bin</span> subdirectory of the Phusion Passenger tarball directory that you extracted. For example, if you extracted <span class="monospaced">passenger-4.9.0.tar.gz</span> inside <span class="monospaced">/opt</span>, then the tools are located in <span class="monospaced">/opt/passenger-4.0.9/bin</span>. In that case, you need to add <span class="monospaced">/opt/passenger-4.0.9/bin</span> to your <span class="monospaced">PATH</span>.
|
3088
|
+
</p>
|
3089
|
+
</li>
|
3090
|
+
<li>
|
3091
|
+
<p>
|
3092
|
+
If you installed Phusion Passenger using native OS packages, then some Phusion Passenger administration tools are in <span class="monospaced">/usr/bin</span>, while others are in <span class="monospaced">/usr/sbin</span>. If you are not logged in as root, then <span class="monospaced">/usr/sbin</span> may not be in <span class="monospaced">PATH</span>, which would explain why you get a "command not found" when trying to invoke some of the tools. You should <span class="monospaced">/usr/sbin</span> to <span class="monospaced">PATH</span>.
|
3093
|
+
</p>
|
3094
|
+
</li>
|
3095
|
+
<li>
|
3096
|
+
<p>
|
3097
|
+
If you are unsure where your Phusion Passenger directory is then you can use the <span class="monospaced">find</span> command to look them up. Go to the root directory and invoke <span class="monospaced">find</span> with <span class="monospaced">sudo</span>:
|
3098
|
+
</p>
|
3099
|
+
<div class="listingblock">
|
3100
|
+
<div class="content monospaced">
|
3101
|
+
<pre>$ cd /
|
3102
|
+
$ sudo find . -name passenger-status
|
3103
|
+
/usr/local/passenger/bin/passenger-status</pre>
|
3104
|
+
</div>
|
3105
|
+
</div>
|
3106
|
+
<div class="paragraph"><p>In this example, the administration tools happen to be in <span class="monospaced">/usr/local/passenger/bin</span>, so you must add that to <span class="monospaced">PATH</span>.</p></div>
|
3107
|
+
</li>
|
3108
|
+
</ul></div>
|
3109
|
+
<div class="admonitionblock">
|
3110
|
+
<table><tr>
|
3111
|
+
<td class="icon">
|
3112
|
+
<img src="./images/icons/note.png" alt="Note">
|
3113
|
+
</td>
|
3114
|
+
<td class="content">You may still get a "command not found" when invoking the tools through sudo, even after you’ve added the relevant directory to <span class="monospaced">PATH</span>. Please read <a href="#env_vars_and_sudo">Environment variables and sudo</a> to learn more.</td>
|
3115
|
+
</tr></table>
|
3116
|
+
</div>
|
3117
|
+
</div>
|
3118
|
+
</div>
|
3119
|
+
<div class="sect2">
|
3120
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_making_environment_variables_permanent"></span><h3 data-comment-topic="making-environment-variables-permanent-mkq46d" data-anchor="_making_environment_variables_permanent">8.3. Making environment variables permanent</h3>
|
3121
|
+
<div class="paragraph"><p>When you exit your shell, the evironment variable changes are lost. There is no standard method to set environment variables system-wide, so you have to set them in different configuration files for different services.</p></div>
|
3122
|
+
<div class="sect3">
|
3123
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_bash"></span><h4 data-comment-topic="bash-hmcscc" data-anchor="_bash">8.3.1. bash</h4>
|
3124
|
+
<div class="paragraph"><p>To make environment variables permanent for future bash sessions <strong>for the current user</strong>, add them to your <span class="monospaced">~/.bashrc</span>:</p></div>
|
3125
|
+
<div class="listingblock">
|
3126
|
+
<div class="content">
|
3127
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
3128
|
+
by Lorenzo Bettini
|
3129
|
+
http://www.lorenzobettini.it
|
3130
|
+
http://www.gnu.org/software/src-highlite -->
|
3131
|
+
<pre><tt>echo <span style="color: #FF0000">'export FOO=bar'</span> <span style="color: #990000">>></span> <span style="color: #990000">~/.</span>bashrc
|
3132
|
+
echo <span style="color: #FF0000">'export PATH=/usr/local/bin:$PATH'</span> <span style="color: #990000">>></span> <span style="color: #990000">~/.</span>bashrc</tt></pre>
|
3133
|
+
</div>
|
3134
|
+
</div>
|
3135
|
+
<div class="paragraph"><p>To make them permanent for future bash sessions <strong>for all users</strong>, add them to <span class="monospaced">/etc/bashrc</span>.</p></div>
|
3136
|
+
<div class="admonitionblock">
|
3137
|
+
<table><tr>
|
3138
|
+
<td class="icon">
|
3139
|
+
<img src="./images/icons/note.png" alt="Note">
|
3140
|
+
</td>
|
3141
|
+
<td class="content">Depending on the system, the bashrc file may have a different filename. On Debian and Ubuntu, it’s <span class="monospaced">/etc/bash.bashrc</span>.</td>
|
3142
|
+
</tr></table>
|
3143
|
+
</div>
|
3144
|
+
</div>
|
3145
|
+
<div class="sect3">
|
3146
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_apache"></span><h4 data-comment-topic="apache-15y3bm0" data-anchor="_apache">8.3.2. Apache</h4>
|
3147
|
+
<div class="admonitionblock">
|
3148
|
+
<table><tr>
|
3149
|
+
<td class="icon">
|
3150
|
+
<img src="./images/icons/note.png" alt="Note">
|
3151
|
+
</td>
|
3152
|
+
<td class="content">This subsection describes how to set environment variables on Apache itself, not on apps served through Phusion Passenger for Apache. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <a href="#env_vars_passenger_apps">Setting environment variables on Phusion Passenger-served apps</a>.</td>
|
3153
|
+
</tr></table>
|
3154
|
+
</div>
|
3155
|
+
<div class="paragraph"><p>On Debian and Ubuntu, with an Apache installed through apt, Apache environment variables are defined in the file <span class="monospaced">/etc/apache2/envvars</span>. This is a shell script so environment variables must be specified with the shell syntax.</p></div>
|
3156
|
+
<div class="paragraph"><p>On Red Hat, Fedora, CentOS and ScientificLinux, with an Apache installed through YUM, Apache environment variables are defined in <span class="monospaced">/etc/sysconfig/httpd</span>.</p></div>
|
3157
|
+
<div class="paragraph"><p>On OS X they are defined in <span class="monospaced">/System/Library/LaunchDaemons/org.apache.httpd.plist</span>, as explained <a href="/System/Library/LaunchDaemons/org.apache.httpd.plist">here on Stack Overflow</a>.</p></div>
|
3158
|
+
<div class="paragraph"><p>On other systems, or if you did not install Apache through the system’s package manager, the configuration file for environment variables is specific to the vendor that supplied Apache. There may not even be such a configuration file. You should contact the vendor for support.</p></div>
|
3159
|
+
</div>
|
3160
|
+
<div class="sect3">
|
3161
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_nginx"></span><h4 data-comment-topic="nginx-uarf27" data-anchor="_nginx">8.3.3. Nginx</h4>
|
3162
|
+
<div class="admonitionblock">
|
3163
|
+
<table><tr>
|
3164
|
+
<td class="icon">
|
3165
|
+
<img src="./images/icons/note.png" alt="Note">
|
3166
|
+
</td>
|
3167
|
+
<td class="content">This subsection describes how to set environment variables on Nginx itself, not on apps served through Phusion Passenger for Nginx. The environment variables you set here will be passed to all apps, but you cannot customize them on a per-app basis. See also <a href="#env_vars_passenger_apps">Setting environment variables on Phusion Passenger-served apps</a>.</td>
|
3168
|
+
</tr></table>
|
3169
|
+
</div>
|
3170
|
+
<div class="paragraph"><p>If you installed Nginx through <a href="#install_on_debian_ubuntu">the Debian or Ubuntu packages</a>, then you can define environment variables in <span class="monospaced">/etc/default/nginx</span>. This is a shell script so you must use the <span class="monospaced">export FOO=bar</span> syntax.</p></div>
|
3171
|
+
<div class="paragraph"><p>Otherwise, environment variables are best set through the script which starts Nginx. For example, if you installed Nginx from source and you used
|
3172
|
+
then you should edit that script to define the environment variables. Those init scripts are regular shell scripts, so use the <span class="monospaced">export FOO=bar</span> syntax. Just make sure your set your environment variables before the script starts Nginx.</p></div>
|
3173
|
+
<div class="admonitionblock">
|
3174
|
+
<table><tr>
|
3175
|
+
<td class="icon">
|
3176
|
+
<img src="./images/icons/note.png" alt="Note">
|
3177
|
+
</td>
|
3178
|
+
<td class="content">Setting environment variables on Nginx has no effect on the <a href="#flying_passenger">Flying Passenger daemon</a> because the daemon is started seperately. You should set the environment variables in the shell right before starting the daemon.</td>
|
3179
|
+
</tr></table>
|
3180
|
+
</div>
|
3181
|
+
</div>
|
3182
|
+
<div class="sect3">
|
3183
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="_cron"></span><h4 data-comment-topic="cron-6272ar" data-anchor="_cron">8.3.4. cron</h4>
|
3184
|
+
<div class="paragraph"><p>To make environment variables permanent for cron jobs, add those variables to the relevant crontab. But note that inside crontabs you cannot refer to existing environment variables with the <span class="monospaced">$</span> syntax because crontabs are not shell scripts. You have to specify the entire value.</p></div>
|
3185
|
+
<div class="listingblock">
|
3186
|
+
<div class="title">What to put in "crontab -e"</div>
|
3187
|
+
<div class="content monospaced">
|
3188
|
+
<pre># Environment variable definitions
|
3189
|
+
FOO=bar
|
3190
|
+
APXS2=/usr/sbin/apxs2
|
3191
|
+
|
3192
|
+
# **WRONG!** You cannot refer to existing variables with the `$` syntax!
|
3193
|
+
PATH=/usr/bin:$PATH
|
3194
|
+
# **WRONG!** You cannot use the 'export' keyword!
|
3195
|
+
export PATH=/usr/bin:/usr/local/bin
|
3196
|
+
# Correct:
|
3197
|
+
PATH=/usr/bin:/usr/local/bin
|
3198
|
+
|
3199
|
+
# Jobs:
|
3200
|
+
# m h dom mon dow command
|
3201
|
+
* * * * * frobnicator</pre>
|
3202
|
+
</div>
|
3203
|
+
</div>
|
3204
|
+
</div>
|
3205
|
+
<div class="sect3">
|
3206
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="env_vars_passenger_apps"></span><h4 data-comment-topic="phusion-passenger-served-apps-127wbl2" data-anchor="env_vars_passenger_apps">8.3.5. Phusion Passenger-served apps</h4>
|
3207
|
+
<div class="paragraph"><p>You can pass environment variables to Phusion Passenger-served apps through various methods:</p></div>
|
3208
|
+
<div class="ulist"><ul>
|
3209
|
+
<li>
|
3210
|
+
<p>
|
3211
|
+
When running Apache, use the <span class="monospaced">PassEnv</span> and <span class="monospaced">SetEnv</span> directives of <a href="http://httpd.apache.org/docs/2.4/mod/mod_env.html">mod_env</a>. This is supported starting from Phusion Passenger 4.0.
|
3212
|
+
</p>
|
3213
|
+
</li>
|
3214
|
+
<li>
|
3215
|
+
<p>
|
3216
|
+
When running Nginx, use the <a href="#passenger_env_var">passenger_env_var</a> directive.
|
3217
|
+
</p>
|
3218
|
+
</li>
|
3219
|
+
<li>
|
3220
|
+
<p>
|
3221
|
+
Through your <span class="monospaced">bashrc</span>. Starting from version 4.0, Phusion Passenger 4.0 spawns applications through bash and inherit all bash environment variables. Phusion Passenger Standalone tends to be started from the shell and thus inherits all environment variables set by the shell.
|
3222
|
+
</p>
|
3223
|
+
</li>
|
3224
|
+
<li>
|
3225
|
+
<p>
|
3226
|
+
Through Apache and Nginx, as described earlier in this chapter. Any environment variables that you set on Apache and Nginx itself are inherited by Phusion Passenger, and thus by Phusion Passenger-served apps as well.
|
3227
|
+
</p>
|
3228
|
+
</li>
|
3229
|
+
<li>
|
3230
|
+
<p>
|
3231
|
+
Through the application itself. Most programming languages provide APIs for setting environment variables. For example in Ruby you can write:
|
3232
|
+
</p>
|
3233
|
+
<div class="listingblock">
|
3234
|
+
<div class="content">
|
3235
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
3236
|
+
by Lorenzo Bettini
|
3237
|
+
http://www.lorenzobettini.it
|
3238
|
+
http://www.gnu.org/software/src-highlite -->
|
3239
|
+
<pre><tt>ENV<span style="color: #990000">[</span><span style="color: #FF0000">'FOO'</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #FF0000">'bar'</span></tt></pre>
|
3240
|
+
</div>
|
3241
|
+
</div>
|
3242
|
+
<div class="paragraph"><p>In Python you can write:</p></div>
|
3243
|
+
<div class="listingblock">
|
3244
|
+
<div class="content">
|
3245
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
3246
|
+
by Lorenzo Bettini
|
3247
|
+
http://www.lorenzobettini.it
|
3248
|
+
http://www.gnu.org/software/src-highlite -->
|
3249
|
+
<pre><tt><span style="font-weight: bold"><span style="color: #000080">import</span></span> os
|
3250
|
+
os<span style="color: #990000">.</span>environ<span style="color: #990000">[</span><span style="color: #FF0000">'FOO'</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #FF0000">'bar'</span></tt></pre>
|
3251
|
+
</div>
|
3252
|
+
</div>
|
3253
|
+
</li>
|
3254
|
+
</ul></div>
|
3255
|
+
</div>
|
3256
|
+
</div>
|
3257
|
+
<div class="sect2">
|
3258
|
+
<a href="javascript:void(0)" class="comments empty" title="Add a comment"><span class="count"></span></a><span class="anchor_helper" id="env_vars_and_sudo"></span><h3 data-comment-topic="environment-variables-and-sudo-znzmif" data-anchor="env_vars_and_sudo">8.4. Environment variables and sudo</h3>
|
3259
|
+
<div class="admonitionblock">
|
3260
|
+
<table><tr>
|
3261
|
+
<td class="icon">
|
3262
|
+
<img src="./images/icons/note.png" alt="Note">
|
3263
|
+
</td>
|
3264
|
+
<td class="content">RVM users should always use the <span class="monospaced">rvmsudo</span> command instead of <span class="monospaced">sudo</span>. However all information in this section apply to <span class="monospaced">rvmsudo</span> as well.</td>
|
3265
|
+
</tr></table>
|
3266
|
+
</div>
|
3267
|
+
<div class="paragraph"><p>The <span class="monospaced">sudo</span> command resets all environment variables before running the specified command, for security reasons. So if you set environment variables before running <span class="monospaced">sudo passenger-install-xxx-module</span>, <span class="monospaced">sudo passenger-status</span> or any other commands, then the environment variables are not correctly passed to the command. You can solve this by running sudo with <span class="monospaced">-E</span> (preserve environment variables):</p></div>
|
3268
|
+
<div class="listingblock">
|
3269
|
+
<div class="content">
|
3270
|
+
<!-- Generator: GNU source-highlight 2.11.1
|
3271
|
+
by Lorenzo Bettini
|
3272
|
+
http://www.lorenzobettini.it
|
3273
|
+
http://www.gnu.org/software/src-highlite -->
|
3274
|
+
<pre><tt>user@localhost bash$ <span style="font-weight: bold"><span style="color: #0000FF">export</span></span> <span style="color: #009900">APXS2</span><span style="color: #990000">=</span>/usr/sbin/apxs<span style="color: #993399">2</span>
|
3275
|
+
user@localhost bash$ sudo -E passenger-install-apache<span style="color: #993399">2</span>-module</tt></pre>
|
3276
|
+
</div>
|
3277
|
+
</div>
|
3278
|
+
<div class="paragraph"><p>Alternatively, you can obtain a root prompt with sudo first, and <strong>then</strong> set the environment variables, before running any further commands:</p></div>
|
3279
|
+
<div class="listingblock">
|
3280
|
+
<div class="content monospaced">
|
3281
|
+
<pre>user@localhost bash$ sudo -s
|
3282
|
+
Password: ...
|
3283
|
+
root@localhost bash# export APXS2=/usr/sbin/apxs2
|
3284
|
+
root@localhost bash# passenger-install-apache2-module</pre>
|
3285
|
+
</div>
|
3286
|
+
</div>
|
3287
|
+
<div class="paragraph"><p>Note that for security reasons, <span class="monospaced">sudo</span> <strong>always resets the <span class="monospaced">PATH</span> environment variable</strong>, even if you pass <span class="monospaced">-E</span>! You can get around this problem by obtaining a root prompt first, and then set the environment variables:</p></div>
|
3288
|
+
<div class="listingblock">
|
3289
|
+
<div class="content monospaced">
|
3290
|
+
<pre>user@localhost bash$ sudo -s
|
3291
|
+
Password: ...
|
3292
|
+
root@localhost bash# export PATH=$PATH:/opt/myruby/bin
|
3293
|
+
root@localhost bash# passenger-install-apache2-module</pre>
|
3294
|
+
</div>
|
3295
|
+
</div>
|
3296
|
+
</div>
|
3297
|
+
</div>
|
3298
|
+
</div>
|
3299
|
+
</div>
|
3300
|
+
<div id="footnotes"><hr></div>
|
3301
|
+
<div id="footer">
|
3302
|
+
|
3303
|
+
</div>
|
3304
|
+
<script>/*! jQuery v1.7.1 jquery.com | jquery.org/license */
|
3305
|
+
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
|
3306
|
+
f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
|
3307
|
+
{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
|
3308
|
+
/**
|
3309
|
+
* jQuery hashchange 1.0.0
|
3310
|
+
*
|
3311
|
+
* (based on jquery.history)
|
3312
|
+
*
|
3313
|
+
* Copyright (c) 2008 Chris Leishman (chrisleishman.com)
|
3314
|
+
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
3315
|
+
* and GPL (GPL-LICENSE.txt) licenses.
|
3316
|
+
*/
|
3317
|
+
(function($) {
|
3318
|
+
|
3319
|
+
$.fn.extend({
|
3320
|
+
hashchange: function(callback) { this.bind('hashchange', callback) },
|
3321
|
+
openOnClick: function(href) {
|
3322
|
+
if (href === undefined || href.length == 0)
|
3323
|
+
href = '#';
|
3324
|
+
return this.click(function(ev) {
|
3325
|
+
if (href && href.charAt(0) == '#') {
|
3326
|
+
// execute load in separate call stack
|
3327
|
+
window.setTimeout(function() { $.locationHash(href) }, 0);
|
3328
|
+
} else {
|
3329
|
+
window.location(href);
|
3330
|
+
}
|
3331
|
+
ev.stopPropagation();
|
3332
|
+
return false;
|
3333
|
+
});
|
3334
|
+
}
|
3335
|
+
});
|
3336
|
+
|
3337
|
+
// IE 8 introduces the hashchange event natively - so nothing more to do
|
3338
|
+
if ($.browser.msie && document.documentMode && document.documentMode >= 8) {
|
3339
|
+
$.extend({
|
3340
|
+
locationHash: function(hash) {
|
3341
|
+
if (!hash) hash = '#';
|
3342
|
+
else if (hash.charAt(0) != '#') hash = '#' + hash;
|
3343
|
+
location.hash = hash;
|
3344
|
+
}
|
3345
|
+
});
|
3346
|
+
return;
|
3347
|
+
}
|
3348
|
+
|
3349
|
+
var curHash;
|
3350
|
+
// hidden iframe for IE (earlier than 8)
|
3351
|
+
var iframe;
|
3352
|
+
|
3353
|
+
$.extend({
|
3354
|
+
locationHash: function(hash) {
|
3355
|
+
if (curHash === undefined) return;
|
3356
|
+
|
3357
|
+
if (!hash) hash = '#';
|
3358
|
+
else if (hash.charAt(0) != '#') hash = '#' + hash;
|
3359
|
+
|
3360
|
+
location.hash = hash;
|
3361
|
+
|
3362
|
+
if (curHash == hash) return;
|
3363
|
+
curHash = hash;
|
3364
|
+
|
3365
|
+
if ($.browser.msie) updateIEFrame(hash);
|
3366
|
+
$.event.trigger('hashchange');
|
3367
|
+
}
|
3368
|
+
});
|
3369
|
+
|
3370
|
+
$(document).ready(function() {
|
3371
|
+
curHash = location.hash;
|
3372
|
+
if ($.browser.msie) {
|
3373
|
+
// stop the callback firing twice during init if no hash present
|
3374
|
+
if (curHash == '') curHash = '#';
|
3375
|
+
// add hidden iframe for IE
|
3376
|
+
iframe = $('<iframe />').hide().get(0);
|
3377
|
+
$('body').prepend(iframe);
|
3378
|
+
updateIEFrame(location.hash);
|
3379
|
+
setInterval(checkHashIE, 100);
|
3380
|
+
} else {
|
3381
|
+
setInterval(checkHash, 100);
|
3382
|
+
}
|
3383
|
+
});
|
3384
|
+
$(window).unload(function() { iframe = null });
|
3385
|
+
|
3386
|
+
function checkHash() {
|
3387
|
+
var hash = location.hash;
|
3388
|
+
if (hash != curHash) {
|
3389
|
+
curHash = hash;
|
3390
|
+
$.event.trigger('hashchange');
|
3391
|
+
}
|
3392
|
+
}
|
3393
|
+
|
3394
|
+
if ($.browser.msie) {
|
3395
|
+
// Attach a live handler for any anchor links
|
3396
|
+
$('a[href^=#]').live('click', function() {
|
3397
|
+
var hash = $(this).attr('href');
|
3398
|
+
// Don't intercept the click if there is an existing anchor on the page
|
3399
|
+
// that matches this hash
|
3400
|
+
if ($(hash).length == 0 && $('a[name='+hash.slice(1)+']').length == 0) {
|
3401
|
+
$.locationHash(hash);
|
3402
|
+
return false;
|
3403
|
+
}
|
3404
|
+
});
|
3405
|
+
}
|
3406
|
+
|
3407
|
+
function checkHashIE() {
|
3408
|
+
// On IE, check for location.hash of iframe
|
3409
|
+
var idoc = iframe.contentDocument || iframe.contentWindow.document;
|
3410
|
+
var hash = idoc.location.hash;
|
3411
|
+
if (hash == '') hash = '#';
|
3412
|
+
|
3413
|
+
if (hash != curHash) {
|
3414
|
+
if (location.hash != hash) location.hash = hash;
|
3415
|
+
curHash = hash;
|
3416
|
+
$.event.trigger('hashchange');
|
3417
|
+
}
|
3418
|
+
}
|
3419
|
+
|
3420
|
+
function updateIEFrame(hash) {
|
3421
|
+
if (hash == '#') hash = '';
|
3422
|
+
var idoc = iframe.contentWindow.document;
|
3423
|
+
idoc.open();
|
3424
|
+
idoc.close();
|
3425
|
+
if (idoc.location.hash != hash) idoc.location.hash = hash;
|
3426
|
+
}
|
3427
|
+
|
3428
|
+
})(jQuery);
|
3429
|
+
// IE...
|
3430
|
+
if (!Date.now) {
|
3431
|
+
Date.now = function() {
|
3432
|
+
return new Date().getTime();
|
3433
|
+
}
|
3434
|
+
}
|
3435
|
+
|
3436
|
+
var Mizuho = {
|
3437
|
+
/** Cached DOM elements so that we don't have to re-find them over and over. */
|
3438
|
+
$document: undefined,
|
3439
|
+
$window: undefined,
|
3440
|
+
$mainSections: undefined,
|
3441
|
+
$sectionHeaders: undefined,
|
3442
|
+
|
3443
|
+
/** Constants */
|
3444
|
+
MAX_TOC_LEVEL: 3,
|
3445
|
+
|
3446
|
+
sectionHeadersSelector: undefined,
|
3447
|
+
scrollMemory: {},
|
3448
|
+
changingHash: false,
|
3449
|
+
activeHash: undefined,
|
3450
|
+
/** Whether in single-page or multi-page mode. Either 'single' or 'multi'. */
|
3451
|
+
mode: 'single',
|
3452
|
+
/** Whether smooth scrolling is enabled. It is always enabled except right
|
3453
|
+
* after page load: when the page is scrolled to the section as pointed to
|
3454
|
+
* by location.hash.
|
3455
|
+
*/
|
3456
|
+
smoothScrolling: true,
|
3457
|
+
|
3458
|
+
initialize: function() {
|
3459
|
+
this.sectionHeadersSelector = '';
|
3460
|
+
for (var i = 0; i < this.MAX_TOC_LEVEL; i++) {
|
3461
|
+
if (i != 0) {
|
3462
|
+
this.sectionHeadersSelector += ', ';
|
3463
|
+
}
|
3464
|
+
this.sectionHeadersSelector += 'h' + (i + 2);
|
3465
|
+
}
|
3466
|
+
|
3467
|
+
this.$document = $(document);
|
3468
|
+
this.$window = $(window);
|
3469
|
+
this.$mainSections = $('.sect1');
|
3470
|
+
this.$sectionHeaders = $(this.sectionHeadersSelector, '#content');
|
3471
|
+
this.$sectionHeaders.sort(function(a, b) {
|
3472
|
+
var off_a = $(a).offset();
|
3473
|
+
var off_b = $(b).offset();
|
3474
|
+
return off_a.top - off_b.top;
|
3475
|
+
});
|
3476
|
+
|
3477
|
+
if (this.isMobileDevice()) {
|
3478
|
+
$(document.body).addClass('mobile');
|
3479
|
+
}
|
3480
|
+
},
|
3481
|
+
|
3482
|
+
|
3483
|
+
/********* Generic utility functions *********/
|
3484
|
+
|
3485
|
+
isMobileDevice: function() {
|
3486
|
+
return navigator.userAgent.match(
|
3487
|
+
/(IEMobile|Windows CE|NetFront|PlayStation|PLAYSTATION|like Mac OS X|MIDP|UP\.Browser|Symbian|Nintendo|Android)/
|
3488
|
+
);
|
3489
|
+
},
|
3490
|
+
|
3491
|
+
virtualAnimate: function(options) {
|
3492
|
+
var options = $.extend({
|
3493
|
+
duration: 1000
|
3494
|
+
}, options || {});
|
3495
|
+
var animation_start = Date.now();
|
3496
|
+
var animation_end = Date.now() + options.duration;
|
3497
|
+
var interval = animation_end - animation_start;
|
3498
|
+
this._virtualAnimate_step(animation_start, animation_end, interval, options);
|
3499
|
+
},
|
3500
|
+
|
3501
|
+
_virtualAnimate_step: function(animation_start, animation_end, interval, options) {
|
3502
|
+
var self = this;
|
3503
|
+
var now = new Date();
|
3504
|
+
var progress = (now - animation_start) / interval;
|
3505
|
+
if (progress > 1) {
|
3506
|
+
progress = 1;
|
3507
|
+
}
|
3508
|
+
progress = (1 + Math.sin(-Math.PI / 2 + progress * Math.PI)) / 2;
|
3509
|
+
options.step(progress);
|
3510
|
+
if (now < animation_end) {
|
3511
|
+
setTimeout(function() {
|
3512
|
+
self._virtualAnimate_step(animation_start,
|
3513
|
+
animation_end, interval, options);
|
3514
|
+
}, 15);
|
3515
|
+
} else {
|
3516
|
+
options.step(1);
|
3517
|
+
if (options.finish) {
|
3518
|
+
options.finish();
|
3519
|
+
}
|
3520
|
+
}
|
3521
|
+
},
|
3522
|
+
|
3523
|
+
smoothlyScrollTo: function(top) {
|
3524
|
+
if (!this.smoothScrolling) {
|
3525
|
+
return this.setScrollTop(top);
|
3526
|
+
}
|
3527
|
+
|
3528
|
+
var self = this;
|
3529
|
+
var $document = this.$document;
|
3530
|
+
var current = $document.scrollTop();
|
3531
|
+
this.virtualAnimate({
|
3532
|
+
duration: 300,
|
3533
|
+
step: function(x) {
|
3534
|
+
$document.scrollTop(Math.floor(
|
3535
|
+
top + (1 - x) * (current - top)
|
3536
|
+
));
|
3537
|
+
},
|
3538
|
+
finish: function() {
|
3539
|
+
self.setScrollTop(top);
|
3540
|
+
}
|
3541
|
+
});
|
3542
|
+
},
|
3543
|
+
|
3544
|
+
smoothlyScrollToToc: function() {
|
3545
|
+
this.smoothlyScrollTo($('#toc').position().top);
|
3546
|
+
},
|
3547
|
+
|
3548
|
+
scrollToHeader: function(header) {
|
3549
|
+
this.smoothlyScrollTo($(header).offset().top - 50);
|
3550
|
+
},
|
3551
|
+
|
3552
|
+
setScrollTop: function(top, element) {
|
3553
|
+
// Browsers don't always scroll properly so work around
|
3554
|
+
// this with a few timers.
|
3555
|
+
var self = this;
|
3556
|
+
element = element || this.$document;
|
3557
|
+
element = $(element);
|
3558
|
+
element.scrollTop(top);
|
3559
|
+
setTimeout(function() {
|
3560
|
+
element.scrollTop(top);
|
3561
|
+
}, 1);
|
3562
|
+
setTimeout(function() {
|
3563
|
+
element.scrollTop(top);
|
3564
|
+
self.$document.trigger('mizuho:updateTopBar');
|
3565
|
+
}, 20);
|
3566
|
+
},
|
3567
|
+
|
3568
|
+
|
3569
|
+
/********* Mizuho-specific functions *********/
|
3570
|
+
|
3571
|
+
/** Returns the currently displayed section's header DOM element. */
|
3572
|
+
currentSubsection: function() {
|
3573
|
+
var $sectionHeaders = this.$sectionHeaders;
|
3574
|
+
var scrollTop = this.$document.scrollTop();
|
3575
|
+
var windowHeight = this.$window.height();
|
3576
|
+
var offset;
|
3577
|
+
|
3578
|
+
var low = 0;
|
3579
|
+
var high = this.$sectionHeaders.length - 1;
|
3580
|
+
var mid = 0;
|
3581
|
+
|
3582
|
+
while (low <= high) {
|
3583
|
+
mid = Math.floor((low + high) / 2);
|
3584
|
+
offset = $($sectionHeaders[mid]).offset();
|
3585
|
+
|
3586
|
+
if (offset.top >= scrollTop) {
|
3587
|
+
high = mid - 1;
|
3588
|
+
} else {
|
3589
|
+
low = mid + 1;
|
3590
|
+
}
|
3591
|
+
}
|
3592
|
+
|
3593
|
+
var $found = $($sectionHeaders[low]);
|
3594
|
+
if ($found.offset().top > scrollTop + windowHeight) {
|
3595
|
+
if (low > 0) {
|
3596
|
+
return $sectionHeaders[low - 1];
|
3597
|
+
} else {
|
3598
|
+
return undefined;
|
3599
|
+
}
|
3600
|
+
} else {
|
3601
|
+
return $sectionHeaders[low];
|
3602
|
+
}
|
3603
|
+
},
|
3604
|
+
|
3605
|
+
/** Looks up a section's header DOM element corresponding to a hash name. */
|
3606
|
+
lookupHeader: function(hash) {
|
3607
|
+
var id = hash.replace(/^#!\//, '#');
|
3608
|
+
if (id == '') {
|
3609
|
+
return undefined;
|
3610
|
+
} else {
|
3611
|
+
var header = $(id);
|
3612
|
+
if (header.length == 0) {
|
3613
|
+
return undefined;
|
3614
|
+
} else {
|
3615
|
+
return header;
|
3616
|
+
}
|
3617
|
+
}
|
3618
|
+
}
|
3619
|
+
};
|
3620
|
+
|
3621
|
+
for (var key in Mizuho) {
|
3622
|
+
if (typeof(Mizuho[key]) == 'function') {
|
3623
|
+
Mizuho[key] = $.proxy(Mizuho[key], Mizuho);
|
3624
|
+
}
|
3625
|
+
}
|
3626
|
+
$(document).ready(Mizuho.initialize);
|
3627
|
+
//$(document).ready(Mizuho.installHashbangLinks);
|
3628
|
+
|
3629
|
+
Mizuho.initializeTopBar = $.proxy(function() {
|
3630
|
+
var $window = this.$window;
|
3631
|
+
var $document = this.$document;
|
3632
|
+
var self = this;
|
3633
|
+
var $topbar = $('#topbar');
|
3634
|
+
var $title = $('#header h1');
|
3635
|
+
var $currentSection = $('#current_section');
|
3636
|
+
var isMobileDevice = this.isMobileDevice();
|
3637
|
+
var timerId;
|
3638
|
+
|
3639
|
+
// Create the floating table of contents used in the top bar.
|
3640
|
+
var $floattoc = $('<div id="floattoc"></div>').html($('#toc').html());
|
3641
|
+
$floattoc.find('#toctitle').remove();
|
3642
|
+
$floattoc.find('.comments').remove();
|
3643
|
+
$floattoc.css('visibility', 'hidden');
|
3644
|
+
$floattoc.insertAfter($topbar);
|
3645
|
+
var $floattoclinks = $floattoc.find('a');
|
3646
|
+
$floattoclinks.each(function() {
|
3647
|
+
// Firefox changes '#!' to '#%21' so change that back.
|
3648
|
+
var $this = $(this);
|
3649
|
+
var href = $this.attr('href');
|
3650
|
+
if (href.match(/^#%21/)) {
|
3651
|
+
$this.attr('href', href.replace(/^#%21/, '#!'));
|
3652
|
+
}
|
3653
|
+
});
|
3654
|
+
$floattoclinks.click(function(event) {
|
3655
|
+
self.internalLinkClicked(this, event);
|
3656
|
+
});
|
3657
|
+
|
3658
|
+
// Callback for when the user clicks on the Table of Contents
|
3659
|
+
// button on the top bar.
|
3660
|
+
function showFloatingToc() {
|
3661
|
+
var scrollUpdateTimerId;
|
3662
|
+
|
3663
|
+
function reposition() {
|
3664
|
+
if (isMobileDevice) {
|
3665
|
+
$floattoc.css({
|
3666
|
+
top: $currentSection.offset().top +
|
3667
|
+
$currentSection.innerHeight() +
|
3668
|
+
'px',
|
3669
|
+
height: $window.height() * 0.7 + 'px'
|
3670
|
+
});
|
3671
|
+
}
|
3672
|
+
}
|
3673
|
+
|
3674
|
+
function highlightCurrentTocEntry() {
|
3675
|
+
var currentSubsection = self.currentSubsection();
|
3676
|
+
$floattoclinks.removeClass('current');
|
3677
|
+
if (currentSubsection) {
|
3678
|
+
var currentSubsectionTitle = $(currentSubsection).text();
|
3679
|
+
var $link;
|
3680
|
+
|
3681
|
+
$floattoclinks.each(function() {
|
3682
|
+
if ($(this).text() == currentSubsectionTitle) {
|
3683
|
+
$link = $(this);
|
3684
|
+
return false;
|
3685
|
+
}
|
3686
|
+
});
|
3687
|
+
if ($link) {
|
3688
|
+
$link.addClass('current');
|
3689
|
+
self.setScrollTop(
|
3690
|
+
$floattoc.scrollTop() +
|
3691
|
+
$link.position().top -
|
3692
|
+
$floattoc.height() * 0.45,
|
3693
|
+
$floattoc);
|
3694
|
+
return false;
|
3695
|
+
}
|
3696
|
+
}
|
3697
|
+
}
|
3698
|
+
|
3699
|
+
function hideFloatingToc() {
|
3700
|
+
$currentSection.removeClass('pressed');
|
3701
|
+
$floattoc.css('visibility', 'hidden');
|
3702
|
+
$floattoclinks.unbind('click', hideFloatingToc);
|
3703
|
+
$document.unbind('mousedown', onMouseDown);
|
3704
|
+
$document.unbind('touchdown', onMouseDown);
|
3705
|
+
$document.unbind('mizuho:hideTopBar', hideFloatingToc);
|
3706
|
+
$window.unbind('scroll', onScroll);
|
3707
|
+
if (scrollUpdateTimerId !== undefined) {
|
3708
|
+
clearTimeout(scrollUpdateTimerId);
|
3709
|
+
scrollUpdateTimerId = undefined;
|
3710
|
+
}
|
3711
|
+
}
|
3712
|
+
|
3713
|
+
function onMouseDown(event) {
|
3714
|
+
if (event.target != $floattoc[0]
|
3715
|
+
&& $(event.target).closest('#floattoc').length == 0) {
|
3716
|
+
hideFloatingToc();
|
3717
|
+
}
|
3718
|
+
}
|
3719
|
+
|
3720
|
+
function onScroll(event) {
|
3721
|
+
if (scrollUpdateTimerId === undefined) {
|
3722
|
+
scrollUpdateTimerId = setTimeout(function() {
|
3723
|
+
scrollUpdateTimerId = undefined;
|
3724
|
+
reposition();
|
3725
|
+
highlightCurrentTocEntry();
|
3726
|
+
}, 100);
|
3727
|
+
}
|
3728
|
+
}
|
3729
|
+
|
3730
|
+
// Layout and display floating TOC.
|
3731
|
+
highlightCurrentTocEntry();
|
3732
|
+
var origScrollTop = $document.scrollTop();
|
3733
|
+
var windowWidth = $window.width();
|
3734
|
+
var maxRight = windowWidth - Math.floor(windowWidth * 0.1);
|
3735
|
+
|
3736
|
+
if ($currentSection.offset().left + $floattoc.outerWidth() > maxRight) {
|
3737
|
+
$floattoc.css('left', maxRight - $floattoc.outerWidth());
|
3738
|
+
} else {
|
3739
|
+
$floattoc.css('left', $currentSection.offset().left + 'px');
|
3740
|
+
}
|
3741
|
+
reposition();
|
3742
|
+
$floattoc.css('visibility', 'visible');
|
3743
|
+
$currentSection.addClass('pressed');
|
3744
|
+
|
3745
|
+
$floattoclinks.bind('click', hideFloatingToc);
|
3746
|
+
$document.bind('mousedown', onMouseDown)
|
3747
|
+
$document.bind('touchdown', onMouseDown);
|
3748
|
+
$document.bind('mizuho:hideTopBar', hideFloatingToc);
|
3749
|
+
$window.bind('scroll', onScroll);
|
3750
|
+
}
|
3751
|
+
|
3752
|
+
// Called whenever the user scrolls. Updates the title of the
|
3753
|
+
// Table of Contents button in the top bar to the section that
|
3754
|
+
// the user is currently reading.
|
3755
|
+
function update() {
|
3756
|
+
if ($title.offset().top + $title.height() < $document.scrollTop()) {
|
3757
|
+
if (!$topbar.is(':visible')) {
|
3758
|
+
$topbar.slideDown(250);
|
3759
|
+
$document.trigger('mizuho:showTopBar');
|
3760
|
+
}
|
3761
|
+
} else {
|
3762
|
+
if ($topbar.is(':visible')) {
|
3763
|
+
$topbar.slideUp();
|
3764
|
+
$document.trigger('mizuho:hideTopBar');
|
3765
|
+
}
|
3766
|
+
}
|
3767
|
+
|
3768
|
+
if (isMobileDevice) {
|
3769
|
+
$topbar.css({
|
3770
|
+
top: $document.scrollTop() + 'px',
|
3771
|
+
width: $window.width() -
|
3772
|
+
parseInt($topbar.css('padding-left')) -
|
3773
|
+
parseInt($topbar.css('padding-right')) +
|
3774
|
+
'px'
|
3775
|
+
});
|
3776
|
+
}
|
3777
|
+
|
3778
|
+
var header = self.currentSubsection();
|
3779
|
+
var name;
|
3780
|
+
if (header) {
|
3781
|
+
name = $(header).text();
|
3782
|
+
} else {
|
3783
|
+
name = 'Preamble';
|
3784
|
+
}
|
3785
|
+
$currentSection.text(name);
|
3786
|
+
}
|
3787
|
+
|
3788
|
+
function scheduleUpdate() {
|
3789
|
+
if (timerId !== undefined) {
|
3790
|
+
return;
|
3791
|
+
}
|
3792
|
+
timerId = setTimeout(function() {
|
3793
|
+
timerId = undefined;
|
3794
|
+
update();
|
3795
|
+
}, 100);
|
3796
|
+
}
|
3797
|
+
|
3798
|
+
|
3799
|
+
if (isMobileDevice) {
|
3800
|
+
// Mobile devices don't support position fixed.
|
3801
|
+
$topbar.css('position', 'absolute');
|
3802
|
+
$floattoc.css('position', 'absolute');
|
3803
|
+
}
|
3804
|
+
|
3805
|
+
$currentSection.click(showFloatingToc);
|
3806
|
+
$window.scroll(scheduleUpdate);
|
3807
|
+
$document.bind('mizuho:updateTopBar', update);
|
3808
|
+
}, Mizuho);
|
3809
|
+
|
3810
|
+
$(document).ready(Mizuho.initializeTopBar);
|
3811
|
+
|
3812
|
+
|
3813
|
+
var JUVIA_URL = 'http://juvia.phusion.nl';
|
3814
|
+
var JUVIA_SITE_KEY = 'amggdy0k65hb4hbjg3dh7pnb9zd8dwy';
|
3815
|
+
var disqus_identifier;
|
3816
|
+
var disqus_title;
|
3817
|
+
var disqus_url;
|
3818
|
+
var disqus_developer = 1;
|
3819
|
+
|
3820
|
+
Mizuho.initializeCommenting = $.proxy(function() {
|
3821
|
+
var self = this;
|
3822
|
+
this.commentBalloons = $('.comments');
|
3823
|
+
this.commentBalloons.click(function() {
|
3824
|
+
self.showCommentsPopup(this);
|
3825
|
+
});
|
3826
|
+
this.reloadCommentCount();
|
3827
|
+
}, Mizuho);
|
3828
|
+
|
3829
|
+
Mizuho.showLightbox = $.proxy(function(creationCallback, closeCallback) {
|
3830
|
+
var lightbox = $(
|
3831
|
+
'<div id="comments_lightbox">' +
|
3832
|
+
' <div id="comments_lightbox_shadow"></div>' +
|
3833
|
+
' <div id="comments_lightbox_contents"><div class="shell"></div></div>' +
|
3834
|
+
'</div>');
|
3835
|
+
var shadow = $('#comments_lightbox_shadow', lightbox);
|
3836
|
+
var contents = $('#comments_lightbox_contents > .shell', lightbox);
|
3837
|
+
|
3838
|
+
function close() {
|
3839
|
+
if (lightbox) {
|
3840
|
+
lightbox.remove();
|
3841
|
+
lightbox = undefined;
|
3842
|
+
if (closeCallback) {
|
3843
|
+
closeCallback();
|
3844
|
+
}
|
3845
|
+
}
|
3846
|
+
}
|
3847
|
+
|
3848
|
+
shadow.click(close);
|
3849
|
+
lightbox.bind('lightbox:close', close);
|
3850
|
+
lightbox.appendTo(document.body);
|
3851
|
+
creationCallback(contents);
|
3852
|
+
}, Mizuho);
|
3853
|
+
|
3854
|
+
Mizuho.getCommentThreadInfo = $.proxy(function(balloon) {
|
3855
|
+
var info = {};
|
3856
|
+
if ($(balloon).closest('#toc').length > 0) {
|
3857
|
+
info.id = 'toctitle';
|
3858
|
+
info.topic = 'toctitle';
|
3859
|
+
info.title = $('#header h1').text() + " - " + $('#toctitle').text();
|
3860
|
+
} else {
|
3861
|
+
var header = $(balloon).next('h2, h3, h4');
|
3862
|
+
if (header.length > 0) {
|
3863
|
+
info.id = header.attr('id');
|
3864
|
+
info.topic = header.data('comment-topic');
|
3865
|
+
info.title = $('#header h1').text() + " - " + header.text();
|
3866
|
+
} else {
|
3867
|
+
info = undefined;
|
3868
|
+
}
|
3869
|
+
}
|
3870
|
+
return info;
|
3871
|
+
}, Mizuho);
|
3872
|
+
|
3873
|
+
Mizuho.callJuviaApi = function(action, options) {
|
3874
|
+
function makeQueryString(options) {
|
3875
|
+
var key, params = [];
|
3876
|
+
for (key in options) {
|
3877
|
+
params.push(
|
3878
|
+
encodeURIComponent(key) +
|
3879
|
+
'=' +
|
3880
|
+
encodeURIComponent(options[key]));
|
3881
|
+
}
|
3882
|
+
return params.join('&');
|
3883
|
+
}
|
3884
|
+
|
3885
|
+
// Makes sure that each call generates a unique URL, otherwise
|
3886
|
+
// the browser may not actually perform the request.
|
3887
|
+
if (!('_juviaRequestCounter' in window)) {
|
3888
|
+
window._juviaRequestCounter = 0;
|
3889
|
+
}
|
3890
|
+
|
3891
|
+
var url =
|
3892
|
+
JUVIA_URL + '/api/' + action +
|
3893
|
+
'?_c=' + window._juviaRequestCounter +
|
3894
|
+
'&' + makeQueryString(options);
|
3895
|
+
window._juviaRequestCounter++;
|
3896
|
+
|
3897
|
+
var s = document.createElement('script');
|
3898
|
+
s.async = true;
|
3899
|
+
s.type = 'text/javascript';
|
3900
|
+
s.className = 'juvia';
|
3901
|
+
s.src = url;
|
3902
|
+
(document.getElementsByTagName('head')[0] ||
|
3903
|
+
document.getElementsByTagName('body')[0]).appendChild(s);
|
3904
|
+
}
|
3905
|
+
|
3906
|
+
Mizuho.showCommentsPopup = $.proxy(function(balloon) {
|
3907
|
+
var info = this.getCommentThreadInfo(balloon);
|
3908
|
+
if (!info) {
|
3909
|
+
return;
|
3910
|
+
}
|
3911
|
+
|
3912
|
+
var self = this;
|
3913
|
+
this.showLightbox(function(element) {
|
3914
|
+
// We install a 'Close' button in the Juvia comment form after it has loaded.
|
3915
|
+
function installCloseButton() {
|
3916
|
+
if ($('#comments .juvia-form-actions').size() > 0) {
|
3917
|
+
// The Juvia form is now loaded. Install the button.
|
3918
|
+
var div = $('<div class="juvia-action" style="margin-left: 0.5em"></div>');
|
3919
|
+
var button = $('<input type="button" value="Cancel"></div>').appendTo(div);
|
3920
|
+
div.insertBefore('#comments .juvia-form-actions .juvia-error');
|
3921
|
+
button.click(function() {
|
3922
|
+
$(element).trigger('lightbox:close');
|
3923
|
+
});
|
3924
|
+
} else {
|
3925
|
+
// Continue polling.
|
3926
|
+
setTimeout(installCloseButton, 50);
|
3927
|
+
}
|
3928
|
+
}
|
3929
|
+
setTimeout(installCloseButton, 50);
|
3930
|
+
|
3931
|
+
// Now load the Juvia comments form.
|
3932
|
+
element.html('<div id="comments">Loading comments...</div>');
|
3933
|
+
self.changingHash = true;
|
3934
|
+
location.hash = '#!/' + info.id;
|
3935
|
+
self.callJuviaApi('show_topic.js', {
|
3936
|
+
container : '#comments',
|
3937
|
+
site_key : JUVIA_SITE_KEY,
|
3938
|
+
topic_key : info.topic,
|
3939
|
+
topic_url : location.href,
|
3940
|
+
topic_title : info.topic,
|
3941
|
+
include_base: !window.Juvia,
|
3942
|
+
include_css : !window.Juvia
|
3943
|
+
});
|
3944
|
+
}, function() {
|
3945
|
+
self.reloadCommentCount();
|
3946
|
+
});
|
3947
|
+
}, Mizuho);
|
3948
|
+
|
3949
|
+
Mizuho.reloadCommentCount = $.proxy(function() {
|
3950
|
+
this.callJuviaApi('list_topics.jsonp', {
|
3951
|
+
site_key: JUVIA_SITE_KEY,
|
3952
|
+
jsonp : 'Mizuho.topicListReceived'
|
3953
|
+
});
|
3954
|
+
}, Mizuho);
|
3955
|
+
|
3956
|
+
Mizuho.topicListReceived = $.proxy(function(result) {
|
3957
|
+
var self = this;
|
3958
|
+
var i, topic, map = {};
|
3959
|
+
for (i = 0; i < result.topics.length; i++) {
|
3960
|
+
topic = result.topics[i];
|
3961
|
+
map[topic.key] = topic;
|
3962
|
+
}
|
3963
|
+
|
3964
|
+
this.commentBalloons.each(function() {
|
3965
|
+
var info = self.getCommentThreadInfo(this);
|
3966
|
+
if (info) {
|
3967
|
+
topic = map[info.topic];
|
3968
|
+
if (topic) {
|
3969
|
+
var balloon = $(this);
|
3970
|
+
$('.count', balloon).text(topic.comment_count);
|
3971
|
+
balloon.removeClass('empty');
|
3972
|
+
balloon.addClass('nonempty');
|
3973
|
+
balloon.attr('title', null);
|
3974
|
+
}
|
3975
|
+
}
|
3976
|
+
});
|
3977
|
+
}, Mizuho);
|
3978
|
+
|
3979
|
+
$(document).ready(Mizuho.initializeCommenting);
|
3980
|
+
|
3981
|
+
</script>
|
3982
|
+
</body>
|
3983
|
+
</html>
|