config.php
6.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<?php
/**
* Configuration information
*
* @author Sam
*/
require_once "WEB-INF/php/inc.php";
$mbean_server = new MBeanServer();
if ($mbean_server) {
$resin = $mbean_server->lookup("resin:type=Resin");
$server = $mbean_server->lookup("resin:type=Server");
}
$title = "Resin: Config";
if (! empty($server->Id))
$title = $title . " for server " . $server->Id;
?>
<?php
display_header("config.php", $title, $server, true);
if (! $server) {
echo "<h2 class='fail'>Can't contact '$server_id'</h2>";
return;
}
?>
<h2>Server: <?= $server->Id ?></h2>
<div class='section'>
<table class="data">
<tr title="The server id used when starting this instance of Resin, the value of `-server'.">
<th>Server id:</th>
<td><?= $server->Id ? $server->Id : '\"\"' ?></td>
</tr>
<tr title="The configuration file used when starting this instance of Resin, the value of `-conf'.">
<th>Version:</th>
<td><?= $resin->Version ?></td>
</tr>
<tr title="The configuration file used when starting this instance of Resin, the value of `-conf'.">
<th>Config file:</th>
<td><?= $resin->ConfigFile ?></td>
</tr>
<tr title="The Resin home directory used when starting this instance of Resin. This is the location of the Resin program files.">
<th>Resin home:</th>
<td><?= $resin->ResinHome ?></td>
</tr>
<tr title="The resin root directory used when starting this instance of Resin. This is the root directory of the web server files.">
<th>Resin root:</th>
<td><?= $resin->RootDirectory ?></td>
</tr>
</table>
<?php
$thread_pool = $server->ThreadPool;
?>
<p/>
<table class="data">
<tr>
<td class='item'>thread-idle-min</td>
<td><?= $thread_pool->ThreadIdleMin ?></td>
</tr>
<tr>
<td class='item'>thread-idle-max</td>
<td><?= $thread_pool->ThreadIdleMax ?></td>
</tr>
<tr>
<td class='item'>thread-max</td>
<td><?= $thread_pool->ThreadMax ?></td>
</tr>
</table>
</div>
<!-- TCP ports -->
<?php
$ports = $server->Ports;
if ($ports) {
?>
<h2>TCP ports</h2>
<div class='section'>
<table class="data">
<?php
$count = 0;
foreach ($ports as $port) {
?>
<tr>
<td class='group' colspan='4'><?= $port->ProtocolName ?>://<?= $port->Address ? $port->Address : "*" ?>:<?= $port->Port ?></td>
</tr>
<tr>
<td class='item'>accept-thread-min</td>
<td><?= $port->AcceptThreadMin ?></td>
<td class='item'>keepalive-max</td>
<td><?= $port->KeepaliveMax ?></td>
</tr>
<tr>
<td class='item'>accept-thread-max</td>
<td><?= $port->AcceptThreadMax ?></td>
<td class='item'>keepalive-select-max</td>
<td><?= $port->KeepaliveSelectMax ?></td>
</tr>
<tr>
<td class='item'>accept-listen-backlog</td>
<td><?= $port->AcceptListenBacklog ?></td>
<td class='item'>keepalive-timeout</td>
<td><?= $port->KeepaliveTimeout ?></td>
</tr>
<tr>
<td class='item'>connection-max</td>
<td><?= $port->ConnectionMax ?></td>
<td class='item'>socket-timeout</td>
<td><?= $port->SocketTimeout ?></td>
</tr>
<tr>
<td class='item'>keepalive-connection-time-max</td>
<td><?= $port->KeepaliveConnectionTimeMax ?></td>
<td class='item'>suspend-time-max</td>
<td><?= $port->SuspendTimeMax ?></td>
</tr>
<?php
}
}
?>
</table>
</div>
<?php
echo "<h2>ServerConnectors</h2>"
echo "<div class='section'>";
echo "<table class='data'>\n";
$servers = $mbean_server->query("resin:*,type=ServerConnector");
foreach ($servers as $srun) {
?>
<tr>
<td class='group'><?= $srun->ClusterIndex + 1 ?>. <?= $srun->Name ?></td>
<td class='group'>hmux://<?= $srun->Address ? $srun->Address : "*" ?>:<?= $srun->Port ?></td>
</tr>
<tr>
<td class='item'>load-balance-connect-timeout</td>
<td><?= $srun->ConnectTimeout ?></td>
</tr>
<tr>
<td class='item'>load-balance-fail-recover-time</td>
<td><?= $srun->RecoverTime ?></td>
</tr>
<tr>
<td class='item'>load-balance-idle-time</td>
<td><?= $srun->IdleTime ?></td>
</tr>
<tr>
<td class='item'>load-balance-socket-timeout</td>
<td><?= $srun->SocketTimeout ?></td>
</tr>
<tr>
<td class='item'>load-balance-warmup-time</td>
<td><?= $srun->WarmupTime ?></td>
</tr>
<tr>
<td class='item'>load-balance-weight</td>
<td><?= $srun->Weight ?></td>
</tr>
<?php
}
?>
</table>
</div>
<!-- cluster ports -->
<?php
$cluster = $server->Cluster;
$cluster_name = empty($cluster->Name) ? "default" : $cluster->Name;
echo "<h2>Cluster: $cluster_name</h2>";
echo "<div class='section'>";
$servers = $cluster->Servers;
?>
<!-- host data -->
<?php
function sort_host($a, $b)
{
return strcmp($a->URL, $b->URL);
}
$hosts = $mbean_server->query("resin:*,type=Host");
usort($hosts, "sort_host");
foreach ($hosts as $host) {
$hostName = empty($host->HostName) ? "default" : $host->HostName;
?>
<h2>Host <?= $host->URL ?></h2>
<div class='section'>
<table class='data'>
<tr>
<td class='item'>root-directory</td>
<td><?= $host->RootDirectory ?></td>
</tr>
</table>
<?php
function sort_webapp($a, $b)
{
return strcmp($a->ContextPath, $b->ContextPath);
}
echo "<h3>WebApps</h3>\n";
$webapps = $host->WebApps;
usort($webapps, "sort_webapp");
$count = 0;
foreach ($webapps as $webapp) {
$session = $webapp->SessionManager;
$persistent_store = $session->PersistentStore;
?>
<p />
<table class='data' width='100%'>
<tr><td class='group' colspan='2'>
<?= empty($webapp->ContextPath) ? "/" : $webapp->ContextPath ?>
</td>
<tr>
<td class='item' width='25%'>root-directory</td>
<td>
<?= $webapp->RootDirectory ?>
</td>
</tr>
<tr>
<td class='item'>session-timeout</td>
<td>
<?= $session->SessionTimeout / 1000 ?>s
</td>
</tr>
<tr>
<td class='item'>session-max</td>
<td>
<?= $session->SessionMax ?>
</td>
</tr>
<?php if ($persistent_store) { ?>
<tr>
<td class='item'>persistent-store</td>
<td>
<?= $persistent_store->StoreType ?>
</td>
</tr>
<tr>
<td class='item'>save-mode</td>
<td>
<?= $session->SaveMode ?>
</td>
</tr>
<?php } // persistent
echo "</table>";
} // webapps
echo "</div>";
} // hosts
echo "</div>";
?>
</table>
<?php display_footer("config.php"); ?>