| Class | PhusionPassenger::Standalone::RuntimeInstaller |
| In: |
lib/phusion_passenger/standalone/runtime_installer.rb
|
| Parent: | 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:
If you want RuntimeInstaller to compile and install Nginx, then you must specify these options:
If you want RuntimeInstaller to compile and install the Phusion Passenger support files, then you must specify these:
Other optional options:
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
172: def after_install
173: super
174: FileUtils.rm_rf(@working_dir)
175: @plugin.call_hook(:runtime_installer_cleanup) if @plugin
176: end
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 162
162: def before_install
163: super
164: @plugin.call_hook(:runtime_installer_start, self) if @plugin
165: @working_dir = "/tmp/#{myself}-passenger-standalone-#{Process.pid}"
166: FileUtils.rm_rf(@working_dir)
167: FileUtils.mkdir_p(@working_dir)
168: @download_binaries = true if !defined?(@download_binaries)
169: @binaries_url_root ||= STANDALONE_BINARIES_URL_ROOT
170: end
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 76
76: def dependencies
77: result = [
78: Dependencies::GCC,
79: Dependencies::GnuMake,
80: Dependencies::DownloadTool,
81: Dependencies::Ruby_DevHeaders,
82: Dependencies::Ruby_OpenSSL,
83: Dependencies::RubyGems,
84: Dependencies::Rake,
85: Dependencies::Rack,
86: Dependencies::Curl_Dev,
87: Dependencies::OpenSSL_Dev,
88: Dependencies::Zlib_Dev,
89: Dependencies::Daemon_Controller,
90: ]
91: if Dependencies.fastthread_required?
92: result << Dependencies::FastThread
93: end
94: if Dependencies.asciidoc_required?
95: result << Dependencies::AsciiDoc
96: end
97: return result
98: end
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 104
104: def install!
105: if @support_dir && @nginx_dir
106: show_welcome_screen
107: end
108: check_dependencies(false) || exit(1)
109: puts
110: if passenger_support_files_need_to_be_installed?
111: check_whether_we_can_write_to(@support_dir) || exit(1)
112: end
113: if nginx_needs_to_be_installed?
114: check_whether_we_can_write_to(@nginx_dir) || exit(1)
115: end
116:
117: if passenger_support_files_need_to_be_installed? && should_download_binaries?
118: download_and_extract_passenger_binaries(@support_dir) do |progress, total|
119: show_progress(progress, total, 1, 1, "Extracting Passenger binaries...")
120: end
121: puts
122: puts
123: end
124: if nginx_needs_to_be_installed? && should_download_binaries?
125: download_and_extract_nginx_binaries(@nginx_dir) do |progress, total|
126: show_progress(progress, total, 1, 1, "Extracting Nginx binaries...")
127: end
128: puts
129: puts
130: end
131:
132: if nginx_needs_to_be_installed?
133: nginx_source_dir = download_and_extract_nginx_sources do |progress, total|
134: show_progress(progress, total, 1, 7, "Extracting...")
135: end
136: if nginx_source_dir.nil?
137: puts
138: show_possible_solutions_for_download_and_extraction_problems
139: exit(1)
140: end
141: end
142: if passenger_support_files_need_to_be_installed?
143: install_passenger_support_files do |progress, total, phase, status_text|
144: if phase == 1
145: show_progress(progress, total, 2, 7, status_text)
146: else
147: show_progress(progress, total, 3..5, 7, status_text)
148: end
149: end
150: end
151: if nginx_needs_to_be_installed?
152: install_nginx_from_source(nginx_source_dir) do |progress, total, status_text|
153: show_progress(progress, total, 6..7, 7, status_text)
154: end
155: end
156:
157: puts
158: color_puts "<green><b>All done!</b></green>"
159: puts
160: end