passenger 3.9.2.beta → 4.0.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of passenger might be problematic. Click here for more details.
- data/.travis.yml +3 -0
- data/NEWS +77 -7
- data/README.md +3 -11
- data/bin/passenger-install-apache2-module +24 -20
- data/bin/passenger-install-nginx-module +25 -23
- data/build/agents.rb +11 -0
- data/build/apache2.rb +9 -5
- data/build/basics.rb +37 -30
- data/build/common_library.rb +4 -1
- data/build/cplusplus_support.rb +5 -5
- data/build/cxx_tests.rb +28 -8
- data/build/integration_tests.rb +6 -3
- data/build/nginx.rb +3 -3
- data/build/packaging.rb +95 -57
- data/build/ruby_extension.rb +34 -21
- data/build/ruby_tests.rb +4 -2
- data/build/test_basics.rb +1 -1
- data/dev/run_travis.sh +36 -1
- data/doc/Users guide Apache.html +425 -308
- data/doc/Users guide Apache.idmap.txt +78 -70
- data/doc/Users guide Apache.index.sqlite3 +0 -0
- data/doc/Users guide Apache.txt +33 -92
- data/doc/Users guide Nginx.html +519 -220
- data/doc/Users guide Nginx.idmap.txt +78 -60
- data/doc/Users guide Nginx.txt +115 -26
- data/doc/Users guide Standalone.html +8 -2
- data/doc/users_guide_snippets/analysis_and_system_maintenance.txt +1 -7
- data/doc/users_guide_snippets/installation.txt +167 -22
- data/doc/users_guide_snippets/rackup_specifications.txt +4 -0
- data/doc/users_guide_snippets/since_version.txt +1 -0
- data/doc/users_guide_snippets/support_information.txt +3 -7
- data/doc/users_guide_snippets/tips.txt +0 -24
- data/ext/apache2/Configuration.cpp +11 -33
- data/ext/apache2/Configuration.hpp +3 -18
- data/ext/apache2/DirectoryMapper.h +20 -70
- data/ext/apache2/Hooks.cpp +2 -2
- data/ext/common/AgentsStarter.cpp +0 -2
- data/ext/common/AgentsStarter.h +0 -1
- data/ext/common/AgentsStarter.hpp +1 -3
- data/ext/common/ApplicationPool2/AppTypes.cpp +74 -0
- data/ext/common/ApplicationPool2/AppTypes.h +202 -0
- data/ext/common/ApplicationPool2/Common.h +12 -10
- data/ext/common/ApplicationPool2/DirectSpawner.h +256 -0
- data/ext/common/ApplicationPool2/DummySpawner.h +90 -0
- data/ext/common/ApplicationPool2/Group.h +311 -94
- data/ext/common/ApplicationPool2/Implementation.cpp +405 -145
- data/ext/common/ApplicationPool2/Options.h +24 -26
- data/ext/common/ApplicationPool2/PipeWatcher.h +20 -13
- data/ext/common/ApplicationPool2/Pool.h +326 -183
- data/ext/common/ApplicationPool2/Process.h +205 -55
- data/ext/common/ApplicationPool2/README.md +1 -1
- data/ext/common/ApplicationPool2/Session.h +21 -10
- data/ext/common/ApplicationPool2/SmartSpawner.h +801 -0
- data/ext/common/ApplicationPool2/Spawner.h +141 -1149
- data/ext/common/ApplicationPool2/SpawnerFactory.h +132 -0
- data/ext/common/ApplicationPool2/SuperGroup.h +146 -223
- data/ext/common/Constants.h +4 -2
- data/ext/common/Exceptions.h +23 -1
- data/ext/common/Logging.cpp +17 -6
- data/ext/common/Logging.h +37 -7
- data/ext/common/ResourceLocator.h +1 -1
- data/ext/common/Utils.cpp +49 -1
- data/ext/common/Utils.h +13 -4
- data/ext/common/{AnsiColorConstants.h → Utils/AnsiColorConstants.h} +0 -0
- data/ext/common/{BCrypt.cpp → Utils/BCrypt.cpp} +0 -0
- data/ext/common/{BCrypt.h → Utils/BCrypt.h} +0 -0
- data/ext/common/{Blowfish.c → Utils/Blowfish.c} +0 -0
- data/ext/common/{Blowfish.h → Utils/Blowfish.h} +0 -0
- data/ext/common/Utils/CachedFileStat.hpp +27 -25
- data/ext/common/Utils/Curl.h +184 -0
- data/ext/common/{HttpConstants.h → Utils/HttpConstants.h} +3 -0
- data/ext/common/Utils/IOUtils.cpp +6 -2
- data/ext/common/{IniFile.h → Utils/IniFile.h} +0 -0
- data/ext/common/Utils/LargeFiles.cpp +30 -0
- data/ext/common/Utils/LargeFiles.h +40 -0
- data/ext/common/Utils/StrIntUtils.cpp +72 -8
- data/ext/common/Utils/StrIntUtils.h +24 -2
- data/ext/common/Utils/StringMap.h +12 -2
- data/ext/common/Utils/VariantMap.h +51 -2
- data/ext/common/Utils/jsoncpp.cpp +1 -1
- data/ext/common/agents/Base.cpp +147 -11
- data/ext/common/agents/HelperAgent/AgentOptions.h +14 -6
- data/ext/common/agents/HelperAgent/Main.cpp +79 -19
- data/ext/common/agents/HelperAgent/RequestHandler.h +36 -16
- data/ext/common/agents/LoggingAgent/LoggingServer.h +3 -5
- data/ext/common/agents/LoggingAgent/Main.cpp +2 -4
- data/ext/common/agents/LoggingAgent/RemoteSender.h +18 -24
- data/ext/common/agents/SpawnPreparer.cpp +7 -0
- data/ext/common/agents/Watchdog/Main.cpp +96 -38
- data/ext/nginx/Configuration.c +26 -22
- data/ext/nginx/Configuration.h +4 -2
- data/ext/nginx/ContentHandler.c +23 -52
- data/ext/nginx/ContentHandler.h +5 -11
- data/ext/nginx/config +10 -3
- data/ext/nginx/ngx_http_passenger_module.c +21 -6
- data/ext/nginx/ngx_http_passenger_module.h +4 -1
- data/ext/oxt/dynamic_thread_group.hpp +9 -1
- data/ext/oxt/system_calls.cpp +2 -2
- data/ext/ruby/extconf.rb +2 -1
- data/helper-scripts/backtrace-sanitizer.rb +2 -0
- data/helper-scripts/wsgi-loader.py +54 -21
- data/lib/phusion_passenger.rb +5 -3
- data/lib/phusion_passenger/abstract_installer.rb +18 -41
- data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
- data/lib/phusion_passenger/admin_tools/server_instance.rb +2 -2
- data/lib/phusion_passenger/common_library.rb +23 -3
- data/lib/phusion_passenger/debug_logging.rb +10 -3
- data/lib/phusion_passenger/packaging.rb +1 -0
- data/lib/phusion_passenger/platform_info.rb +113 -115
- data/lib/phusion_passenger/platform_info/compiler.rb +224 -134
- data/lib/phusion_passenger/platform_info/cxx_portability.rb +143 -0
- data/lib/phusion_passenger/platform_info/depcheck.rb +371 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +124 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +97 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/gems.rb +39 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/libs.rb +118 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +137 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/utilities.rb +15 -0
- data/lib/phusion_passenger/platform_info/operating_system.rb +6 -5
- data/lib/phusion_passenger/platform_info/ruby.rb +45 -34
- data/lib/phusion_passenger/request_handler.rb +35 -22
- data/lib/phusion_passenger/request_handler/thread_handler.rb +5 -6
- data/lib/phusion_passenger/ruby_core_enhancements.rb +7 -1
- data/lib/phusion_passenger/standalone/runtime_installer.rb +43 -34
- data/lib/phusion_passenger/utils/robust_interruption.rb +34 -18
- data/passenger.gemspec +25 -0
- data/resources/templates/standalone/config.erb +3 -1
- data/test/config.json.travis +2 -2
- data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +37 -5
- data/test/cxx/ApplicationPool2/PoolTest.cpp +143 -50
- data/test/cxx/ApplicationPool2/ProcessTest.cpp +8 -0
- data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +28 -17
- data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +31 -26
- data/test/cxx/RequestHandlerTest.cpp +17 -1
- data/test/cxx/UtilsTest.cpp +84 -10
- data/test/integration_tests/apache2_tests.rb +49 -163
- data/test/integration_tests/hello_world_wsgi_spec.rb +2 -2
- data/test/integration_tests/mycook_spec.rb +1 -1
- data/test/integration_tests/nginx_tests.rb +37 -19
- data/test/ruby/request_handler_spec.rb +1 -0
- data/test/ruby/spec_helper.rb +52 -1
- data/test/stub/nginx/nginx.conf.erb +2 -0
- data/test/stub/rack/start.rb +5 -0
- data/test/stub/rails3.0/Gemfile.lock +30 -30
- data/test/stub/rails3.1/Gemfile +1 -1
- data/test/stub/rails3.1/Gemfile.lock +3 -3
- data/test/stub/rails3.2/Gemfile +1 -1
- data/test/stub/rails3.2/Gemfile.lock +4 -4
- data/test/stub/rails_apps/2.3/mycook/app/controllers/welcome_controller.rb +1 -1
- data/test/stub/rails_apps/2.3/mycook/app/helpers/recipes_helper.rb +2 -0
- data/test/stub/rails_apps/2.3/mycook/app/helpers/test_helper.rb +2 -0
- data/test/stub/rails_apps/2.3/mycook/app/helpers/uploads_helper.rb +2 -0
- data/test/stub/rails_apps/2.3/mycook/app/helpers/welcome_helper.rb +2 -0
- data/test/support/nginx_controller.rb +2 -1
- metadata +160 -156
- data/build/gempackagetask.rb +0 -99
- data/build/packagetask.rb +0 -186
- data/ext/common/StringListCreator.h +0 -83
- data/lib/phusion_passenger/dependencies.rb +0 -657
@@ -20,25 +20,37 @@
|
|
20
20
|
|
21
21
|
2. Installation => installing-phusion-passenger-hn03ac
|
22
22
|
|
23
|
-
2.1.
|
23
|
+
2.1. Synopsis => synopsis-1uu3sqp
|
24
24
|
|
25
|
-
2.2. Generic installation, upgrade and downgrade method: via
|
25
|
+
2.2. Generic installation, upgrade and downgrade method: via RubyGems => generic-installation-upgrade-and-downgrade-method-via-rubygems-76uol7
|
26
26
|
|
27
|
-
2.3.
|
27
|
+
2.3. Generic installation, upgrade and downgrade method: via tarball => generic-installation-upgrade-and-downgrade-method-via-tarball-2gkx43
|
28
28
|
|
29
|
-
2.4. Installing or upgrading on
|
29
|
+
2.4. Installing or upgrading on Debian 6 or Ubuntu => installing-or-upgrading-on-ubuntu-fw5fvp
|
30
30
|
|
31
|
-
2.5.
|
31
|
+
2.5. Installing or upgrading on Red Hat, Fedora, CentOS or ScientificLinux => installing-or-upgrading-on-red-hat-fedora-centos-or-scientificlinux-1uus5a1
|
32
32
|
|
33
|
-
2.6.
|
33
|
+
2.6. Upgrading from open source to Enterprise => upgrading-from-open-source-to-enterprise-1a58c2b
|
34
34
|
|
35
|
-
2.7.
|
35
|
+
2.7. Non-interactive, automatic, headless installs or upgrades => non-interactive-automatic-headless-installs-or-upgrades-834ymv
|
36
36
|
|
37
|
-
2.8.
|
37
|
+
2.8. Customizing the compilation process => customizing-the-compilation-process-u4cdcf
|
38
38
|
|
39
|
-
2.
|
39
|
+
2.8.1. Setting the compiler => setting-the-compiler-1l6dpe1
|
40
40
|
|
41
|
-
2.
|
41
|
+
2.8.2. Adding additional compiler or linker flags => adding-additional-compiler-or-linker-flags-1jehjon
|
42
|
+
|
43
|
+
2.8.3. Forcing location of certain command line tools => forcing-location-of-certain-command-line-tools-1j93cki
|
44
|
+
|
45
|
+
2.9. Installing as a normal Nginx module without using the installer => installing-as-a-normal-nginx-module-without-using-the-installer-1kkpes5
|
46
|
+
|
47
|
+
2.10. Creating an Nginx init script => creating-an-nginx-init-script-1kd8zg5
|
48
|
+
|
49
|
+
2.11. Disabling without uninstalling => disabling-without-uninstalling-1t5tqan
|
50
|
+
|
51
|
+
2.12. Uninstalling => uninstalling-phusion-passenger-wuycvb
|
52
|
+
|
53
|
+
2.13. Moving to a different directory => moving-to-a-different-directory-gif3wo
|
42
54
|
|
43
55
|
3. Deploying a Ruby on Rails 1.x or 2.x (but NOT Rails >= 3) application => deploying-a-ruby-on-rails-1-x-or-2-x-but-not-rails-3-application-b69gqa
|
44
56
|
|
@@ -90,93 +102,101 @@
|
|
90
102
|
|
91
103
|
6.2. passenger_ruby <filename> => passenger-ruby-filename--1gnok5k
|
92
104
|
|
93
|
-
6.3.
|
105
|
+
6.3. passenger_python <filename> => passenger-python-filename--14p554
|
94
106
|
|
95
|
-
6.4.
|
107
|
+
6.4. passenger_app_root <path/to/root> => passenger-app-root-path-to-root--1dbudc6
|
96
108
|
|
97
|
-
6.5.
|
109
|
+
6.5. passenger_spawn_method <string> => passenger-spawn-method-string--1sc6njl
|
98
110
|
|
99
|
-
6.6.
|
111
|
+
6.6. passenger_rolling_restarts <on|off> => passenger-rolling-restarts
|
100
112
|
|
101
|
-
6.
|
113
|
+
6.7. passenger_resist_deployment_errors <on|off> => passenger-resist-deployment-errors-on-off--k9yf1
|
102
114
|
|
103
|
-
6.
|
115
|
+
6.8. passenger_temp_dir <directory> => passenger-temp-dir-directory--1t3opri
|
104
116
|
|
105
|
-
6.
|
117
|
+
6.9. Important deployment options => important-deployment-options-av567
|
106
118
|
|
107
|
-
6.
|
119
|
+
6.9.1. passenger_enabled <on|off> => passenger-enabled-on-off--1rpb2t7
|
108
120
|
|
109
|
-
6.
|
121
|
+
6.9.2. passenger_base_uri <uri> => passenger-base-uri-uri--1xtuo50
|
110
122
|
|
111
|
-
6.
|
123
|
+
6.10. Connection handling options => connection-handling-options-8jgq90
|
112
124
|
|
113
|
-
6.
|
125
|
+
6.10.1. passenger_ignore_client_abort <on|off> => passenger-ignore-client-abort
|
114
126
|
|
115
|
-
6.
|
127
|
+
6.10.2. passenger_set_cgi_param <CGI environment name> <value> => passenger-set-cgi-param-cgi-environment-name-value--rx9gc0
|
116
128
|
|
117
|
-
6.
|
129
|
+
6.10.3. passenger_pass_header <header name> => passenger-pass-header-header-name--1cg31je
|
118
130
|
|
119
|
-
6.
|
131
|
+
6.10.4. passenger_buffer_response <on|off> => passenger-buffer-response
|
120
132
|
|
121
|
-
6.
|
133
|
+
6.10.5. passenger_buffer_size => passenger-buffer-size-1jfkq87
|
122
134
|
|
123
|
-
6.
|
135
|
+
6.10.6. passenger_buffers => passenger-busy-buffers
|
124
136
|
|
125
|
-
6.
|
137
|
+
6.10.7. passenger_busy_buffer_size => passenger-busy-buffer-size-124sj61
|
126
138
|
|
127
|
-
6.
|
139
|
+
6.11. Security options => security-options-1bv93g4
|
128
140
|
|
129
|
-
6.
|
141
|
+
6.11.1. passenger_user_switching <on|off> => passenger-user-switching-on-off--1p37u3l
|
130
142
|
|
131
|
-
6.
|
143
|
+
6.11.2. passenger_user <username> => passenger-user-username--b06ur7
|
132
144
|
|
133
|
-
6.
|
145
|
+
6.11.3. passenger_group <group name> => passenger-user-group-name--1fco4j7
|
134
146
|
|
135
|
-
6.
|
147
|
+
6.11.4. passenger_default_user <username> => passenger-default-user-username--1h6cdmf
|
136
148
|
|
137
|
-
6.
|
149
|
+
6.11.5. Passenger_default_group <group name> => passenger-default-group-group-name--1qxn2qa
|
138
150
|
|
139
|
-
6.
|
151
|
+
6.11.6. passenger_show_version_in_header <on|off> => passenger-show-version-in-header-on-off--2h49av
|
140
152
|
|
141
|
-
6.
|
153
|
+
6.11.7. passenger_friendly_error_pages <on|off> => passenger-friendly-error-pages-on-off--1ti1a0e
|
142
154
|
|
143
|
-
6.
|
155
|
+
6.12. Resource control and optimization options => resource-control-and-optimization-options-xd7evs
|
144
156
|
|
145
|
-
6.
|
157
|
+
6.12.1. passenger_max_pool_size <integer> => passenger-max-pool-size-integer--3jzefs
|
146
158
|
|
147
|
-
6.
|
159
|
+
6.12.2. passenger_min_instances <integer> => passenger-min-instances-integer--uclykt
|
148
160
|
|
149
|
-
6.
|
161
|
+
6.12.3. passenger_max_instances <integer> => passenger-max-instances
|
150
162
|
|
151
|
-
6.
|
163
|
+
6.12.4. passenger_max_instances_per_app <integer> => passenger-max-instances-per-app-integer--1xhbbne
|
152
164
|
|
153
|
-
6.
|
165
|
+
6.12.5. passenger_pool_idle_time <integer> => passenger-pool-idle-time-integer--xcw65o
|
154
166
|
|
155
|
-
6.
|
167
|
+
6.12.6. passenger_max_preloader_idle_time <integer> => rails-app-spawner-idle-time-integer--1xjqe4b
|
156
168
|
|
157
|
-
6.
|
169
|
+
6.12.7. passenger_concurrency_model <process|thread> => passenger-concurrency-model-process-thread--brcvkk
|
158
170
|
|
159
|
-
6.
|
171
|
+
6.12.8. passenger_thread_count <number> => passenger-thread-count-number--1kd6ffy
|
160
172
|
|
161
|
-
6.
|
173
|
+
6.12.9. passenger_max_requests <integer> => passenger-max-requests-integer--sgzint
|
162
174
|
|
163
|
-
6.10.
|
175
|
+
6.12.10. passenger_max_request_time <seconds> => passenger-max-request-time-seconds--1htog2g
|
164
176
|
|
165
|
-
6.
|
177
|
+
6.12.11. passenger_memory_limit <integer> => passenger-memory-limit-integer--1ry7dwx
|
166
178
|
|
167
|
-
6.
|
179
|
+
6.12.12. passenger_pre_start <url> => passenger-pre-start-url--npldeb
|
168
180
|
|
169
|
-
6.
|
181
|
+
6.13. Logging and debugging options => logging-and-debugging-options-14e91ni
|
170
182
|
|
171
|
-
6.
|
183
|
+
6.13.1. passenger_log_level <integer> => passenger-log-level-integer--17snhon
|
172
184
|
|
173
|
-
6.
|
185
|
+
6.13.2. passenger_debug_log_file <filename> => passenger-debug-log-file-filename--21ubaj
|
174
186
|
|
175
|
-
6.
|
187
|
+
6.13.3. passenger_debugger <on|off> => passenger-debugger-on-off--1wkuq85
|
176
188
|
|
177
|
-
6.
|
189
|
+
6.14. Ruby on Rails-specific options => ruby-on-rails-specific-options-12vfokt
|
178
190
|
|
179
|
-
6.
|
191
|
+
6.14.1. rails_env <string> => rails-env-string--jlh7v9
|
192
|
+
|
193
|
+
6.15. Rack and Rails >= 3 specific options => rack-specific-options-13yvdxs
|
194
|
+
|
195
|
+
6.15.1. rack_env <string> => rack-env-string--tqmrt0
|
196
|
+
|
197
|
+
6.16. Deprecated options => deprecated-options-1dtzo0g
|
198
|
+
|
199
|
+
6.16.1. rails_spawn_method => rails-spawn-method-17vdnpt
|
180
200
|
|
181
201
|
7. Analysis and system maintenance => analysis-and-system-maintenance-1nnlnj8
|
182
202
|
|
@@ -200,15 +220,13 @@
|
|
200
220
|
|
201
221
|
8.4. Bundler support => bundler-support-19v1h43
|
202
222
|
|
203
|
-
8.5.
|
204
|
-
|
205
|
-
8.6. Installing multiple Ruby on Rails versions => installing-multiple-ruby-on-rails-versions-1bp1fff
|
223
|
+
8.5. Installing multiple Ruby on Rails versions => installing-multiple-ruby-on-rails-versions-1bp1fff
|
206
224
|
|
207
|
-
8.
|
225
|
+
8.6. Making the application restart after each request => making-the-application-restart-after-each-request-vimy48
|
208
226
|
|
209
|
-
8.
|
227
|
+
8.7. How to fix broken images/CSS/JavaScript URIs in sub-URI deployments => how-to-fix-broken-images-css-javascript-uris-in-sub-uri-deployments-11mzwt6
|
210
228
|
|
211
|
-
8.
|
229
|
+
8.8. Out-of-Band Garbage Work and Out-of-Band Garbage Collection => out-of-band-garbage-work-and-out-of-band-garbage-collection-v89lu2
|
212
230
|
|
213
231
|
9. Under the hood => under-the-hood-8uney
|
214
232
|
|
data/doc/Users guide Nginx.txt
CHANGED
@@ -463,12 +463,64 @@ This required option may only occur once, in the 'http' configuration block.
|
|
463
463
|
=== passenger_ruby <filename> ===
|
464
464
|
This option allows one to specify the Ruby interpreter to use.
|
465
465
|
|
466
|
-
|
466
|
+
Since version 4.0.0, this option may occur in the following places:
|
467
|
+
|
468
|
+
* In the 'http' configuration block.
|
469
|
+
* In a 'server' configuration block.
|
470
|
+
* In a 'location' configuration block.
|
471
|
+
* In an 'if' configuration scope.
|
472
|
+
|
473
|
+
If you want to use a different Ruby interpreter for two different applications then you should define different `passenger_ruby` directives in different 'http' blocks.
|
474
|
+
|
475
|
+
In versions prior to 4.0.0, only a single Ruby version is supported for the entire Nginx instance, so `passenger_ruby` may only occur in the 'http' configuration block.
|
476
|
+
|
477
|
+
The default value is 'ruby', meaning that the Ruby interpreter will be looked up according to the `PATH` environment variable.
|
478
|
+
|
479
|
+
=== passenger_python <filename> ===
|
480
|
+
:version: 4.0.0
|
481
|
+
include::users_guide_snippets/since_version.txt[]
|
482
|
+
|
483
|
+
This option allows one to specify the Python interpreter to use. It may occur in the following places:
|
484
|
+
|
485
|
+
* In the 'http' configuration block.
|
467
486
|
* In a 'server' configuration block.
|
468
487
|
* In a 'location' configuration block.
|
469
488
|
* In an 'if' configuration scope.
|
470
489
|
|
471
|
-
|
490
|
+
If you want to use a different Python interpreter for two different applications then you should define different `passenger_python` directives in different 'http' blocks.
|
491
|
+
|
492
|
+
The default value is 'python', meaning that the Python interpreter will be looked up according to the `PATH` environment variable.
|
493
|
+
|
494
|
+
[[PassengerAppRoot]]
|
495
|
+
=== passenger_app_root <path/to/root> ===
|
496
|
+
:version: 4.0.0
|
497
|
+
include::users_guide_snippets/since_version.txt[]
|
498
|
+
By default, Phusion Passenger assumes that the application's root directory
|
499
|
+
is the parent directory of the 'public' directory. This option allows one to
|
500
|
+
specify the application's root independently from the Nginx 'root', which
|
501
|
+
is useful if the 'public' directory lives in a non-standard place.
|
502
|
+
|
503
|
+
This option may occur in the following places:
|
504
|
+
|
505
|
+
* In the 'http' configuration block.
|
506
|
+
* In a 'server' configuration block.
|
507
|
+
* In a 'location' configuration block.
|
508
|
+
* In an 'if' configuration scope.
|
509
|
+
|
510
|
+
In each place, it may be specified at most once.
|
511
|
+
|
512
|
+
Example:
|
513
|
+
|
514
|
+
-----------------------------
|
515
|
+
server {
|
516
|
+
server_name test.host;
|
517
|
+
root /var/rails/zena/sites/example.com/public;
|
518
|
+
# normally Phusion Passenger would
|
519
|
+
# have assumed that the application
|
520
|
+
# root is "/var/rails/zena/sites/example.com"
|
521
|
+
passenger_app_root /var/rails/zena;
|
522
|
+
}
|
523
|
+
-----------------------------
|
472
524
|
|
473
525
|
[[PassengerSpawnMethod]]
|
474
526
|
=== passenger_spawn_method <string> ===
|
@@ -566,6 +618,35 @@ This option may occur in the following places:
|
|
566
618
|
|
567
619
|
In each place, it may be specified at most once. The default value is 'off'.
|
568
620
|
|
621
|
+
[[PassengerTempDir]]
|
622
|
+
=== passenger_temp_dir <directory> ===
|
623
|
+
Specifies the directory that Phusion Passenger should use for storing temporary
|
624
|
+
files. This includes things such as Unix socket files.
|
625
|
+
|
626
|
+
This option may only be specified in the 'http' configuration block. The
|
627
|
+
default temp directory that Phusion Passenger uses is '/tmp'.
|
628
|
+
|
629
|
+
This option is especially useful if Nginx is not allowed to write to /tmp
|
630
|
+
(which is the case on some systems with strict SELinux policies) or if the
|
631
|
+
partition that /tmp lives on doesn't have enough disk space.
|
632
|
+
|
633
|
+
.Command line tools
|
634
|
+
Some Phusion Passenger command line administration tools, such as
|
635
|
+
`passenger-status`, must know what Phusion Passenger's temp directory is
|
636
|
+
in order to function properly. You can pass the directory through the
|
637
|
+
`PASSENGER_TMPDIR` environment variable, or the `TMPDIR` environment variable
|
638
|
+
(the former will be used if both are specified).
|
639
|
+
|
640
|
+
For example, if you set 'passenger_temp_dir' to '/my_temp_dir', then invoke
|
641
|
+
`passenger-status` after you've set the `PASSENGER_TMPDIR` or `TMPDIR`
|
642
|
+
environment variable, like this:
|
643
|
+
|
644
|
+
----------------------------------------------------------
|
645
|
+
export PASSENGER_TMPDIR=/my_temp-dir
|
646
|
+
sudo -E passenger-status
|
647
|
+
# The -E option tells 'sudo' to preserve environment variables.
|
648
|
+
----------------------------------------------------------
|
649
|
+
|
569
650
|
=== Important deployment options ===
|
570
651
|
==== passenger_enabled <on|off> ====
|
571
652
|
This option may be specified in the 'http' configuration block, a
|
@@ -811,6 +892,30 @@ This option may only occur once, in the 'http' configuration block.
|
|
811
892
|
The default value is the primary group of the user specifified by
|
812
893
|
<<PassengerDefaultUser,passenger_default_user>>.
|
813
894
|
|
895
|
+
==== passenger_show_version_in_header <on|off> ====
|
896
|
+
When turned on, Phusion Passenger will output its version number in the `Server` and `X-Powered-By` header in all Phusion Passenger-served requests:
|
897
|
+
|
898
|
+
----------------------------------------------------
|
899
|
+
Server: nginx/1.3.11 + Phusion Passenger 4.0.0
|
900
|
+
X-Powered-By: Phusion Passenger 4.0.0
|
901
|
+
----------------------------------------------------
|
902
|
+
|
903
|
+
When turned off, the version number will be hidden:
|
904
|
+
|
905
|
+
----------------------------------------------------
|
906
|
+
Server: nginx/1.3.11 + Phusion Passenger
|
907
|
+
X-Powered-By: Phusion Passenger
|
908
|
+
----------------------------------------------------
|
909
|
+
|
910
|
+
This option may occur in the following places:
|
911
|
+
|
912
|
+
* In the 'http' configuration block.
|
913
|
+
* In a 'server' configuration block.
|
914
|
+
* In a 'location' configuration block.
|
915
|
+
* In an 'if' configuration scope.
|
916
|
+
|
917
|
+
In each place, it may be specified at most once. The default value is 'on'.
|
918
|
+
|
814
919
|
==== passenger_friendly_error_pages <on|off> ====
|
815
920
|
Phusion Passenger can display friendly error pages whenever an application fails
|
816
921
|
to start. This friendly error page presents the startup error message, some
|
@@ -848,7 +953,7 @@ If you find that your server is unable to handle the load on your Rails/Rack web
|
|
848
953
|
sites are really that popular, then you should strongly consider upgrading your
|
849
954
|
hardware or getting more servers.)
|
850
955
|
|
851
|
-
This option may only occur once, in the 'http' configuration
|
956
|
+
This option may only occur once, in the 'http' configuration block.
|
852
957
|
The default value is '6'.
|
853
958
|
|
854
959
|
TIP: We strongly recommend you to <<reducing_memory_usage,use Ruby Enterprise
|
@@ -1146,33 +1251,17 @@ This option may occur in the following places:
|
|
1146
1251
|
* In a 'location' configuration block.
|
1147
1252
|
* In an 'if' configuration scope.
|
1148
1253
|
|
1149
|
-
In each place, it may be specified at most once. The default value is '
|
1254
|
+
In each place, it may be specified at most once. The default value is '0'.
|
1150
1255
|
|
1151
1256
|
[NOTE]
|
1152
1257
|
.A word about permissions
|
1153
1258
|
=====================================================
|
1154
|
-
The <<PassengerMemoryLimit,passenger_memory_limit>> directive
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
this directive and your `/proc` permissions are too tight, then please consider
|
1161
|
-
untightening the permissions.
|
1162
|
-
=====================================================
|
1163
|
-
|
1164
|
-
[TIP]
|
1165
|
-
.FreeBSD and `/proc`
|
1166
|
-
=====================================================
|
1167
|
-
On many FreeBSD systems, `/proc` is not mounted by default. `/proc` *must* be
|
1168
|
-
mounted in order for <<PassengerMemoryLimit,passenger_memory_limit>> to work.
|
1169
|
-
|
1170
|
-
It is also advised that you mount `/proc` with the `linprocfs` filesystem type
|
1171
|
-
instead of the regular FreeBSD `proc` filesystem type. The `linprocfs` filesystem
|
1172
|
-
type allows Phusion Passenger to read memory information from `/proc` directly,
|
1173
|
-
which is very fast. If you mount `/proc` with a different filesystem type, then
|
1174
|
-
Phusion Passenger must resort to querying memory information from the `ps` command,
|
1175
|
-
which is a lot slower.
|
1259
|
+
The <<PassengerMemoryLimit,passenger_memory_limit>> directive uses the
|
1260
|
+
`ps` command to query memory usage information. On Linux, it further
|
1261
|
+
queries `/proc` to obtain additional memory usage information that's
|
1262
|
+
not obtainable through `ps`. You should ensure that the `ps` works
|
1263
|
+
correctly and that the `/proc` filesystem is accessible by the
|
1264
|
+
`PassengerHelperAgent` process.
|
1176
1265
|
=====================================================
|
1177
1266
|
|
1178
1267
|
[CAUTION]
|
@@ -1122,7 +1122,8 @@ Can listen on a Unix socket, for use in reverse proxy setups.
|
|
1122
1122
|
words: practically any operating system on earth, except Microsoft Windows.</p></div>
|
1123
1123
|
<div class="paragraph"><p>Phusion Passenger is confirmed on a large number of operating systems and Linux
|
1124
1124
|
distributions, including, but not limited to, Ubuntu, Debian, CentOS/Fedora/RHEL,
|
1125
|
-
Gentoo, Mac OS X, FreeBSD and Solaris.
|
1125
|
+
Gentoo, Mac OS X, FreeBSD and Solaris. OpenBSD is supported since version 5.2.
|
1126
|
+
Both 32-bit and 64-bit platforms are supported.</p></div>
|
1126
1127
|
<div class="paragraph"><p>Please
|
1127
1128
|
<a href="http://code.google.com/p/phusion-passenger/issues/list">report a bug</a>
|
1128
1129
|
or
|
@@ -1154,6 +1155,11 @@ Email <a href="mailto:support@phusion.nl">support@phusion.nl</a> if you are a <a
|
|
1154
1155
|
<a href="https://www.phusionpassenger.com/commercial_support">Commercial support contracts</a> are also available.
|
1155
1156
|
</p>
|
1156
1157
|
</li>
|
1158
|
+
<li>
|
1159
|
+
<p>
|
1160
|
+
Report security vulnerabilities to <a href="mailto:support@phusion.nl">support@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.
|
1161
|
+
</p>
|
1162
|
+
</li>
|
1157
1163
|
</ul></div>
|
1158
1164
|
<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>
|
1159
1165
|
</div>
|
@@ -1192,7 +1198,7 @@ use the <span class="monospaced">-p</span> option, e.g.:</p></div>
|
|
1192
1198
|
<div id="footnotes"><hr></div>
|
1193
1199
|
<div id="footer">
|
1194
1200
|
<div id="footer-text">
|
1195
|
-
Last updated 2013-
|
1201
|
+
Last updated 2013-03-03 11:14:55 CET
|
1196
1202
|
</div>
|
1197
1203
|
</div>
|
1198
1204
|
<script>/*! jQuery v1.7.1 jquery.com | jquery.org/license */
|
@@ -116,13 +116,7 @@ sessions compared to the others, then there might be a problem:
|
|
116
116
|
+---- "spike"
|
117
117
|
--------------------------------
|
118
118
|
|
119
|
-
|
120
|
-
|
121
|
-
. Your application is busy processing a request that takes a very long time.
|
122
|
-
If this is the case, then you might want to turn
|
123
|
-
<<PassengerUseGlobalQueue,global queuing>> on.
|
124
|
-
. Your application is frozen, i.e. has stopped responding. See
|
125
|
-
<<debugging_frozen,Debugging frozen applications>> for tips.
|
119
|
+
The most likely reason why a spike occurs is because your application is frozen, i.e. it has stopped responding. See <<debugging_frozen,Debugging frozen applications>> for tips.
|
126
120
|
|
127
121
|
|
128
122
|
[[debugging_frozen]]
|
@@ -1,9 +1,11 @@
|
|
1
|
+
=== Synopsis
|
2
|
+
|
1
3
|
The Phusion Passenger installation process consists of two steps:
|
2
4
|
|
3
5
|
1. The *obtainment step*, where you download the Phusion Passenger files puts them somewhere on your system. This can be done through downloading the source tarball, installing the Ruby gem or installing a native OS package via APT or YUM.
|
4
6
|
2. The *integration step*, where you configure Phusion Passenger so that it works properly with other system components such as Apache, Nginx, Ruby, Python, etc.
|
5
7
|
|
6
|
-
Because Phusion Passenger is designed to run in a wide variety of operating systems and configurations, both steps can be done in multiple ways. Most users will be satisfied with the
|
8
|
+
Because Phusion Passenger is designed to run in a wide variety of operating systems and configurations, both steps can be done in multiple ways. Most users -- especially first-time users -- will be satisfied with the _generic installation instructions_ which covers both steps. However some users may prefer _OS-specific installation instructions_, which allow Phusion Passenger to better integrate into the operating system. Better integration is characterized by following OS-specific conventions.
|
7
9
|
|
8
10
|
If you are not familiar with system administration and do not understand all the choices, then we recommend you to go with the <<rubygems_generic_install,RubyGems generic installation method>> (if you're a Ruby user) or the <<tarball_generic_install,tarball generic installation method>> (if you're not a Ruby user).
|
9
11
|
|
@@ -13,6 +15,8 @@ The steps for upgrading or downgrading Phusion Passenger is almost the same as t
|
|
13
15
|
[[rubygems_generic_install]]
|
14
16
|
=== Generic installation, upgrade and downgrade method: via RubyGems
|
15
17
|
|
18
|
+
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.
|
19
|
+
|
16
20
|
[[is_ruby_home_or_system_wide_installed]]
|
17
21
|
[float]
|
18
22
|
==== Step 1: figuring out whether your Ruby is installed the home directory or system-wide
|
@@ -78,7 +82,7 @@ gem install passenger-enterprise-server-x.x.x.gem
|
|
78
82
|
[float]
|
79
83
|
==== Step 3: add the RubyGems bin directory to your $PATH
|
80
84
|
|
81
|
-
If you all the following are applicable to you:
|
85
|
+
If you all of the following are applicable to you:
|
82
86
|
|
83
87
|
- You are on Debian or Ubuntu,
|
84
88
|
- and you installed RubyGems through APT,
|
@@ -129,7 +133,7 @@ passenger-install-apache2-module
|
|
129
133
|
|
130
134
|
At the end of the installation process, you will be asked to copy and paste a configuration snippet (containing `LoadModule`, `PassengerRoot`, etc.) into your Apache configuration file. If you're upgrading, then you already had a similar configuration snippet. Be sure to remove the old one before pasting the new one.
|
131
135
|
|
132
|
-
|
136
|
+
Different operating systems and Apache installations have different conventions with regard to where the Apache configuration file is and how it is organized. Please read <<working_with_apache_conf,Working with the Apache configuration file>> if you're not familiar with it. That section is especially of interest for OS X Server >= 10.8 users because the configuration file may not be at a surprising location.
|
133
137
|
|
134
138
|
If compilation doesn't succeed, then please consult the <<troubleshooting,Troubleshooting>> section.
|
135
139
|
|
@@ -172,6 +176,9 @@ passenger-memory-stats
|
|
172
176
|
---------------------------
|
173
177
|
|
174
178
|
You should see the web server processes as well as a number of Phusion Passenger processes (e.g. PassengerWatchdog, PassengerHelperAgent). Congratulations, Phusion Passenger is now installed and running!
|
179
|
+
ifdef::nginx[]
|
180
|
+
At this point you may be interested in <<nginx_init_script,creating an Nginx init script>>.
|
181
|
+
endif::[]
|
175
182
|
|
176
183
|
If the output is not as expected, then please refer to the <<troubleshooting,Troubleshooting>> section.
|
177
184
|
|
@@ -263,7 +270,7 @@ sudo apt-add-repository ppa:brightbox/passenger
|
|
263
270
|
sudo apt-get update
|
264
271
|
-----------------------------
|
265
272
|
|
266
|
-
If you're on the older Ubuntu 8.04 Hardy release, the
|
273
|
+
If you're on the older Ubuntu 8.04 Hardy release, the `apt-add-repository` command isn't available so you have to install the repository and the key by hand:
|
267
274
|
|
268
275
|
-----------------------------
|
269
276
|
sudo sh -c 'echo "deb http://ppa.launchpad.net/brightbox/passenger/ubuntu hardy main" > /etc/apt/sources.list.d/brightbox-passenger.list'
|
@@ -301,37 +308,103 @@ endif::[]
|
|
301
308
|
Please refer to <<verify_passenger_running,this section>>. Note that all Phusion Passenger administration scripts are located inside the 'bin' subdirectory of the Phusion Passenger source directory, so you would have to run something like '/opt/passenger/passenger-x.x.x/bin/passenger-memory-stats'.
|
302
309
|
|
303
310
|
|
304
|
-
=== Installing or upgrading on Ubuntu
|
311
|
+
=== Installing or upgrading on Debian 6 or Ubuntu
|
305
312
|
|
306
|
-
John Leach from Brightbox has kindly provided
|
313
|
+
John Leach from Brightbox has kindly provided Ubuntu packages for Phusion Passenger. The Ubuntu Lucid packages are compatible with Debian 6. The packages are available from the link:http://wiki.brightbox.co.uk/docs:phusion-passenger[Brightbox repository]. Only packages for the open source version of Phusion Passenger are provided. link:https://www.phusionpassenger.com/enterprise[Phusion Passenger Enterprise] customers should use the <<rubygems_generic_install,generic RubyGems installation method>> or <<tarball_generic_install,the generic tarball installation method>> instead.
|
307
314
|
|
308
|
-
|
315
|
+
If you use these packages to install Phusion Passenger then you do not need to run `passenger-install-apache2-module` or `passenger-install-nginx-module`. These packages contain all the binaries that you need.
|
309
316
|
|
310
|
-
|
311
|
-
|
312
|
-
|
317
|
+
.Apache
|
318
|
+
|
319
|
+
On Ubuntu versions newer than 8.04 Hardy, register the Brightbox Apache PPA as follows:
|
320
|
+
|
321
|
+
-----------------------------
|
322
|
+
sudo apt-add-repository ppa:brightbox/passenger
|
323
|
+
sudo apt-get update
|
324
|
+
-----------------------------
|
325
|
+
|
326
|
+
On Ubuntu 8.04 Hardy and on Debian, the `apt-add-repository` command isn't available so you have to install the repository and the key by hand.
|
327
|
+
|
328
|
+
Debian 6:
|
329
|
+
|
330
|
+
-----------------------------
|
331
|
+
sudo sh -c 'echo "deb http://ppa.launchpad.net/brightbox/passenger/ubuntu lucid main" > /etc/apt/sources.list.d/brightbox-passenger.list'
|
332
|
+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3173AA6
|
333
|
+
sudo apt-get update
|
334
|
+
-----------------------------
|
335
|
+
|
336
|
+
Ubuntu 8.04 Hardy:
|
313
337
|
|
314
|
-
|
338
|
+
-----------------------------
|
339
|
+
sudo sh -c 'echo "deb http://ppa.launchpad.net/brightbox/passenger/ubuntu hardy main" > /etc/apt/sources.list.d/brightbox-passenger.list'
|
340
|
+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3173AA6
|
341
|
+
sudo apt-get update
|
342
|
+
-----------------------------
|
315
343
|
|
316
|
-
|
344
|
+
You can proceed with installing Phusion Passenger by running:
|
317
345
|
|
318
346
|
---------------------------------------------
|
319
347
|
sudo apt-get install libapache2-mod-passenger
|
320
348
|
---------------------------------------------
|
321
349
|
|
322
|
-
|
350
|
+
The Apache package provides configuration snippets for you, so you don't need to modify any Apache configuration to get it to load Phusion Passenger.
|
351
|
+
|
352
|
+
.Nginx
|
353
|
+
|
354
|
+
On Ubuntu versions newer than 8.04 Hardy, register the Brightbox Apache PPA as follows:
|
355
|
+
|
356
|
+
-----------------------------
|
357
|
+
sudo apt-add-repository ppa:brightbox/passenger-nginx
|
358
|
+
sudo apt-get update
|
359
|
+
-----------------------------
|
360
|
+
|
361
|
+
On Ubuntu 8.04 Hardy and on Debian, the `apt-add-repository` command isn't available so you have to install the repository and the key by hand.
|
362
|
+
|
363
|
+
Debian 6:
|
364
|
+
|
365
|
+
-----------------------------
|
366
|
+
sudo sh -c 'echo "deb http://ppa.launchpad.net/brightbox/passenger-nginx/ubuntu lucid main" > /etc/apt/sources.list.d/brightbox-passenger-nginx.list'
|
367
|
+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3173AA6
|
368
|
+
sudo apt-get update
|
369
|
+
-----------------------------
|
370
|
+
|
371
|
+
Ubuntu 8.04 Hardy:
|
372
|
+
|
373
|
+
-----------------------------
|
374
|
+
sudo sh -c 'echo "deb http://ppa.launchpad.net/brightbox/passenger/ubuntu hardy main" > /etc/apt/sources.list.d/brightbox-passenger-nginx.list'
|
375
|
+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3173AA6
|
376
|
+
sudo apt-get update
|
377
|
+
-----------------------------
|
378
|
+
|
379
|
+
Then:
|
323
380
|
|
324
381
|
---------------------------------------------
|
325
|
-
sudo apt-get install nginx-
|
382
|
+
sudo apt-get install nginx-full
|
326
383
|
---------------------------------------------
|
327
384
|
|
328
|
-
|
385
|
+
You'll then need to enable the Phusion Passenger module in Nginx by creating the following configuration file:
|
386
|
+
|
387
|
+
-----------------------------------------------
|
388
|
+
sudo sh -c 'echo "passenger_root /usr/lib/phusion-passenger;" > /etc/nginx/conf.d/passenger.conf'
|
389
|
+
-----------------------------------------------
|
390
|
+
|
391
|
+
Then restart Nginx to apply the changes:
|
392
|
+
|
393
|
+
----------------------------------------
|
394
|
+
sudo /etc/init.d/nginx restart
|
395
|
+
----------------------------------------
|
396
|
+
|
397
|
+
.Standalone
|
398
|
+
|
399
|
+
Unfortunately, no packages are provided for Phusion Passenger Standalone.
|
329
400
|
|
330
401
|
|
331
402
|
=== Installing or upgrading on Red Hat, Fedora, CentOS or ScientificLinux
|
332
403
|
|
333
404
|
YUM repositories with RPMs are maintained by link:https://github.com/erikogan/passenger[Erik Ogan] and link:http://stealthymonkeys.com/[Stealthy Monkeys Consulting]. Only packages for the open source version of Phusion Passenger are provided. link:https://www.phusionpassenger.com/enterprise[Phusion Passenger Enterprise] customers should use the <<rubygems_generic_install,generic RubyGems installation method>> or <<tarball_generic_install,the generic tarball installation method>> instead.
|
334
405
|
|
406
|
+
If you use YUM to install Phusion Passenger then you do not need to run `passenger-install-apache2-module` or `passenger-install-nginx-module`. 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.
|
407
|
+
|
335
408
|
[float]
|
336
409
|
==== Step 1: Install the release package
|
337
410
|
|
@@ -365,13 +438,13 @@ From there you can use link:http://prefetch.net/articles/yum.html[YUM] to instal
|
|
365
438
|
Phusion Passenger for Apache:
|
366
439
|
|
367
440
|
---------------------------------------------
|
368
|
-
yum install
|
441
|
+
yum install mod_passenger
|
369
442
|
---------------------------------------------
|
370
443
|
|
371
444
|
Phusion Passenger for Nginx:
|
372
445
|
|
373
446
|
---------------------------------------------
|
374
|
-
yum install
|
447
|
+
yum install nginx-passenger
|
375
448
|
---------------------------------------------
|
376
449
|
|
377
450
|
Phusion Passenger Standalone:
|
@@ -408,13 +481,73 @@ By default, the installer (`passenger-install-nginx-module`) is interactive. If
|
|
408
481
|
endif::[]
|
409
482
|
|
410
483
|
|
484
|
+
=== Customizing the compilation process
|
485
|
+
|
486
|
+
==== Setting the compiler
|
487
|
+
|
488
|
+
You can force the Phusion Passenger build system to use a specific C or C++ compiler by setting the `CC` and `CXX` environment variables. These may be set to any arbitrary shell commands.
|
489
|
+
|
490
|
+
For example, contributors who want to hack on Phusion Passenger may want to use Clang for faster compilation and link:http://ccache.samba.org/[ccache] for faster recompilation, and may want to enable more error-catching compilation flags:
|
491
|
+
|
492
|
+
----------------------
|
493
|
+
export CC='ccache clang -fcolor-diagnostics -Qunused-arguments -fcatch-undefined-behavior -ftrapv'
|
494
|
+
export CXX='ccache clang++ -fcolor-diagnostics -Qunused-arguments -fcatch-undefined-behavior -ftrapv'
|
495
|
+
----------------------
|
496
|
+
|
497
|
+
==== Adding additional compiler or linker flags
|
498
|
+
|
499
|
+
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:
|
500
|
+
|
501
|
+
`EXTRA_PRE_CFLAGS`::
|
502
|
+
These flags are injected into all C compiler invocations that involve compiling C or C++ source files. This includes compiler invocations that compile *and* link. The flags are injected at the beginning of the command string, even before `EXTRA_PRE_LDFLAGS`.
|
503
|
+
`EXTRA_CFLAGS`::
|
504
|
+
Similar to `EXTRA_PRE_CFLAGS`, but injected at the end of the command string, before `EXTRA_LDFLAGS`.
|
505
|
+
`EXTRA_PRE_CXXFLAGS`::
|
506
|
+
Similar to `EXTRA_PRE_CFLAGS`, but for C++ compiler invocations.
|
507
|
+
`EXTRA_CXXFLAGS`::
|
508
|
+
Similar to `EXTRA_CFLAGS`, but for C++ compiler invocations.
|
509
|
+
`EXTRA_PRE_LDFLAGS`::
|
510
|
+
These flags are injected into all C/C++ compiler invocations that involve linking. This includes compiler invocations that compile *and* link. The flags are injected at the beginning of the command string, but after `EXTRA_PRE_CFLAGS` and `EXTRA_PRE_CXXFLAGS`.
|
511
|
+
`EXTRA_LDFLAGS`::
|
512
|
+
Similar to `EXTRA_PRE_LDFLAGS`, but injected at the very end of the command string, even after `EXTRA_CFLAGS` and `EXTRA_CXXFLAGS`.
|
513
|
+
|
514
|
+
==== Forcing location of certain command line tools
|
515
|
+
|
516
|
+
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 `apxs2` command and queries it. To find out which compiler flags it should use for libcurl, it queries the `curl-config` command. These commands may not be in `$PATH`, or even when they are you may want to use a different one.
|
517
|
+
|
518
|
+
You can often force the build to find certain command line tools at certain locations by using the following environment variables:
|
519
|
+
|
520
|
+
`HTTPD`::
|
521
|
+
The location of the `httpd` executable (the Apache server executable).
|
522
|
+
`APXS2`::
|
523
|
+
The location of the `apxs2` executable (the Apache module developer tool).
|
524
|
+
`APR_CONFIG`::
|
525
|
+
The location of the `apr-config` executable (the Apache Portable Runtime developer tool).
|
526
|
+
`APU_CONFIG`::
|
527
|
+
The location of the `apu-config` executable (the Apache Portable Runtime Utility developer tool).
|
528
|
+
`MAKE`::
|
529
|
+
The location of a `make` tool. It does not matter which implementation of `make` this is.
|
530
|
+
`GMAKE`::
|
531
|
+
The location of the GNU-compatible `make` tool.
|
532
|
+
|
533
|
+
|
411
534
|
ifdef::apache[]
|
412
|
-
[[
|
413
|
-
===
|
535
|
+
[[working_with_apache_conf]]
|
536
|
+
=== Working with the Apache configuration file
|
414
537
|
|
415
|
-
On most systems
|
538
|
+
On most systems the Apache configuration file is located in either '/etc/apache2/httpd.conf' or '/etc/apache2/apache2.conf'. However, to allow better organization, many operating systems and Apache distributions also read configuration files in the 'conf.d', 'mods-enabled' and 'sites-enabled' subdirectories.
|
416
539
|
|
417
|
-
|
540
|
+
'mods-enabled' contains symlinks to files in 'mods-available'. This latter subdirectory contains config files for all available modules, while 'mods-enabled' contains only a subset, namely the modules that should actually be enabled. The symlinks are created using the `a2enmod` tool. '*.load' files contain `LoadModule` directives, while '*.conf' files contain all other configuration directives.
|
541
|
+
|
542
|
+
Use 'mods-enabled'/'mods-available' to store Phusion Passenger configuration if you can:
|
543
|
+
|
544
|
+
- Create '/etc/apache2/mods-available/passenger.load' and paste the `LoadModule ...` directive that `passenger-install-apache2-module` outputs.
|
545
|
+
- Create '/etc/apache2/mods-available/passenger.conf' and paste the `PassengerRoot` and other Phusion Passenger options.
|
546
|
+
- Enable by running `sudo a2enmod passenger`.
|
547
|
+
|
548
|
+
If the 'mods-enabled' mechanism is not available then you can paste configuration snippets into 'httpd.conf' or 'apache2.conf' directly.
|
549
|
+
|
550
|
+
On OS X Server >= 10.8 Mountain Lion the location of the Apache configuration file depends on whether you use Web Services or not. If you do, then the configuration file is in '/Library/Server/Web/Config/apache2/httpd_server_app.conf'. If you do not, then the configuration file is in '/etc/apache2/httpd.conf'.
|
418
551
|
endif::[]
|
419
552
|
|
420
553
|
|
@@ -445,6 +578,18 @@ passenger_root /path-to-passenger-root;
|
|
445
578
|
------------------------------------------
|
446
579
|
|
447
580
|
After having done so, restart Nginx.
|
581
|
+
|
582
|
+
[[nginx_init_script]]
|
583
|
+
=== Creating an Nginx init script
|
584
|
+
|
585
|
+
If you installed Nginx with one of the generic installation methods then you won't have an init script to start, stop and restart Nginx with. A bare Nginx installation works with signals: you start it by invoking it from the command line, you stop it by sending SIGTERM to it and you gracefully restart it by sending SIGHUP to it.
|
586
|
+
|
587
|
+
If you prefer to use an init script then please refer to the following resources:
|
588
|
+
|
589
|
+
- link:http://wiki.nginx.org/Nginx-init-ubuntu[Init script for Ubuntu]
|
590
|
+
- link:http://wiki.nginx.org/RedHatNginxInitScript[Init script for Red Hat, Fedora and CentOS]
|
591
|
+
|
592
|
+
When using one of those init scripts, please make sure that the paths inside the init script are correct. In particular, the paths to the Nginx binary, to the PID file and to the configuration file must match the actual locations of your Nginx installation.
|
448
593
|
endif::[]
|
449
594
|
|
450
595
|
|
@@ -587,7 +732,7 @@ mv /opt/passenger/passenger-4.0.0 /usr/local/passenger-4.0.0
|
|
587
732
|
|
588
733
|
Next you must tell your web server that Phusion Passenger has moved.
|
589
734
|
ifdef::apache[]
|
590
|
-
Open your <<
|
735
|
+
Open your <<working_with_apache_conf,Apache configuration file>> and set the 'PassengerRoot' directive to the new location:
|
591
736
|
|
592
737
|
---------------------------------------------
|
593
738
|
PassengerRoot /usr/local/passenger-4.0.0
|