### Home Classes Methods

### In Files

- lib/phusion_passenger/standalone/runtime_installer.rb

### Parent

PhusionPassenger::AbstractInstaller

### Methods

- ::new
- #after_install
- #before_install
- #dependencies
- #run_steps
- #users_guide

### Included Modules

- PhusionPassenger::Standalone::Utils

### Class/Module Index

Quicksearch

- PhusionPassenger
- PhusionPassenger::AbstractInstaller
- PhusionPassenger::AbstractInstaller::Abort
- PhusionPassenger::AbstractInstaller::CommandError
- PhusionPassenger::AdminTools
- PhusionPassenger::AdminTools::MemoryStats
- PhusionPassenger::AdminTools::MemoryStats::Process
- PhusionPassenger::AdminTools::ServerInstance
- PhusionPassenger::AdminTools::ServerInstance::CorruptedDirectoryError
- PhusionPassenger::AdminTools::ServerInstance::GenerationsAbsentError
- PhusionPassenger::AdminTools::ServerInstance::Group
- PhusionPassenger::AdminTools::ServerInstance::Process
- PhusionPassenger::AdminTools::ServerInstance::RoleDeniedError
- PhusionPassenger::AdminTools::ServerInstance::StaleDirectoryError
- PhusionPassenger::AdminTools::ServerInstance::Stats
- PhusionPassenger::AdminTools::ServerInstance::UnsupportedGenerationStructureVersionError
- PhusionPassenger::AnalyticsLogger
- PhusionPassenger::AnalyticsLogger::Connection
- PhusionPassenger::AnalyticsLogger::Lock
- PhusionPassenger::AnalyticsLogger::Log
- PhusionPassenger::ClassicRails
- PhusionPassenger::ClassicRails::CGIFixed
- PhusionPassenger::ClassicRails::ThreadHandlerExtension
- PhusionPassenger::ConsoleTextTemplate
- PhusionPassenger::DebugLogging
- PhusionPassenger::LoaderSharedHelpers
- PhusionPassenger::MessageChannel
- PhusionPassenger::MessageChannel::InvalidHashError
- PhusionPassenger::MessageClient
- PhusionPassenger::NativeSupportLoader
- PhusionPassenger::Packaging
- PhusionPassenger::PlatformInfo
- PhusionPassenger::PlatformInfo::ApacheDetector
- PhusionPassenger::PlatformInfo::ApacheDetector::Result
- PhusionPassenger::PlatformInfo::Depcheck
- PhusionPassenger::PlatformInfo::Depcheck::ConsoleRunner
- PhusionPassenger::PlatformInfo::Depcheck::Dependency
- PhusionPassenger::PlatformInfo::RuntimeError
- PhusionPassenger::Plugin
- PhusionPassenger::PreloaderSharedHelpers
- PhusionPassenger::Rack
- PhusionPassenger::Rack::OutOfBandGc
- PhusionPassenger::Rack::ThreadHandlerExtension
- PhusionPassenger::Rails3Extensions
- PhusionPassenger::Rails3Extensions::AnalyticsLogging
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ACExtension
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ASBenchmarkableExtension
- PhusionPassenger::Rails3Extensions::AnalyticsLogging::ExceptionLogger
- PhusionPassenger::RequestHandler
- PhusionPassenger::RequestHandler::ThreadHandler
- PhusionPassenger::RequestHandler::ThreadHandler::Interrupted
- PhusionPassenger::SharedConstants
- PhusionPassenger::Standalone
- PhusionPassenger::Standalone::AppFinder
- PhusionPassenger::Standalone::Command
- PhusionPassenger::Standalone::ConfigFile
- PhusionPassenger::Standalone::ConfigFile::DisallowedContextError
- PhusionPassenger::Standalone::HelpCommand
- PhusionPassenger::Standalone::Main
- PhusionPassenger::Standalone::PackageRuntimeCommand
- PhusionPassenger::Standalone::RuntimeInstaller
- PhusionPassenger::Standalone::RuntimeLocator
- PhusionPassenger::Standalone::StartCommand
- PhusionPassenger::Standalone::StatusCommand
- PhusionPassenger::Standalone::StopCommand
- PhusionPassenger::Standalone::Utils
- PhusionPassenger::Standalone::VersionCommand
- PhusionPassenger::Utils
- PhusionPassenger::Utils::AnsiColors
- PhusionPassenger::Utils::FileSystemWatcher
- PhusionPassenger::Utils::FileSystemWatcher::DirInfo
- PhusionPassenger::Utils::FileSystemWatcher::FileInfo
- PhusionPassenger::Utils::GeneratorTest
- PhusionPassenger::Utils::HostsFileParser
- PhusionPassenger::Utils::JSON
- PhusionPassenger::Utils::JSON::Generator
- PhusionPassenger::Utils::ParserTest
- PhusionPassenger::Utils::TeeInput
- PhusionPassenger::Utils::TmpIO
- PhusionPassenger::Utils::UnseekableSocket
- CommonLibraryBuilder
- Exception
- GC
- IO
- Object
- Signal

