AbstractInstaller
Installs the Phusion Passenger Standalone runtime by downloading and compiling Nginx, compiling the Phusion Passenger support binaries, and storing the results in the designated directories. This installer is entirely non-interactive.
The following option must be given:
source_root: Path to the Phusion Passenger source root.
If you want RuntimeInstaller to compile and install Nginx, then you must specify these options:
nginx_dir: Nginx will be installed into this directory.
support_dir: See below.
version (optional): The Nginx version to download. If not given then a hardcoded version number will be used.
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.
If you want RuntimeInstaller to compile and install the Phusion Passenger support files, then you must specify these:
support_dir: The support files will be installed here. Should not equal source_root, or funny things might happen.
Other optional options:
download_binaries: If true then RuntimeInstaller will attempt to download precompiled Nginx binaries and precompiled Phusion Passenger support files from the network, if they exist for the current platform. The default is false.
binaries_url_root: The URL on which to look for the aforementioned binaries. The default points to the Phusion website.
Please note that RuntimeInstaller will try to avoid compiling/installing things that don't need to be compiled/installed. This is done by checking whether some key files exist, and concluding that something doesn't need to be compiled/installed if they do. This quick check is of course not perfect; if you want to force a recompilation/reinstall then you should remove nginx_dir and support_dir before starting this installer.
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 172 def after_install super FileUtils.rm_rf(@working_dir) @plugin.call_hook(:runtime_installer_cleanup) if @plugin end
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 162 def before_install super @plugin.call_hook(:runtime_installer_start, self) if @plugin @working_dir = "/tmp/#{myself}-passenger-standalone-#{Process.pid}" FileUtils.rm_rf(@working_dir) FileUtils.mkdir_p(@working_dir) @download_binaries = true if !defined?(@download_binaries) @binaries_url_root ||= STANDALONE_BINARIES_URL_ROOT end
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 76 def dependencies result = [ Dependencies::GCC, Dependencies::GnuMake, Dependencies::DownloadTool, Dependencies::Ruby_DevHeaders, Dependencies::Ruby_OpenSSL, Dependencies::RubyGems, Dependencies::Rake, Dependencies::Rack, Dependencies::Curl_Dev, Dependencies::OpenSSL_Dev, Dependencies::Zlib_Dev, Dependencies::Daemon_Controller, ] if Dependencies.fastthread_required? result << Dependencies::FastThread end if Dependencies.asciidoc_required? result << Dependencies::AsciiDoc end return result end
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 104 def install! if @support_dir && @nginx_dir show_welcome_screen end check_dependencies(false) || exit(1) puts if passenger_support_files_need_to_be_installed? check_whether_we_can_write_to(@support_dir) || exit(1) end if nginx_needs_to_be_installed? check_whether_we_can_write_to(@nginx_dir) || exit(1) end if passenger_support_files_need_to_be_installed? && should_download_binaries? download_and_extract_passenger_binaries(@support_dir) do |progress, total| show_progress(progress, total, 1, 1, "Extracting Passenger binaries...") end puts puts end if nginx_needs_to_be_installed? && should_download_binaries? download_and_extract_nginx_binaries(@nginx_dir) do |progress, total| show_progress(progress, total, 1, 1, "Extracting Nginx binaries...") end puts puts end if nginx_needs_to_be_installed? nginx_source_dir = download_and_extract_nginx_sources do |progress, total| show_progress(progress, total, 1, 7, "Extracting...") end if nginx_source_dir.nil? puts show_possible_solutions_for_download_and_extraction_problems exit(1) end end if passenger_support_files_need_to_be_installed? install_passenger_support_files do |progress, total, phase, status_text| if phase == 1 show_progress(progress, total, 2, 7, status_text) else show_progress(progress, total, 3..5, 7, status_text) end end end if nginx_needs_to_be_installed? install_nginx_from_source(nginx_source_dir) do |progress, total, status_text| show_progress(progress, total, 6..7, 7, status_text) end end puts color_puts "<green><b>All done!</b></green>" puts end
Generated with the Darkfish Rdoc Generator 2.