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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
|
diff -wbBur passenger-3.0.12/bin/passenger-install-nginx-module passenger.git/bin/passenger-install-nginx-module
--- passenger-3.0.12/bin/passenger-install-nginx-module 2012-04-13 12:09:57.000000000 +0400
+++ passenger.git/bin/passenger-install-nginx-module 2012-05-17 19:35:01.000000000 +0400
@@ -162,7 +162,7 @@
new_screen
color_puts "<banner>PCRE (required by Nginx) not installed, downloading it...</banner>"
- url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-#{PREFERRED_PCRE_VERSION}.tar.gz"
+ url = "http://downloads.sourceforge.net/project/pcre/pcre/#{PREFERRED_PCRE_VERSION}/pcre-#{PREFERRED_PCRE_VERSION}.tar.gz"
dirname = "pcre-#{PREFERRED_PCRE_VERSION}"
tarball = "#{@working_dir}/pcre.tar.gz"
diff -wbBur passenger-3.0.12/build/basics.rb passenger.git/build/basics.rb
--- passenger-3.0.12/build/basics.rb 2012-04-13 12:09:57.000000000 +0400
+++ passenger.git/build/basics.rb 2012-05-17 19:35:01.000000000 +0400
@@ -33,7 +33,6 @@
require 'phusion_passenger/platform_info/curl'
require 'phusion_passenger/platform_info/zlib'
require 'phusion_passenger/platform_info/compiler'
-require 'phusion_passenger/platform_info/documentation_tools'
include PhusionPassenger
include PhusionPassenger::PlatformInfo
diff -wbBur passenger-3.0.12/build/documentation.rb passenger.git/build/documentation.rb
--- passenger-3.0.12/build/documentation.rb 2012-02-04 02:25:41.000000000 +0400
+++ passenger.git/build/documentation.rb 2012-05-17 19:35:01.000000000 +0400
@@ -1,5 +1,5 @@
# Phusion Passenger - http://www.modrails.com/
-# Copyright (c) 2010 Phusion
+# Copyright (c) 2010, 2011, 2012 Phusion
#
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
#
@@ -21,25 +21,34 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-ASCIIDOC_FLAGS = "-b html5 -a toc -a theme=flask -a numbered -a toclevels=3 -a icons"
-
desc "Generate all documentation"
task :doc => Packaging::ASCII_DOCS
Packaging::ASCII_DOCS.each do |target|
source = target.sub(/\.html$/, '.txt')
file target => [source] + Dir["doc/users_guide_snippets/**/*"] do
- if PlatformInfo.asciidoc
+ if PlatformInfo.find_command('mizuho')
if target =~ /apache/i
- type = "-a apache"
+ type = "apache"
+ juvia_site_key = "5jpmkyjqlml8rktsfldfpbwth8ig7w9"
elsif target =~ /nginx/i
- type = "-a nginx"
+ type = "nginx"
+ juvia_site_key = "q0ptarhn8o9xanwomq8zkgewbtwffyz"
+ elsif target =~ /standalone/i
+ type = nil
+ juvia_site_key = "amggdy0k65hb4hbjg3dh7pnb9zd8dwy"
else
type = nil
+ juvia_site_key = nil
+ end
+ command = "mizuho '#{source}'"
+ command << " -a #{type}" if type
+ if juvia_site_key
+ command << " -c juvia --juvia-url http://juvia.phusion.nl --juvia-site-key #{juvia_site_key}"
end
- sh "#{PlatformInfo.asciidoc} #{ASCIIDOC_FLAGS} #{type} '#{source}'"
+ sh(command)
else
- sh "echo 'asciidoc required to build docs' > '#{target}'"
+ sh "echo 'Mizuho required to build docs' > '#{target}'"
end
end
diff -wbBur passenger-3.0.12/build/packaging.rb passenger.git/build/packaging.rb
--- passenger-3.0.12/build/packaging.rb 2012-02-04 02:25:41.000000000 +0400
+++ passenger.git/build/packaging.rb 2012-05-17 19:35:01.000000000 +0400
@@ -1,5 +1,5 @@
# Phusion Passenger - http://www.modrails.com/
-# Copyright (c) 2010 Phusion
+# Copyright (c) 2010, 2011, 2012 Phusion
#
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
#
@@ -42,7 +42,7 @@
s.require_paths = ["lib"]
s.add_dependency 'rake', '>= 0.8.1'
s.add_dependency 'fastthread', '>= 1.0.1'
- s.add_dependency 'daemon_controller', '>= 0.2.5'
+ s.add_dependency 'daemon_controller', '>= 1.0.0'
s.add_dependency 'rack'
s.files = FileList[*Packaging::GLOB] - FileList[*Packaging::EXCLUDE_GLOB]
s.executables = Packaging::USER_EXECUTABLES + Packaging::SUPER_USER_EXECUTABLES
diff -wbBur passenger-3.0.12/DEVELOPERS.TXT passenger.git/DEVELOPERS.TXT
--- passenger-3.0.12/DEVELOPERS.TXT 2012-04-13 12:09:57.000000000 +0400
+++ passenger.git/DEVELOPERS.TXT 2012-05-17 19:35:01.000000000 +0400
@@ -13,6 +13,7 @@
* rspec >= 1.1.2
* mime-types >= 1.15
* sqlite3-ruby
+* daemon_controller >= 1.0.0
The following software is optional:
diff -wbBur passenger-3.0.12/doc/Users guide Apache.txt passenger.git/doc/Users guide Apache.txt
--- passenger-3.0.12/doc/Users guide Apache.txt 2012-02-04 02:25:41.000000000 +0400
+++ passenger.git/doc/Users guide Apache.txt 2012-05-17 19:35:01.000000000 +0400
@@ -203,15 +203,7 @@
==== Installing via a native Linux package ====
-John Leach from Brightbox has kindly provided an Ubuntu Hardy package for Phusion Passenger. The package is available from the link:http://apt.brightbox.net[Brightbox repository].
-
-Please install the native Linux package, e.g.:
-------------------------------------------------------
-sudo sh -c 'echo "deb http://apt.brightbox.net hardy main" > /etc/apt/sources.list.d/brightbox.list'
-sudo sh -c 'wget -q -O - http://apt.brightbox.net/release.asc | apt-key add -'
-sudo apt-get update
-sudo apt-get install libapache2-mod-passenger
-------------------------------------------------------
+John Leach from Brightbox has kindly provided a Ubuntu packages for Phusion Passenger. The package is available from the link:http://wiki.brightbox.co.uk/docs:phusion-passenger[Brightbox repository].
==== What does the installer do? ====
@@ -635,7 +627,7 @@
Allow from all
</Directory>
- RackBaseURI /rails # <-- These lines have
+ RackBaseURI /rack # <-- These lines have
<Directory /websites/phusion/rails> # <-- been added.
Options -MultiViews # <--
</Directory> # <--
diff -wbBur passenger-3.0.12/ext/boost/config/stdlib/libstdcpp3.hpp passenger.git/ext/boost/config/stdlib/libstdcpp3.hpp
--- passenger-3.0.12/ext/boost/config/stdlib/libstdcpp3.hpp 2012-02-04 02:25:42.000000000 +0400
+++ passenger.git/ext/boost/config/stdlib/libstdcpp3.hpp 2012-05-17 19:35:01.000000000 +0400
@@ -31,7 +31,8 @@
#ifdef __GLIBCXX__ // gcc 3.4 and greater:
# if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
- || defined(_GLIBCXX__PTHREADS)
+ || defined(_GLIBCXX__PTHREADS) \
+ || defined(_GLIBCXX_HAS_GTHREADS)
//
// If the std lib has thread support turned on, then turn it on in Boost
// as well. We do this because some gcc-3.4 std lib headers define _REENTANT
diff -wbBur passenger-3.0.12/ext/boost/exception/detail/error_info_impl.hpp passenger.git/ext/boost/exception/detail/error_info_impl.hpp
--- passenger-3.0.12/ext/boost/exception/detail/error_info_impl.hpp 2012-02-04 02:25:42.000000000 +0400
+++ passenger.git/ext/boost/exception/detail/error_info_impl.hpp 2012-05-17 19:35:01.000000000 +0400
@@ -30,7 +30,7 @@
protected:
- ~error_info_base() throw()
+ virtual ~error_info_base() throw()
{
}
};
diff -wbBur passenger-3.0.12/ext/common/StaticString.h passenger.git/ext/common/StaticString.h
--- passenger-3.0.12/ext/common/StaticString.h 2012-04-13 12:09:57.000000000 +0400
+++ passenger.git/ext/common/StaticString.h 2012-05-17 19:35:01.000000000 +0400
@@ -25,6 +25,7 @@
#ifndef _PASSENGER_STATIC_STRING_H_
#define _PASSENGER_STATIC_STRING_H_
+#include <sys/types.h>
#include <string>
#include <cstring>
#include <cstddef>
diff -wbBur passenger-3.0.12/ext/common/Watchdog.cpp passenger.git/ext/common/Watchdog.cpp
--- passenger-3.0.12/ext/common/Watchdog.cpp 2012-04-13 12:09:57.000000000 +0400
+++ passenger.git/ext/common/Watchdog.cpp 2012-05-17 19:35:01.000000000 +0400
@@ -975,7 +975,7 @@
} else if (pid == -1) {
// Error
e = errno;
- throw SystemException("fork() failed", errno);
+ throw SystemException("fork() failed", e);
} else {
// Parent
diff -wbBur passenger-3.0.12/ext/nginx/Configuration.c passenger.git/ext/nginx/Configuration.c
--- passenger-3.0.12/ext/nginx/Configuration.c 2012-04-13 12:09:58.000000000 +0400
+++ passenger.git/ext/nginx/Configuration.c 2012-05-17 19:35:01.000000000 +0400
@@ -1,7 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) 2007 Manlio Perillo (manlio.perillo@gmail.com)
- * Copyright (C) 2010 Phusion
+ * Copyright (C) 2010, 2011, 2012 Phusion
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -335,6 +335,14 @@
conf->upstream_config.pass_request_headers = NGX_CONF_UNSET;
conf->upstream_config.pass_request_body = NGX_CONF_UNSET;
+#if (NGX_HTTP_CACHE)
+ conf->upstream_config.cache = NGX_CONF_UNSET_PTR;
+ conf->upstream_config.cache_min_uses = NGX_CONF_UNSET_UINT;
+ conf->upstream_config.cache_bypass = NGX_CONF_UNSET_PTR;
+ conf->upstream_config.no_cache = NGX_CONF_UNSET_PTR;
+ conf->upstream_config.cache_valid = NGX_CONF_UNSET_PTR;
+#endif
+
conf->upstream_config.intercept_errors = NGX_CONF_UNSET;
conf->upstream_config.cyclic_temp_file = 0;
@@ -511,8 +519,8 @@
if (conf->upstream_config.busy_buffers_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"passenger_busy_buffers_size\" must be equal or bigger than "
- "maximum of the value of \"passenger_buffer_size\" and "
+ "\"passenger_busy_buffers_size\" must be equal to or greater "
+ "than the maximum of the value of \"passenger_buffer_size\" and "
"one of the \"passenger_buffers\"");
return NGX_CONF_ERROR;
@@ -542,8 +550,8 @@
if (conf->upstream_config.temp_file_write_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"passenger_temp_file_write_size\" must be equal or bigger than "
- "maximum of the value of \"passenger_buffer_size\" and "
+ "\"passenger_temp_file_write_size\" must be equal to or greater than "
+ "the maximum of the value of \"passenger_buffer_size\" and "
"one of the \"passenger_buffers\"");
return NGX_CONF_ERROR;
@@ -566,8 +574,8 @@
{
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"passenger_max_temp_file_size\" must be equal to zero to disable "
- "the temporary files usage or must be equal or bigger than "
- "maximum of the value of \"passenger_buffer_size\" and "
+ "temporary files usage or must be equal to or greater than "
+ "the maximum of the value of \"passenger_buffer_size\" and "
"one of the \"passenger_buffers\"");
return NGX_CONF_ERROR;
@@ -639,6 +647,14 @@
conf->cache_key = prev->cache_key;
}
+ #if NGINX_VERSION_NUM >= 1002000
+ ngx_conf_merge_value(conf->upstream_config.cache_lock,
+ prev->upstream_config.cache_lock, 0);
+
+ ngx_conf_merge_msec_value(conf->upstream_config.cache_lock_timeout,
+ prev->upstream_config.cache_lock_timeout, 5000);
+ #endif
+
#endif
ngx_conf_merge_value(conf->upstream_config.pass_request_headers,
@@ -1273,7 +1289,7 @@
NULL },
{ ngx_string("passenger_pass_header"),
- NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_FLAG,
+ NGX_HTTP_MAIN_CONF | NGX_HTTP_SRV_CONF | NGX_HTTP_LOC_CONF | NGX_HTTP_LIF_CONF | NGX_CONF_TAKE1,
ngx_conf_set_str_array_slot,
NGX_HTTP_LOC_CONF_OFFSET,
offsetof(passenger_loc_conf_t, upstream_config.pass_headers),
diff -wbBur passenger-3.0.12/ext/nginx/ContentHandler.c passenger.git/ext/nginx/ContentHandler.c
--- passenger-3.0.12/ext/nginx/ContentHandler.c 2012-04-13 12:09:58.000000000 +0400
+++ passenger.git/ext/nginx/ContentHandler.c 2012-05-17 19:35:01.000000000 +0400
@@ -1,7 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) 2007 Manlio Perillo (manlio.perillo@gmail.com)
- * Copyright (C) 2010 Phusion
+ * Copyright (C) 2010, 2011, 2012 Phusion
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -387,8 +387,8 @@
app_type_string_len = sizeof("wsgi");
break;
default:
- app_type_string = (const u_char *) "rails";
- app_type_string_len = sizeof("rails");
+ app_type_string = (const u_char *) "rack";
+ app_type_string_len = sizeof("rack");
break;
}
@@ -931,7 +931,7 @@
context = ngx_http_get_module_ctx(r, ngx_http_passenger_module);
if (context == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ return NGX_ERROR;
}
rc = parse_status_line(r, context);
@@ -952,7 +952,6 @@
}
#endif
- r->http_version = NGX_HTTP_VERSION_9;
u->headers_in.status_n = NGX_HTTP_OK;
u->state->status = NGX_HTTP_OK;
@@ -966,7 +965,7 @@
u->headers_in.status_line.data = ngx_palloc(r->pool,
u->headers_in.status_line.len);
if (u->headers_in.status_line.data == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ return NGX_ERROR;
}
ngx_memcpy(u->headers_in.status_line.data, context->status_start,
diff -wbBur passenger-3.0.12/lib/phusion_passenger/dependencies.rb passenger.git/lib/phusion_passenger/dependencies.rb
--- passenger-3.0.12/lib/phusion_passenger/dependencies.rb 2012-04-13 12:09:58.000000000 +0400
+++ passenger.git/lib/phusion_passenger/dependencies.rb 2012-05-17 19:35:01.000000000 +0400
@@ -1,5 +1,5 @@
# Phusion Passenger - http://www.modrails.com/
-# Copyright (c) 2010 Phusion
+# Copyright (c) 2010, 2011, 2012 Phusion
#
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
#
@@ -29,7 +29,6 @@
require 'phusion_passenger/platform_info/ruby'
require 'phusion_passenger/platform_info/linux'
require 'phusion_passenger/platform_info/curl'
-require 'phusion_passenger/platform_info/documentation_tools'
module PhusionPassenger
@@ -110,9 +109,9 @@
return (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby") && RUBY_VERSION < "1.8.7"
end
- # Returns whether asciidoc is required in order to be able to package all files
+ # Returns whether Mizuho is required in order to be able to package all files
# in the packaging list.
- def self.asciidoc_required?
+ def self.mizuho_required?
return Packaging::ASCII_DOCS.any? do |fn|
!File.exist?("#{SOURCE_ROOT}/#{fn}")
end
@@ -579,7 +578,7 @@
end
Daemon_Controller = Dependency.new do |dep|
- dep.name = "daemon_controller >= 0.2.5"
+ dep.name = "daemon_controller >= 1.0.0"
dep.install_instructions = "Please install RubyGems first, then run " <<
"<b>#{PlatformInfo.gem_command || "gem"} install daemon_controller</b>"
dep.define_checker do |result|
@@ -591,7 +590,7 @@
require 'daemon_controller'
begin
require 'daemon_controller/version'
- too_old = DaemonController::VERSION_STRING < '0.2.5'
+ too_old = DaemonController::VERSION_STRING < '1.0.0'
rescue LoadError
too_old = true
end
@@ -610,23 +609,18 @@
end
end
- AsciiDoc = Dependency.new do |dep|
- dep.name = "Asciidoc"
+ Mizuho = Dependency.new do |dep|
+ dep.name = "Mizuho"
dep.define_checker do |result|
- if PlatformInfo.asciidoc.nil?
+ mizuho = PlatformInfo.find_command('mizuho')
+ if mizuho.nil?
result.not_found
else
- result.found(PlatformInfo.asciidoc)
+ result.found(mizuho)
end
end
- if RUBY_PLATFORM =~ /darwin/
- # Installing asciidoc with source-highlight is too much of a pain on OS X,
- # so recommend Mizuho instead.
dep.website = "http://github.com/FooBarWidget/mizuho"
dep.install_instructions = "Please install RubyGems first, then run <b>#{PlatformInfo.gem_command || "gem"} install mizuho</b>"
- else
- dep.website = "http://www.methods.co.nz/asciidoc/"
- end
end
end
diff -wbBur passenger-3.0.12/lib/phusion_passenger/standalone/command.rb passenger.git/lib/phusion_passenger/standalone/command.rb
--- passenger-3.0.12/lib/phusion_passenger/standalone/command.rb 2012-04-13 12:09:58.000000000 +0400
+++ passenger.git/lib/phusion_passenger/standalone/command.rb 2012-05-17 19:35:01.000000000 +0400
@@ -1,5 +1,5 @@
# Phusion Passenger - http://www.modrails.com/
-# Copyright (c) 2010 Phusion
+# Copyright (c) 2010, 2011, 2012 Phusion
#
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
#
@@ -61,13 +61,13 @@
require 'daemon_controller'
begin
require 'daemon_controller/version'
- too_old = DaemonController::VERSION_STRING < '0.2.5'
+ too_old = DaemonController::VERSION_STRING < '1.0.0'
rescue LoadError
too_old = true
end
if too_old
error "Your version of daemon_controller is too old. " <<
- "You must install 0.2.5 or later. Please upgrade:\n\n" <<
+ "You must install 1.0.0 or later. Please upgrade:\n\n" <<
" sudo gem uninstall FooBarWidget-daemon_controller\n" <<
" sudo gem install daemon_controller"
@@ -210,24 +210,21 @@
end
end
- def ping_nginx
- require 'socket' unless defined?(UNIXSocket)
- if @options[:socket_file]
- UNIXSocket.new(@options[:socket_file])
- else
- TCPSocket.new(@options[:address], nginx_ping_port)
- end
- end
-
def create_nginx_controller(extra_options = {})
require_daemon_controller
+ require 'socket' unless defined?(UNIXSocket)
@temp_dir = "/tmp/passenger-standalone.#{$$}"
@config_filename = "#{@temp_dir}/config"
+ if @options[:socket_file]
+ ping_spec = [:unix, @options[:socket_file]]
+ else
+ ping_spec = [:tcp, @options[:address], nginx_ping_port]
+ end
opts = {
:identifier => 'Nginx',
:before_start => method(:write_nginx_config_file),
:start_command => method(:determine_nginx_start_command),
- :ping_command => method(:ping_nginx),
+ :ping_command => ping_spec,
:pid_file => @options[:pid_file],
:log_file => @options[:log_file],
:timeout => 25
diff -wbBur passenger-3.0.12/lib/phusion_passenger/standalone/runtime_installer.rb passenger.git/lib/phusion_passenger/standalone/runtime_installer.rb
--- passenger-3.0.12/lib/phusion_passenger/standalone/runtime_installer.rb 2012-04-13 12:09:58.000000000 +0400
+++ passenger.git/lib/phusion_passenger/standalone/runtime_installer.rb 2012-05-17 19:35:01.000000000 +0400
@@ -91,8 +91,8 @@
if Dependencies.fastthread_required?
result << Dependencies::FastThread
end
- if Dependencies.asciidoc_required?
- result << Dependencies::AsciiDoc
+ if Dependencies.mizuho_required?
+ result << Dependencies::Mizuho
end
return result
end
diff -wbBur passenger-3.0.12/lib/phusion_passenger/standalone/start_command.rb passenger.git/lib/phusion_passenger/standalone/start_command.rb
--- passenger-3.0.12/lib/phusion_passenger/standalone/start_command.rb 2012-04-13 12:09:58.000000000 +0400
+++ passenger.git/lib/phusion_passenger/standalone/start_command.rb 2012-05-17 19:35:01.000000000 +0400
@@ -243,15 +243,32 @@
end
end
- def check_port_availability
- if !@options[:socket_file]
+ def check_port(address, port)
+ begin
+ socket = Socket.new(Socket::Constants::AF_INET, Socket::Constants::SOCK_STREAM, 0)
+ sockaddr = Socket.pack_sockaddr_in(port, address)
+ begin
+ socket.connect_nonblock(sockaddr)
+ rescue Errno::ENOENT, Errno::EINPROGRESS, Errno::EAGAIN, Errno::EWOULDBLOCK
+ if select(nil, [socket], nil, 0.1)
begin
- TCPSocket.new(@options[:address], @options[:port]).close
- port_taken = true
- rescue SystemCallError
- port_taken = false
+ socket.connect_nonblock(sockaddr)
+ rescue Errno::EISCONN
+ end
+ else
+ raise Errno::ECONNREFUSED
+ end
end
- if port_taken
+ return true
+ rescue Errno::ECONNREFUSED
+ return false
+ ensure
+ socket.close if socket
+ end
+ end
+
+ def check_port_availability
+ if !@options[:socket_file] && check_port(@options[:address], @options[:port])
error "The address #{@options[:address]}:#{@options[:port]} is already " <<
"in use by another process, perhaps another Phusion Passenger " <<
"Standalone instance.\n\n" <<
@@ -261,7 +278,6 @@
exit 1
end
end
- end
def should_watch_logs?
return !@options[:daemonize] && @options[:log_file] != "/dev/null"
diff -wbBur passenger-3.0.12/lib/phusion_passenger/templates/apache2/apache_must_be_compiled_with_compatible_mpm.txt.erb passenger.git/lib/phusion_passenger/templates/apache2/apache_must_be_compiled_with_compatible_mpm.txt.erb
--- passenger-3.0.12/lib/phusion_passenger/templates/apache2/apache_must_be_compiled_with_compatible_mpm.txt.erb 2012-04-13 12:09:58.000000000 +0400
+++ passenger.git/lib/phusion_passenger/templates/apache2/apache_must_be_compiled_with_compatible_mpm.txt.erb 2012-05-17 19:35:01.000000000 +0400
@@ -1,7 +1,7 @@
<red>WARNING:</red> <yellow>Apache doesn't seem to be compiled with the 'prefork', 'worker' or 'event' MPM</yellow>
Phusion Passenger has only been tested on Apache with the 'prefork', the
-'worker' and the 'worker' MPM. Your Apache installation is compiled with
+'worker' and the 'event' MPM. Your Apache installation is compiled with
the '<%= @current_mpm %>' MPM. We recommend you to abort this installer and to recompile
Apache with either the 'prefork', the 'worker' or the 'event' MPM.
diff -wbBur passenger-3.0.12/lib/phusion_passenger/templates/standalone/config.erb passenger.git/lib/phusion_passenger/templates/standalone/config.erb
--- passenger-3.0.12/lib/phusion_passenger/templates/standalone/config.erb 2012-04-13 12:09:58.000000000 +0400
+++ passenger.git/lib/phusion_passenger/templates/standalone/config.erb 2012-05-17 19:35:01.000000000 +0400
@@ -27,7 +27,7 @@
master_process on;
worker_processes 1;
daemon on;
-error_log '<%= @options[:log_file] %>';
+error_log '<%= @options[:log_file] %>' info;
pid '<%= @options[:pid_file] %>';
<% if @options[:user] %>user <%= @options[:user] %> <%= default_group_for(@options[:user]) %>;<% end %>
@@ -36,6 +36,7 @@
}
http {
+ log_format debug '[$time_local] $msec "$request" $status conn=$connection sent=$bytes_sent body_sent=$body_bytes_sent';
include '<%= PhusionPassenger::RESOURCES_DIR %>/mime.types';
passenger_ruby <%= PlatformInfo.ruby_command %>;
passenger_root '<%= passenger_root %>';
|