No matching classes.

# PhusionPassenger::Standalone::RuntimeInstaller

Installs the Phusion Passenger Standalone runtime by downloading or compiling the Phusion Passenger support binaries and Nginx, and then storing them in the designated directories. This installer is entirely non-interactive.

The following option must be given:

- targets: An array containing at least one of:

  - :support_binaries - to indicate that you want to install the

        Phusion Passenger support binary files.

  - :nginx - to indicate that you want to install Nginx.

If `targets` contains `:support_binaries`, then you must also specify this options:

- support_dir: The support binary files will be installed here.

If `targets` contains `:nginx`, then you must also specify these options:

- nginx_dir: Nginx will be installed into this directory.

- lib_dir: Path to the Phusion Passenger libraries, which Nginx will link to.

      This may be the same path as `support_dir`; Nginx will be compiled
      after the support binary files are installed.

- nginx_version (optional): The Nginx version to download. If not given then a hardcoded version number will be used.

- nginx_tarball (optional): The location to the Nginx tarball. This tarball must contain the Nginx version as specified by `version`. If `tarball` is given then Nginx will not be downloaded; it will be extracted from this tarball instead.

Other optional options:

- download_binaries: If true then RuntimeInstaller will attempt to download a precompiled Nginx binary and precompiled Phusion Passenger support binaries from the network, if they exist for the current platform. The default is true. Note that binary downloading only happens when Phusion Passenger is installed from an official release package.

- binaries_url_root: The URL on which to look for the aforementioned binaries. The default points to the Phusion website.

### Public Class Methods

new(*args) click to toggle source

    # File lib/phusion_passenger/standalone/runtime_installer.rb, line 75
    def initialize(*args)
            super(*args)
            raise ArgumentError, "At least one target must be given" if @targets.nil? || @targets.empty?
            if @targets.include?(:support_binaries)
                    if PhusionPassenger.natively_packaged?
                            raise ArgumentError, "You cannot specify :support_binaries as a " +
                                    "target when natively packaged"
                    end
                    raise ArgumentError, ":support_dir must be given" if !@support_dir
            end
            if @targets.include?(:nginx)
                    raise ArgumentError, ":nginx_dir must be given" if !@nginx_dir
                    raise ArgumentError, ":lib_dir must be given" if !@lib_dir
            end
    end

### Protected Instance Methods

after_install() click to toggle source

    # File lib/phusion_passenger/standalone/runtime_installer.rb, line 140
    def after_install
            super
            FileUtils.remove_entry_secure(@working_dir) if @working_dir
            @plugin.call_hook(:runtime_installer_cleanup) if @plugin
    end

before_install() click to toggle source

    # File lib/phusion_passenger/standalone/runtime_installer.rb, line 131
    def before_install
            super
            @plugin.call_hook(:runtime_installer_start, self) if @plugin
            @working_dir = PhusionPassenger::Utils.mktmpdir("passenger.", PlatformInfo.tmpexedir)
            @nginx_version ||= PREFERRED_NGINX_VERSION
            @download_binaries = true if !defined?(@download_binaries)
            @binaries_url_root ||= BINARIES_URL_ROOT
    end

dependencies() click to toggle source

    # File lib/phusion_passenger/standalone/runtime_installer.rb, line 92
    def dependencies
            specs = [
                    'depcheck_specs/compiler_toolchain',
                    'depcheck_specs/ruby',
                    'depcheck_specs/gems',
                    'depcheck_specs/libs',
                    'depcheck_specs/utilities'
            ]
            ids = [
                    'gcc',
                    'g++',
                    'gmake',
                    'ruby-openssl',
                    'rubygems',
                    'rake',
                    'rack',
                    'libcurl-dev',
                    'openssl-dev',
                    'zlib-dev',
                    'pcre-dev',
                    'daemon_controller >= 1.1.0'
            ].compact
            return [specs, ids]
    end

run_steps() click to toggle source

    # File lib/phusion_passenger/standalone/runtime_installer.rb, line 121
    def run_steps
            show_welcome_screen if @nginx_dir
            check_whether_os_is_broken
            check_for_download_tool
            download_or_compile_binaries
            puts
            puts "<green><b>All done!</b></green>"
            puts
    end

users_guide() click to toggle source

    # File lib/phusion_passenger/standalone/runtime_installer.rb, line 117
    def users_guide
            return "#{PhusionPassenger.doc_dir}/Users guide Standalone.html"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.