passenger 4.0.2 → 4.0.3
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.tar.gz.asc +7 -7
- data/NEWS +27 -0
- data/bin/passenger-config +6 -3
- data/bin/passenger-install-apache2-module +2 -2
- data/bin/passenger-install-nginx-module +16 -2
- data/build/agents.rb +4 -0
- data/build/apache2.rb +1 -1
- data/build/cplusplus_support.rb +1 -1
- data/build/cxx_tests.rb +3 -0
- data/build/packaging.rb +51 -8
- data/build/ruby_extension.rb +1 -1
- data/doc/Packaging.txt.md +20 -7
- data/doc/Users guide Apache.html +1 -1
- data/doc/Users guide Apache.txt +1 -1
- data/doc/Users guide Nginx.html +5 -4
- data/doc/Users guide Nginx.txt +1 -1
- data/doc/users_guide_snippets/installation.txt +5 -3
- data/ext/apache2/Configuration.cpp +12 -0
- data/ext/apache2/Configuration.hpp +7 -4
- data/ext/apache2/Hooks.cpp +29 -19
- data/ext/common/AgentsStarter.cpp +85 -57
- data/ext/common/AgentsStarter.h +570 -42
- data/ext/common/ApplicationPool2/DirectSpawner.h +5 -2
- data/ext/common/ApplicationPool2/Implementation.cpp +7 -1
- data/ext/common/ApplicationPool2/Pool.h +6 -3
- data/ext/common/ApplicationPool2/Process.h +12 -3
- data/ext/common/ApplicationPool2/SmartSpawner.h +2 -1
- data/ext/common/Constants.h +4 -1
- data/ext/common/EventedBufferedInput.h +139 -16
- data/ext/common/MultiLibeio.cpp +4 -2
- data/ext/common/SafeLibev.h +15 -62
- data/ext/common/ServerInstanceDir.h +10 -26
- data/ext/common/Utils.cpp +1 -3
- data/ext/common/Utils.h +1 -1
- data/ext/common/Utils/StrIntUtils.cpp +9 -0
- data/ext/common/Utils/StrIntUtils.h +5 -0
- data/ext/common/Utils/VariantMap.h +63 -14
- data/ext/common/agents/Base.cpp +50 -15
- data/ext/common/agents/HelperAgent/AgentOptions.h +20 -12
- data/ext/common/agents/HelperAgent/FileBackedPipe.h +1 -1
- data/ext/common/agents/HelperAgent/Main.cpp +5 -4
- data/ext/common/agents/HelperAgent/RequestHandler.h +1 -1
- data/ext/common/agents/LoggingAgent/Main.cpp +0 -1
- data/ext/common/agents/LoggingAgent/RemoteSender.h +2 -2
- data/ext/common/agents/SpawnPreparer.cpp +23 -5
- data/ext/common/agents/Watchdog/AgentWatcher.cpp +508 -0
- data/ext/common/agents/Watchdog/HelperAgentWatcher.cpp +93 -0
- data/ext/common/agents/Watchdog/LoggingAgentWatcher.cpp +68 -0
- data/ext/common/agents/Watchdog/Main.cpp +180 -802
- data/ext/common/agents/Watchdog/ServerInstanceDirToucher.cpp +111 -0
- data/ext/nginx/Configuration.c +107 -92
- data/ext/nginx/Configuration.h +1 -0
- data/ext/nginx/ContentHandler.c +6 -6
- data/ext/nginx/ContentHandler.h +1 -1
- data/ext/nginx/config +8 -2
- data/ext/nginx/ngx_http_passenger_module.c +54 -60
- data/ext/nginx/ngx_http_passenger_module.h +6 -6
- data/lib/phusion_passenger.rb +17 -10
- data/lib/phusion_passenger/admin_tools/server_instance.rb +2 -2
- data/lib/phusion_passenger/common_library.rb +0 -1
- data/lib/phusion_passenger/platform_info.rb +10 -1
- data/lib/phusion_passenger/platform_info/depcheck.rb +4 -4
- data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +2 -2
- data/lib/phusion_passenger/platform_info/ruby.rb +7 -0
- data/lib/phusion_passenger/request_handler.rb +119 -42
- data/lib/phusion_passenger/request_handler/thread_handler.rb +25 -22
- data/lib/phusion_passenger/standalone/command.rb +2 -0
- data/lib/phusion_passenger/standalone/runtime_installer.rb +4 -3
- data/lib/phusion_passenger/standalone/start_command.rb +49 -37
- data/resources/templates/nginx/pcre_checksum_could_not_be_verified.txt.erb +11 -0
- data/test/cxx/CxxTestMain.cpp +2 -0
- data/test/cxx/EventedBufferedInputTest.cpp +758 -0
- data/test/cxx/ServerInstanceDirTest.cpp +16 -31
- data/test/cxx/TestSupport.cpp +2 -1
- data/test/cxx/VariantMapTest.cpp +23 -11
- metadata +8 -4
- metadata.gz.asc +7 -7
- data/ext/common/AgentsStarter.hpp +0 -655
- data/lib/phusion_passenger/utils/robust_interruption.rb +0 -173
@@ -0,0 +1,111 @@
|
|
1
|
+
/*
|
2
|
+
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
+
* Copyright (c) 2010-2013 Phusion
|
4
|
+
*
|
5
|
+
* "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
|
+
*
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
12
|
+
* furnished to do so, subject to the following conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be included in
|
15
|
+
* all copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
* THE SOFTWARE.
|
24
|
+
*/
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Touch all files in the server instance dir every 6 hours in order to prevent /tmp
|
28
|
+
* cleaners from weaking havoc:
|
29
|
+
* http://code.google.com/p/phusion-passenger/issues/detail?id=365
|
30
|
+
*/
|
31
|
+
class ServerInstanceDirToucher {
|
32
|
+
private:
|
33
|
+
oxt::thread *thr;
|
34
|
+
|
35
|
+
static void
|
36
|
+
threadMain() {
|
37
|
+
while (!this_thread::interruption_requested()) {
|
38
|
+
syscalls::sleep(60 * 60 * 6);
|
39
|
+
|
40
|
+
begin_touch:
|
41
|
+
|
42
|
+
this_thread::disable_interruption di;
|
43
|
+
this_thread::disable_syscall_interruption dsi;
|
44
|
+
// Fork a process which touches everything in the server instance dir.
|
45
|
+
pid_t pid = syscalls::fork();
|
46
|
+
if (pid == 0) {
|
47
|
+
// Child
|
48
|
+
int prio, ret, e;
|
49
|
+
|
50
|
+
closeAllFileDescriptors(2);
|
51
|
+
|
52
|
+
// Make process nicer.
|
53
|
+
do {
|
54
|
+
prio = getpriority(PRIO_PROCESS, getpid());
|
55
|
+
} while (prio == -1 && errno == EINTR);
|
56
|
+
if (prio != -1) {
|
57
|
+
prio++;
|
58
|
+
if (prio > 20) {
|
59
|
+
prio = 20;
|
60
|
+
}
|
61
|
+
do {
|
62
|
+
ret = setpriority(PRIO_PROCESS, getpid(), prio);
|
63
|
+
} while (ret == -1 && errno == EINTR);
|
64
|
+
} else {
|
65
|
+
perror("getpriority");
|
66
|
+
}
|
67
|
+
|
68
|
+
do {
|
69
|
+
ret = chdir(serverInstanceDir->getPath().c_str());
|
70
|
+
} while (ret == -1 && errno == EINTR);
|
71
|
+
if (ret == -1) {
|
72
|
+
e = errno;
|
73
|
+
fprintf(stderr, "chdir(\"%s\") failed: %s (%d)\n",
|
74
|
+
serverInstanceDir->getPath().c_str(),
|
75
|
+
strerror(e), e);
|
76
|
+
fflush(stderr);
|
77
|
+
_exit(1);
|
78
|
+
}
|
79
|
+
|
80
|
+
setOomScore(oldOomScore);
|
81
|
+
|
82
|
+
execlp("/bin/sh", "/bin/sh", "-c", "find . | xargs touch", (char *) 0);
|
83
|
+
e = errno;
|
84
|
+
fprintf(stderr, "Cannot execute 'find . | xargs touch': %s (%d)\n",
|
85
|
+
strerror(e), e);
|
86
|
+
fflush(stderr);
|
87
|
+
_exit(1);
|
88
|
+
} else if (pid == -1) {
|
89
|
+
// Error
|
90
|
+
P_WARN("Could not touch the server instance directory because "
|
91
|
+
"fork() failed. Retrying in 2 minutes...");
|
92
|
+
this_thread::restore_interruption si(di);
|
93
|
+
this_thread::restore_syscall_interruption rsi(dsi);
|
94
|
+
syscalls::sleep(60 * 2);
|
95
|
+
goto begin_touch;
|
96
|
+
} else {
|
97
|
+
syscalls::waitpid(pid, NULL, 0);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
public:
|
103
|
+
ServerInstanceDirToucher() {
|
104
|
+
thr = new oxt::thread(threadMain, "Server instance dir toucher", 256 * 1024);
|
105
|
+
}
|
106
|
+
|
107
|
+
~ServerInstanceDirToucher() {
|
108
|
+
thr->interrupt_and_join();
|
109
|
+
delete thr;
|
110
|
+
}
|
111
|
+
};
|
data/ext/nginx/Configuration.c
CHANGED
@@ -35,8 +35,8 @@
|
|
35
35
|
#include "ngx_http_passenger_module.h"
|
36
36
|
#include "Configuration.h"
|
37
37
|
#include "ContentHandler.h"
|
38
|
-
#include "
|
39
|
-
#include "
|
38
|
+
#include "common/Constants.h"
|
39
|
+
#include "common/agents/LoggingAgent/FilterSupport.h"
|
40
40
|
|
41
41
|
|
42
42
|
static ngx_str_t headers_to_hide[] = {
|
@@ -67,6 +67,10 @@ passenger_create_main_conf(ngx_conf_t *cf)
|
|
67
67
|
return NGX_CONF_ERROR;
|
68
68
|
}
|
69
69
|
|
70
|
+
conf->ctl = ngx_array_create(cf->pool, 1, sizeof(ngx_keyval_t));
|
71
|
+
if (conf->ctl == NULL) {
|
72
|
+
return NGX_CONF_ERROR;
|
73
|
+
}
|
70
74
|
conf->default_ruby.data = NULL;
|
71
75
|
conf->default_ruby.len = 0;
|
72
76
|
conf->log_level = (ngx_int_t) NGX_CONF_UNSET;
|
@@ -1044,12 +1048,7 @@ set_null_terminated_keyval_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|
1044
1048
|
|
1045
1049
|
const ngx_command_t passenger_commands[] = {
|
1046
1050
|
|
1047
|
-
|
1048
|
-
NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1049
|
-
passenger_enabled,
|
1050
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1051
|
-
0,
|
1052
|
-
NULL },
|
1051
|
+
/******** Main config ********/
|
1053
1052
|
|
1054
1053
|
{ ngx_string("passenger_root"),
|
1055
1054
|
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE1,
|
@@ -1058,25 +1057,18 @@ const ngx_command_t passenger_commands[] = {
|
|
1058
1057
|
offsetof(passenger_main_conf_t, root_dir),
|
1059
1058
|
NULL },
|
1060
1059
|
|
1061
|
-
{ ngx_string("
|
1062
|
-
NGX_HTTP_MAIN_CONF |
|
1063
|
-
|
1060
|
+
{ ngx_string("passenger_ctl"),
|
1061
|
+
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE2,
|
1062
|
+
set_null_terminated_keyval_slot,
|
1064
1063
|
NGX_HTTP_MAIN_CONF_OFFSET,
|
1065
|
-
offsetof(passenger_main_conf_t,
|
1064
|
+
offsetof(passenger_main_conf_t, ctl),
|
1066
1065
|
NULL },
|
1067
1066
|
|
1068
1067
|
{ ngx_string("passenger_ruby"),
|
1069
|
-
|
1070
|
-
ngx_conf_set_str_slot,
|
1071
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1072
|
-
offsetof(passenger_loc_conf_t, ruby),
|
1073
|
-
NULL },
|
1074
|
-
|
1075
|
-
{ ngx_string("passenger_python"),
|
1076
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1068
|
+
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE1,
|
1077
1069
|
ngx_conf_set_str_slot,
|
1078
|
-
|
1079
|
-
offsetof(
|
1070
|
+
NGX_HTTP_MAIN_CONF_OFFSET,
|
1071
|
+
offsetof(passenger_main_conf_t, default_ruby),
|
1080
1072
|
NULL },
|
1081
1073
|
|
1082
1074
|
{ ngx_string("passenger_log_level"),
|
@@ -1107,13 +1099,6 @@ const ngx_command_t passenger_commands[] = {
|
|
1107
1099
|
offsetof(passenger_main_conf_t, abort_on_startup_error),
|
1108
1100
|
NULL },
|
1109
1101
|
|
1110
|
-
{ ngx_string("passenger_friendly_error_pages"),
|
1111
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1112
|
-
ngx_conf_set_flag_slot,
|
1113
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1114
|
-
offsetof(passenger_loc_conf_t, friendly_error_pages),
|
1115
|
-
NULL },
|
1116
|
-
|
1117
1102
|
{ ngx_string("passenger_max_pool_size"),
|
1118
1103
|
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE1,
|
1119
1104
|
ngx_conf_set_num_slot,
|
@@ -1121,20 +1106,6 @@ const ngx_command_t passenger_commands[] = {
|
|
1121
1106
|
offsetof(passenger_main_conf_t, max_pool_size),
|
1122
1107
|
NULL },
|
1123
1108
|
|
1124
|
-
{ ngx_string("passenger_min_instances"),
|
1125
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1126
|
-
ngx_conf_set_num_slot,
|
1127
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1128
|
-
offsetof(passenger_loc_conf_t, min_instances),
|
1129
|
-
NULL },
|
1130
|
-
|
1131
|
-
{ ngx_string("passenger_max_requests"),
|
1132
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1133
|
-
ngx_conf_set_num_slot,
|
1134
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1135
|
-
offsetof(passenger_loc_conf_t, max_requests),
|
1136
|
-
NULL },
|
1137
|
-
|
1138
1109
|
{ ngx_string("passenger_max_instances_per_app"),
|
1139
1110
|
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE1,
|
1140
1111
|
ngx_conf_set_num_slot,
|
@@ -1149,13 +1120,6 @@ const ngx_command_t passenger_commands[] = {
|
|
1149
1120
|
offsetof(passenger_main_conf_t, pool_idle_time),
|
1150
1121
|
NULL },
|
1151
1122
|
|
1152
|
-
{ ngx_string("passenger_base_uri"),
|
1153
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1154
|
-
ngx_conf_set_str_array_slot,
|
1155
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1156
|
-
offsetof(passenger_loc_conf_t, base_uris),
|
1157
|
-
NULL },
|
1158
|
-
|
1159
1123
|
{ ngx_string("passenger_user_switching"),
|
1160
1124
|
NGX_HTTP_MAIN_CONF | NGX_CONF_FLAG,
|
1161
1125
|
ngx_conf_set_flag_slot,
|
@@ -1163,20 +1127,6 @@ const ngx_command_t passenger_commands[] = {
|
|
1163
1127
|
offsetof(passenger_main_conf_t, user_switching),
|
1164
1128
|
NULL },
|
1165
1129
|
|
1166
|
-
{ ngx_string("passenger_user"),
|
1167
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1168
|
-
ngx_conf_set_str_slot,
|
1169
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1170
|
-
offsetof(passenger_loc_conf_t, user),
|
1171
|
-
NULL },
|
1172
|
-
|
1173
|
-
{ ngx_string("passenger_group"),
|
1174
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1175
|
-
ngx_conf_set_str_slot,
|
1176
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1177
|
-
offsetof(passenger_loc_conf_t, group),
|
1178
|
-
NULL },
|
1179
|
-
|
1180
1130
|
{ ngx_string("passenger_default_user"),
|
1181
1131
|
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE1,
|
1182
1132
|
ngx_conf_set_str_slot,
|
@@ -1191,33 +1141,6 @@ const ngx_command_t passenger_commands[] = {
|
|
1191
1141
|
offsetof(passenger_main_conf_t, default_group),
|
1192
1142
|
NULL },
|
1193
1143
|
|
1194
|
-
{ ngx_string("passenger_app_group_name"),
|
1195
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1196
|
-
ngx_conf_set_str_slot,
|
1197
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1198
|
-
offsetof(passenger_loc_conf_t, app_group_name),
|
1199
|
-
NULL },
|
1200
|
-
{ ngx_string("passenger_app_root"),
|
1201
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1202
|
-
ngx_conf_set_str_slot,
|
1203
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1204
|
-
offsetof(passenger_loc_conf_t, app_root),
|
1205
|
-
NULL },
|
1206
|
-
|
1207
|
-
{ ngx_string("passenger_app_rights"),
|
1208
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1209
|
-
ngx_conf_set_str_slot,
|
1210
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1211
|
-
offsetof(passenger_loc_conf_t, app_rights),
|
1212
|
-
NULL },
|
1213
|
-
|
1214
|
-
{ ngx_string("union_station_support"),
|
1215
|
-
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1216
|
-
ngx_conf_set_flag_slot,
|
1217
|
-
NGX_HTTP_LOC_CONF_OFFSET,
|
1218
|
-
offsetof(passenger_loc_conf_t, union_station_support),
|
1219
|
-
NULL },
|
1220
|
-
|
1221
1144
|
{ ngx_string("passenger_analytics_log_user"),
|
1222
1145
|
NGX_HTTP_MAIN_CONF | NGX_CONF_TAKE1,
|
1223
1146
|
ngx_conf_set_str_slot,
|
@@ -1260,6 +1183,98 @@ const ngx_command_t passenger_commands[] = {
|
|
1260
1183
|
offsetof(passenger_main_conf_t, union_station_proxy_address),
|
1261
1184
|
NULL },
|
1262
1185
|
|
1186
|
+
/******** Per-location config ********/
|
1187
|
+
|
1188
|
+
{ ngx_string("passenger_enabled"),
|
1189
|
+
NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1190
|
+
passenger_enabled,
|
1191
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1192
|
+
0,
|
1193
|
+
NULL },
|
1194
|
+
|
1195
|
+
{ ngx_string("passenger_ruby"),
|
1196
|
+
NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1197
|
+
ngx_conf_set_str_slot,
|
1198
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1199
|
+
offsetof(passenger_loc_conf_t, ruby),
|
1200
|
+
NULL },
|
1201
|
+
|
1202
|
+
{ ngx_string("passenger_python"),
|
1203
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1204
|
+
ngx_conf_set_str_slot,
|
1205
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1206
|
+
offsetof(passenger_loc_conf_t, python),
|
1207
|
+
NULL },
|
1208
|
+
|
1209
|
+
{ ngx_string("passenger_friendly_error_pages"),
|
1210
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1211
|
+
ngx_conf_set_flag_slot,
|
1212
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1213
|
+
offsetof(passenger_loc_conf_t, friendly_error_pages),
|
1214
|
+
NULL },
|
1215
|
+
|
1216
|
+
{ ngx_string("passenger_min_instances"),
|
1217
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1218
|
+
ngx_conf_set_num_slot,
|
1219
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1220
|
+
offsetof(passenger_loc_conf_t, min_instances),
|
1221
|
+
NULL },
|
1222
|
+
|
1223
|
+
{ ngx_string("passenger_max_requests"),
|
1224
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1225
|
+
ngx_conf_set_num_slot,
|
1226
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1227
|
+
offsetof(passenger_loc_conf_t, max_requests),
|
1228
|
+
NULL },
|
1229
|
+
|
1230
|
+
{ ngx_string("passenger_base_uri"),
|
1231
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1232
|
+
ngx_conf_set_str_array_slot,
|
1233
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1234
|
+
offsetof(passenger_loc_conf_t, base_uris),
|
1235
|
+
NULL },
|
1236
|
+
|
1237
|
+
{ ngx_string("passenger_user"),
|
1238
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1239
|
+
ngx_conf_set_str_slot,
|
1240
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1241
|
+
offsetof(passenger_loc_conf_t, user),
|
1242
|
+
NULL },
|
1243
|
+
|
1244
|
+
{ ngx_string("passenger_group"),
|
1245
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1246
|
+
ngx_conf_set_str_slot,
|
1247
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1248
|
+
offsetof(passenger_loc_conf_t, group),
|
1249
|
+
NULL },
|
1250
|
+
|
1251
|
+
{ ngx_string("passenger_app_group_name"),
|
1252
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1253
|
+
ngx_conf_set_str_slot,
|
1254
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1255
|
+
offsetof(passenger_loc_conf_t, app_group_name),
|
1256
|
+
NULL },
|
1257
|
+
{ ngx_string("passenger_app_root"),
|
1258
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1259
|
+
ngx_conf_set_str_slot,
|
1260
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1261
|
+
offsetof(passenger_loc_conf_t, app_root),
|
1262
|
+
NULL },
|
1263
|
+
|
1264
|
+
{ ngx_string("passenger_app_rights"),
|
1265
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1266
|
+
ngx_conf_set_str_slot,
|
1267
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1268
|
+
offsetof(passenger_loc_conf_t, app_rights),
|
1269
|
+
NULL },
|
1270
|
+
|
1271
|
+
{ ngx_string("union_station_support"),
|
1272
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
|
1273
|
+
ngx_conf_set_flag_slot,
|
1274
|
+
NGX_HTTP_LOC_CONF_OFFSET,
|
1275
|
+
offsetof(passenger_loc_conf_t, union_station_support),
|
1276
|
+
NULL },
|
1277
|
+
|
1263
1278
|
{ ngx_string("union_station_filter"),
|
1264
1279
|
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
|
1265
1280
|
union_station_filter,
|
@@ -1296,7 +1311,7 @@ const ngx_command_t passenger_commands[] = {
|
|
1296
1311
|
NULL },
|
1297
1312
|
|
1298
1313
|
{ ngx_string("passenger_ignore_headers"),
|
1299
|
-
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
|
1314
|
+
NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_CONF_1MORE,
|
1300
1315
|
ngx_conf_set_bitmask_slot,
|
1301
1316
|
NGX_HTTP_LOC_CONF_OFFSET,
|
1302
1317
|
offsetof(passenger_loc_conf_t, upstream_config.ignore_headers),
|
data/ext/nginx/Configuration.h
CHANGED
data/ext/nginx/ContentHandler.c
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
#include "ContentHandler.h"
|
32
32
|
#include "StaticContentHandler.h"
|
33
33
|
#include "Configuration.h"
|
34
|
-
#include "
|
34
|
+
#include "common/Constants.h"
|
35
35
|
|
36
36
|
|
37
37
|
#define NGX_HTTP_SCGI_PARSE_NO_HEADER 20
|
@@ -213,8 +213,8 @@ set_upstream_server_address(ngx_http_upstream_t *upstream, ngx_http_upstream_con
|
|
213
213
|
if (address->name.data == passenger_placeholder_upstream_address.data) {
|
214
214
|
sockaddr = (struct sockaddr_un *) address->sockaddr;
|
215
215
|
request_socket_filename =
|
216
|
-
|
217
|
-
|
216
|
+
psg_agents_starter_get_request_socket_filename(passenger_agents_starter,
|
217
|
+
&request_socket_filename_len);
|
218
218
|
|
219
219
|
address->name.data = (u_char *) request_socket_filename;
|
220
220
|
address->name.len = request_socket_filename_len;
|
@@ -247,8 +247,8 @@ fix_peer_address(ngx_http_request_t *r) {
|
|
247
247
|
rrp = r->upstream->peer.data;
|
248
248
|
peers = rrp->peers;
|
249
249
|
request_socket_filename =
|
250
|
-
|
251
|
-
|
250
|
+
psg_agents_starter_get_request_socket_filename(passenger_agents_starter,
|
251
|
+
&request_socket_filename_len);
|
252
252
|
|
253
253
|
while (peers != NULL) {
|
254
254
|
if (peers->name) {
|
@@ -590,7 +590,7 @@ create_request(ngx_http_request_t *r)
|
|
590
590
|
**************************************************/
|
591
591
|
|
592
592
|
helper_agent_request_socket_password_data =
|
593
|
-
|
593
|
+
psg_agents_starter_get_request_socket_password(passenger_agents_starter,
|
594
594
|
&helper_agent_request_socket_password_len);
|
595
595
|
size = helper_agent_request_socket_password_len +
|
596
596
|
/* netstring length + ":" + trailing "," */
|
data/ext/nginx/ContentHandler.h
CHANGED
data/ext/nginx/config
CHANGED
@@ -33,8 +33,14 @@ NGX_ADDON_DEPS="$NGX_ADDON_DEPS \
|
|
33
33
|
${ngx_addon_dir}/ContentHandler.h \
|
34
34
|
${ngx_addon_dir}/StaticContentHandler.h \
|
35
35
|
${ngx_addon_dir}/ngx_http_passenger_module.h \
|
36
|
-
`passenger-config --
|
37
|
-
`passenger-config --
|
36
|
+
`passenger-config --includedir`/common/Constants.h \
|
37
|
+
`passenger-config --includedir`/common/AgentsStarter.h \
|
38
|
+
`passenger-config --includedir`/common/ApplicationPool2/AppTypes.h"
|
39
|
+
if test "x$PASSENGER_INCLUDEDIR" = "x"; then
|
40
|
+
CORE_INCS="$CORE_INCS `passenger-config --includedir`"
|
41
|
+
else
|
42
|
+
CORE_INCS="$CORE_INCS $PASSENGER_INCLUDEDIR"
|
43
|
+
fi
|
38
44
|
if test "x$PASSENGER_LIBS" = "x"; then
|
39
45
|
CORE_LIBS="$CORE_LIBS `passenger-config --nginx-libs`"
|
40
46
|
else
|