passenger 5.3.5 → 5.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +13 -0
- data/README.md +2 -1
- data/Rakefile +0 -5
- data/build/agent.rb +2 -1
- data/build/cxx_tests.rb +18 -20
- data/build/integration_tests.rb +6 -2
- data/build/support/cxx_dependency_map.rb +2019 -1966
- data/dev/colorize-logs +272 -0
- data/src/agent/Core/AdminPanelConnector.h +3 -3
- data/src/agent/Core/ApiServer.h +4 -4
- data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +2 -2
- data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +2 -2
- data/src/agent/Core/ApplicationPool/Implementation.cpp +5 -5
- data/src/agent/Core/ApplicationPool/Pool.h +4 -4
- data/src/agent/Core/ApplicationPool/Process.h +10 -15
- data/src/agent/Core/ApplicationPool/Socket.h +2 -2
- data/src/agent/Core/ApplicationPool/TestSession.h +3 -3
- data/src/agent/Core/Config.h +4 -2
- data/src/agent/Core/Controller.h +4 -4
- data/src/agent/Core/Controller/Config.h +1 -1
- data/src/agent/Core/Controller/SendRequest.cpp +2 -2
- data/src/agent/Core/Controller/TurboCaching.h +2 -2
- data/src/agent/Core/CoreMain.cpp +2 -2
- data/src/agent/Core/OptionParser.h +2 -2
- data/src/agent/Core/ResponseCache.h +3 -3
- data/src/agent/Core/SecurityUpdateChecker.h +2 -2
- data/src/agent/Core/SpawningKit/Config.h +2 -1
- data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/Context.h +1 -1
- data/src/agent/Core/SpawningKit/DirectSpawner.h +3 -3
- data/src/agent/Core/SpawningKit/DummySpawner.h +3 -3
- data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
- data/src/agent/Core/SpawningKit/Exceptions.h +2 -2
- data/src/agent/Core/SpawningKit/Factory.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/Perform.h +13 -2
- data/src/agent/Core/SpawningKit/Handshake/Prepare.h +3 -3
- data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
- data/src/agent/Core/SpawningKit/Journey.h +4 -5
- data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
- data/src/agent/Core/SpawningKit/Result.h +20 -8
- data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/SmartSpawner.h +6 -6
- data/src/agent/Core/SpawningKit/Spawner.h +2 -2
- data/src/agent/Core/TelemetryCollector.h +13 -7
- data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
- data/src/agent/README.md +1 -1
- data/src/agent/Shared/ApiAccountUtils.h +1 -1
- data/src/agent/Shared/ApiServerUtils.h +3 -3
- data/src/agent/Shared/ApplicationPoolApiKey.h +2 -2
- data/src/agent/Shared/Fundamentals/Initialization.cpp +4 -4
- data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
- data/src/agent/SystemMetrics/SystemMetricsMain.cpp +4 -3
- data/src/agent/Watchdog/ApiServer.h +3 -3
- data/src/agent/Watchdog/Config.h +3 -2
- data/src/agent/Watchdog/CoreWatcher.cpp +2 -2
- data/src/agent/Watchdog/WatchdogMain.cpp +93 -27
- data/src/apache2_module/Config.cpp +14 -14
- data/src/apache2_module/Config.h +8 -16
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +505 -491
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +39 -17
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +24 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +31 -1
- data/src/{cxx_supportlib/Utils/MemoryBarrier.h → apache2_module/ConfigGeneral/Common.h} +17 -25
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +12 -1
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +16 -1
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +19 -5
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +26 -9
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +6 -1
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +10 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +7 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +11 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +23 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +34 -1
- data/src/apache2_module/Hooks.cpp +3 -3
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +24 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +36 -1
- data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.cpp +2 -2
- data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.h +4 -4
- data/src/cxx_supportlib/AppTypeDetector/Detector.h +1 -1
- data/src/cxx_supportlib/ConfigKit/Schema.h +2 -2
- data/src/cxx_supportlib/ConfigKit/Store.h +1 -1
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/cxx_supportlib/{Utils → DataStructures}/HashMap.h +4 -4
- data/src/cxx_supportlib/DataStructures/HashedStaticString.h +5 -5
- data/src/cxx_supportlib/DataStructures/LString.h +3 -3
- data/src/cxx_supportlib/{Utils → DataStructures}/StringMap.h +36 -36
- data/src/cxx_supportlib/FileTools/FileManip.cpp +1 -1
- data/src/cxx_supportlib/FileTools/PathManip.cpp +2 -2
- data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
- data/src/cxx_supportlib/Hooks.h +2 -2
- data/src/cxx_supportlib/{Utils → IOTools}/BufferedIO.h +5 -5
- data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.cpp +2 -2
- data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.h +3 -3
- data/src/cxx_supportlib/{Utils → IOTools}/MessageIO.h +7 -7
- data/src/cxx_supportlib/{MessageReadersWriters.h → IOTools/MessageSerialization.h} +5 -5
- data/src/cxx_supportlib/InstanceDirectory.h +4 -4
- data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +3 -3
- data/src/cxx_supportlib/{Utils → JsonTools}/JsonUtils.h +5 -5
- data/src/cxx_supportlib/LoggingKit/Context.h +2 -2
- data/src/cxx_supportlib/LoggingKit/Implementation.cpp +3 -3
- data/src/cxx_supportlib/MemoryKit/mbuf.cpp +2 -2
- data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +5 -5
- data/src/cxx_supportlib/ProcessManagement/Utils.h +10 -0
- data/src/cxx_supportlib/RandomGenerator.h +2 -2
- data/src/cxx_supportlib/{Crypto.cpp → SecurityKit/Crypto.cpp} +4 -4
- data/src/cxx_supportlib/{Crypto.h → SecurityKit/Crypto.h} +4 -4
- data/src/cxx_supportlib/{Utils → SecurityKit}/MemZeroGuard.h +0 -0
- data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +2 -2
- data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
- data/src/cxx_supportlib/ServerKit/Context.h +2 -2
- data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +3 -3
- data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpServer.h +16 -10
- data/src/cxx_supportlib/ServerKit/Server.h +3 -3
- data/src/cxx_supportlib/{Utils → StrIntTools}/DateParsing.h +5 -5
- data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.cpp +3 -3
- data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.h +0 -0
- data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtilsNoStrictAliasing.cpp +2 -2
- data/src/cxx_supportlib/{Utils → StrIntTools}/StringScanning.h +5 -5
- data/src/cxx_supportlib/{Utils → StrIntTools}/Template.h +30 -5
- data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +34 -0
- data/src/cxx_supportlib/{Utils → SystemTools}/ProcessMetricsCollector.h +6 -6
- data/src/cxx_supportlib/{Utils → SystemTools}/SystemMetricsCollector.h +3 -3
- data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.cpp +1 -1
- data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.h +0 -0
- data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
- data/src/cxx_supportlib/Utils.cpp +2 -2
- data/src/cxx_supportlib/Utils/CachedFileStat.hpp +3 -3
- data/src/cxx_supportlib/Utils/Curl.h +2 -2
- data/src/cxx_supportlib/Utils/FileChangeChecker.h +2 -2
- data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
- data/src/cxx_supportlib/Utils/SpeedMeter.h +2 -2
- data/src/cxx_supportlib/Utils/Timer.h +2 -2
- data/src/cxx_supportlib/Utils/VariantMap.h +3 -3
- data/src/cxx_supportlib/WatchdogLauncher.h +3 -3
- data/src/cxx_supportlib/WebSocketCommandReverseServer.h +1 -1
- data/src/cxx_supportlib/WrapperRegistry/Registry.h +1 -1
- data/src/cxx_supportlib/vendor-modified/psg_sysqueue.h +3 -0
- data/src/ruby_supportlib/phusion_passenger.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +11 -11
- data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +4 -4
- data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/message_channel.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +20 -19
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +22 -4
- data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +33 -13
- data/src/schema_printer/SchemaPrinterMain.cpp +2 -0
- metadata +28 -86
- data/.editorconfig +0 -134
- data/CODE_OF_CONDUCT.md +0 -52
- data/dev/boost-patches/0001-Patch-boost-thread-so-that-oxt-thread-can-use-it.patch +0 -48
- data/dev/boost-patches/0002-Make-boost-thread_interrupted-derive-from-oxt-tracab.patch +0 -33
- data/dev/boost-patches/0003-Disable-a-Clang-pragma-to-prevent-warnings-on-OS-X.patch +0 -25
- data/dev/ci/README.md +0 -134
- data/dev/ci/lib/functions.sh +0 -129
- data/dev/ci/lib/set-container-envvars.sh +0 -53
- data/dev/ci/lib/setup-container.sh +0 -46
- data/dev/ci/run-tests-natively +0 -24
- data/dev/ci/run-tests-with-docker +0 -42
- data/dev/ci/scripts/debug-console-wrapper.sh +0 -29
- data/dev/ci/scripts/docker-entrypoint-stage2.sh +0 -17
- data/dev/ci/scripts/docker-entrypoint.sh +0 -17
- data/dev/ci/scripts/inituidgid +0 -17
- data/dev/ci/scripts/run-tests-natively-stage2.sh +0 -17
- data/dev/ci/scripts/setup-host-natively.sh +0 -11
- data/dev/ci/setup-host +0 -56
- data/dev/ci/tests/apache2/run +0 -6
- data/dev/ci/tests/apache2/setup +0 -4
- data/dev/ci/tests/binaries/Jenkinsfile +0 -105
- data/dev/ci/tests/binaries/build-linux +0 -38
- data/dev/ci/tests/binaries/build-macos +0 -40
- data/dev/ci/tests/binaries/prepare-macos +0 -38
- data/dev/ci/tests/binaries/test-linux +0 -45
- data/dev/ci/tests/binaries/test-macos +0 -38
- data/dev/ci/tests/cxx/run +0 -9
- data/dev/ci/tests/cxx/setup +0 -4
- data/dev/ci/tests/debian/Jenkinsfile +0 -89
- data/dev/ci/tests/debian/run +0 -60
- data/dev/ci/tests/nginx-dynamic/run +0 -20
- data/dev/ci/tests/nginx-dynamic/setup +0 -4
- data/dev/ci/tests/nginx/run +0 -5
- data/dev/ci/tests/nginx/setup +0 -4
- data/dev/ci/tests/nodejs/run +0 -4
- data/dev/ci/tests/nodejs/setup +0 -4
- data/dev/ci/tests/rpm/Jenkinsfile +0 -68
- data/dev/ci/tests/rpm/run +0 -63
- data/dev/ci/tests/ruby/run +0 -4
- data/dev/ci/tests/ruby/setup +0 -4
- data/dev/ci/tests/source-packaging/run +0 -4
- data/dev/ci/tests/source-packaging/setup +0 -4
- data/dev/ci/tests/standalone/run +0 -4
- data/dev/ci/tests/standalone/setup +0 -4
- data/dev/configkit-schemas/index.json +0 -1850
- data/dev/configkit-schemas/update_schema_inline_comments.rb +0 -118
- data/dev/rack.test/config.ru +0 -5
- data/dev/rack.test/public/asset.txt +0 -1
- data/dev/vagrant/apache_default_site.conf +0 -35
- data/dev/vagrant/apache_passenger.conf +0 -5
- data/dev/vagrant/apache_passenger.load +0 -1
- data/dev/vagrant/apache_ports.conf +0 -24
- data/dev/vagrant/apache_rack_test.conf +0 -9
- data/dev/vagrant/bashrc +0 -23
- data/dev/vagrant/nginx.conf +0 -39
- data/dev/vagrant/nginx_rakefile +0 -33
- data/dev/vagrant/nginx_start +0 -32
- data/dev/vagrant/provision.sh +0 -117
- data/dev/vagrant/sudoers.conf +0 -5
- data/resources/templates/error_renderer/.editorconfig +0 -19
@@ -1,118 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require_relative '../../src/ruby_supportlib/phusion_passenger/utils/json'
|
3
|
-
|
4
|
-
SimpleJSON = PhusionPassenger::Utils::JSON
|
5
|
-
|
6
|
-
FILES = Dir['src/**/*.{h,cpp}']
|
7
|
-
SCHEMAS = SimpleJSON.parse(File.read('dev/configkit-schemas/index.json'))
|
8
|
-
|
9
|
-
def main
|
10
|
-
FILES.each do |path|
|
11
|
-
update_file(path)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def update_file(path)
|
16
|
-
content = File.open(path, 'r:utf-8') do |f|
|
17
|
-
f.read
|
18
|
-
end
|
19
|
-
orig_content = content.dup
|
20
|
-
|
21
|
-
pos = 0
|
22
|
-
|
23
|
-
while match_begin = /^(.*?)BEGIN ConfigKit schema: (.+)/.match(content, pos)
|
24
|
-
if match_end = /END/.match(content, match_begin.end(0))
|
25
|
-
prefix = match_begin.captures[0]
|
26
|
-
class_name = match_begin.captures[1]
|
27
|
-
replacement = format_inline_comment_for_schema(prefix, class_name)
|
28
|
-
|
29
|
-
content[match_begin.begin(0) .. match_end.end(0) - 1] = replacement
|
30
|
-
pos = match_begin.begin(0) + replacement.size
|
31
|
-
else
|
32
|
-
break
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
if content != orig_content
|
37
|
-
puts "Updating #{path}"
|
38
|
-
File.open(path, 'w:utf-8') do |f|
|
39
|
-
f.write(content)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def format_inline_comment_for_schema(prefix, class_name)
|
45
|
-
lines = [
|
46
|
-
"BEGIN ConfigKit schema: #{class_name}",
|
47
|
-
"(do not edit: following text is automatically generated",
|
48
|
-
"by 'rake configkit_schemas_inline_comments')",
|
49
|
-
""
|
50
|
-
]
|
51
|
-
|
52
|
-
if schema = SCHEMAS[class_name]
|
53
|
-
table = []
|
54
|
-
schema.each_pair do |key, info|
|
55
|
-
table << [
|
56
|
-
key,
|
57
|
-
info['type'],
|
58
|
-
info['required'] ? 'required' : '-',
|
59
|
-
format_option_names(info)
|
60
|
-
]
|
61
|
-
end
|
62
|
-
|
63
|
-
column_lengths = find_max_column_lengths(table)
|
64
|
-
table.each do |row|
|
65
|
-
fmt = " %-#{column_lengths[0]}s %-#{column_lengths[1]}s %-#{column_lengths[2]}s %-#{column_lengths[3]}s"
|
66
|
-
lines << sprintf(fmt, *row)
|
67
|
-
end
|
68
|
-
else
|
69
|
-
lines << "(unknown: #{class_name} not in dev/configkit-schemas/index.json"
|
70
|
-
lines << " Please run:"
|
71
|
-
lines << " touch src/schema_printer/SchemaPrinterMain.cpp.cxxcodebuilder"
|
72
|
-
lines << " rake configkit_schemas_inline_comments"
|
73
|
-
lines << ")"
|
74
|
-
end
|
75
|
-
|
76
|
-
lines << ""
|
77
|
-
lines << "END"
|
78
|
-
lines.map{ |x| "#{prefix}#{x}".rstrip }.join("\n")
|
79
|
-
end
|
80
|
-
|
81
|
-
def format_option_names(schema_entry)
|
82
|
-
options = []
|
83
|
-
if schema_entry['has_default_value']
|
84
|
-
if schema_entry['has_default_value'] == 'static'
|
85
|
-
desc = format_default_value_desc(schema_entry['default_value'])
|
86
|
-
options << "default(#{desc})"
|
87
|
-
else
|
88
|
-
options << 'default'
|
89
|
-
end
|
90
|
-
end
|
91
|
-
options << 'secret' if schema_entry['secret']
|
92
|
-
options << 'read_only' if schema_entry['read_only']
|
93
|
-
result = options.join(',')
|
94
|
-
result = '-' if result.empty?
|
95
|
-
result
|
96
|
-
end
|
97
|
-
|
98
|
-
def format_default_value_desc(value)
|
99
|
-
if value.is_a?(Array) || value.is_a?(Hash)
|
100
|
-
SimpleJSON.generate(value)
|
101
|
-
else
|
102
|
-
SimpleJSON.generate([value]).sub(/\A\[/, '').sub(/\]\Z/, '')
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
def find_max_column_lengths(table)
|
107
|
-
lengths = []
|
108
|
-
table.each do |row|
|
109
|
-
row.each_with_index do |col, i|
|
110
|
-
if lengths[i].nil? || lengths[i] < col.size
|
111
|
-
lengths[i] = col.size
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
lengths
|
116
|
-
end
|
117
|
-
|
118
|
-
main
|
data/dev/rack.test/config.ru
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
This is a static asset.
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# This file is overwritten by 'vagrant provision'. For the source,
|
2
|
-
# see dev/vagrant/apache_default_site.conf in the Phusion Passenger source
|
3
|
-
# tree.
|
4
|
-
|
5
|
-
<VirtualHost *:8000>
|
6
|
-
# The ServerName directive sets the request scheme, hostname and port that
|
7
|
-
# the server uses to identify itself. This is used when creating
|
8
|
-
# redirection URLs. In the context of virtual hosts, the ServerName
|
9
|
-
# specifies what hostname must appear in the request's Host: header to
|
10
|
-
# match this virtual host. For the default virtual host (this file) this
|
11
|
-
# value is not decisive as it is used as a last resort host regardless.
|
12
|
-
# However, you must set it for any further virtual host explicitly.
|
13
|
-
#ServerName www.example.com
|
14
|
-
|
15
|
-
ServerAdmin webmaster@localhost
|
16
|
-
DocumentRoot /var/www/html
|
17
|
-
|
18
|
-
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
|
19
|
-
# error, crit, alert, emerg.
|
20
|
-
# It is also possible to configure the loglevel for particular
|
21
|
-
# modules, e.g.
|
22
|
-
#LogLevel info ssl:warn
|
23
|
-
|
24
|
-
ErrorLog ${APACHE_LOG_DIR}/error.log
|
25
|
-
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
26
|
-
|
27
|
-
# For most configuration files from conf-available/, which are
|
28
|
-
# enabled or disabled at a global level, it is possible to
|
29
|
-
# include a line for only one particular virtual host. For example the
|
30
|
-
# following line enables the CGI configuration for this host only
|
31
|
-
# after it has been globally disabled with "a2disconf".
|
32
|
-
#Include conf-available/serve-cgi-bin.conf
|
33
|
-
</VirtualHost>
|
34
|
-
|
35
|
-
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
@@ -1 +0,0 @@
|
|
1
|
-
LoadModule passenger_module /vagrant/buildout/apache2/mod_passenger.so
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# This file is overwritten by 'vagrant provision'. For the source,
|
2
|
-
# see dev/vagrant/apache_ports.conf in the Phusion Passenger source
|
3
|
-
# tree.
|
4
|
-
|
5
|
-
# If you just change the port or add more ports here, you will likely also
|
6
|
-
# have to change the VirtualHost statement in
|
7
|
-
# /etc/apache2/sites-enabled/000-default.conf
|
8
|
-
|
9
|
-
Listen 8000
|
10
|
-
Listen 8001
|
11
|
-
Listen 8002
|
12
|
-
Listen 8003
|
13
|
-
Listen 8004
|
14
|
-
Listen 8005
|
15
|
-
|
16
|
-
<IfModule ssl_module>
|
17
|
-
Listen 8010
|
18
|
-
</IfModule>
|
19
|
-
|
20
|
-
<IfModule mod_gnutls.c>
|
21
|
-
Listen 8010
|
22
|
-
</IfModule>
|
23
|
-
|
24
|
-
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
data/dev/vagrant/bashrc
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# This file is overwritten by 'vagrant provision'. For the source,
|
2
|
-
# see dev/vagrant/bashrc in the Phusion Passenger source
|
3
|
-
# tree.
|
4
|
-
|
5
|
-
# Display git branch in bash prompt.
|
6
|
-
export PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1 " (%s)")]\$ '
|
7
|
-
|
8
|
-
# Add Phusion Passenger command line tools to PATH.
|
9
|
-
export PATH=/vagrant/bin:$PATH
|
10
|
-
|
11
|
-
# Tell Phusion Passenger's build system to use ccache.
|
12
|
-
export USE_CCACHE=1
|
13
|
-
export CCACHE_COMPRESS=1
|
14
|
-
|
15
|
-
# Tell Phusion Passenger Standalone to run in debug mode.
|
16
|
-
export PASSENGER_DEBUG=1
|
17
|
-
|
18
|
-
export PASSENGER_VAGRANT_ENVIRONMENT=1
|
19
|
-
|
20
|
-
alias ls='ls -Fh --color'
|
21
|
-
alias dir='ls -l'
|
22
|
-
alias free='free -m'
|
23
|
-
alias df='df -h'
|
data/dev/vagrant/nginx.conf
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
daemon off;
|
2
|
-
worker_processes 1;
|
3
|
-
#user nobody;
|
4
|
-
#error_log logs/error.log debug;
|
5
|
-
#pid logs/nginx.pid;
|
6
|
-
|
7
|
-
|
8
|
-
events {
|
9
|
-
worker_connections 1024;
|
10
|
-
}
|
11
|
-
|
12
|
-
|
13
|
-
http {
|
14
|
-
include mime.types;
|
15
|
-
default_type application/octet-stream;
|
16
|
-
sendfile on;
|
17
|
-
keepalive_timeout 65;
|
18
|
-
#gzip on;
|
19
|
-
|
20
|
-
passenger_root /vagrant;
|
21
|
-
passenger_ruby /usr/bin/ruby;
|
22
|
-
passenger_log_level 1;
|
23
|
-
|
24
|
-
server {
|
25
|
-
listen 8100;
|
26
|
-
server_name localhost;
|
27
|
-
location / {
|
28
|
-
root html;
|
29
|
-
index index.html index.htm;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
server {
|
34
|
-
listen 8101;
|
35
|
-
server_name rack.test;
|
36
|
-
root /vagrant/dev/rack.test/public;
|
37
|
-
passenger_enabled on;
|
38
|
-
}
|
39
|
-
}
|
data/dev/vagrant/nginx_rakefile
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
ENV['CC'] ||= 'ccache cc'
|
2
|
-
ENV['CXX'] ||= 'ccache c++'
|
3
|
-
|
4
|
-
desc "Bootstrap Nginx for the first time"
|
5
|
-
task :bootstrap => :configure do
|
6
|
-
sh "make -j2"
|
7
|
-
sh "make install"
|
8
|
-
sh "rm -f inst/sbin/nginx"
|
9
|
-
puts
|
10
|
-
puts "--------------------------"
|
11
|
-
puts "You're all set! You can start Nginx by running:"
|
12
|
-
puts
|
13
|
-
puts " ./start"
|
14
|
-
puts
|
15
|
-
puts "Nginx can be reached from the host machine on http://127.0.0.1:8100/"
|
16
|
-
puts
|
17
|
-
puts "You never have to run `rake bootstrap` again. You also never have to " +
|
18
|
-
"run `make install`. If you've made changes to the Passenger Nginx module, " +
|
19
|
-
"simply run `make && ./start` in /home/vagrant/nginx. The `start` script " +
|
20
|
-
"will start the newly compiled Nginx binary directly."
|
21
|
-
end
|
22
|
-
|
23
|
-
desc "Configure Nginx source tree"
|
24
|
-
task :configure do
|
25
|
-
sh "./configure --prefix=/home/vagrant/nginx/inst" +
|
26
|
-
" --add-module=/vagrant/src/nginx_module" +
|
27
|
-
" --with-http_ssl_module" +
|
28
|
-
" --with-http_gzip_static_module" +
|
29
|
-
" --with-http_stub_status_module" +
|
30
|
-
" --with-http_v2_module" +
|
31
|
-
" --with-debug"
|
32
|
-
sh "sed", "-E", "-i", 's/ -O[0-9]? / -ggdb /g', "objs/Makefile"
|
33
|
-
end
|
data/dev/vagrant/nginx_start
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
# This file is overwritten by 'vagrant provision'. For the source,
|
3
|
-
# see dev/vagrant/nginx_start in the Phusion Passenger source
|
4
|
-
# tree.
|
5
|
-
|
6
|
-
ENV['PASSENGER_BEEP_ON_ABORT'] = '1'
|
7
|
-
|
8
|
-
def run_in_bg(*command)
|
9
|
-
return fork do
|
10
|
-
Process.setsid
|
11
|
-
exec(*command)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
File.open('inst/logs/error.log', 'a') do |f|
|
16
|
-
f.write("\n\n\n\n-------------- NGINX START #{Time.now} --------------\n\n\n\n")
|
17
|
-
end
|
18
|
-
|
19
|
-
tail_pid = run_in_bg("tail -n 0 -f inst/logs/error.log")
|
20
|
-
nginx_pid = run_in_bg("./objs/nginx", *ARGV)
|
21
|
-
begin
|
22
|
-
Process.waitpid(nginx_pid)
|
23
|
-
nginx_pid = nil
|
24
|
-
rescue Interrupt
|
25
|
-
ensure
|
26
|
-
Process.kill('INT', tail_pid)
|
27
|
-
Process.waitpid(tail_pid)
|
28
|
-
if nginx_pid
|
29
|
-
Process.kill('INT', nginx_pid)
|
30
|
-
Process.waitpid(nginx_pid)
|
31
|
-
end
|
32
|
-
end
|
data/dev/vagrant/provision.sh
DELETED
@@ -1,117 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -ex
|
3
|
-
set -o pipefail
|
4
|
-
|
5
|
-
|
6
|
-
### Update /etc/hosts
|
7
|
-
|
8
|
-
if ! grep -q passenger.test /etc/hosts; then
|
9
|
-
cat >>/etc/hosts <<-EOF
|
10
|
-
|
11
|
-
127.0.0.1 passenger.test
|
12
|
-
127.0.0.1 mycook.passenger.test
|
13
|
-
127.0.0.1 zsfa.passenger.test
|
14
|
-
127.0.0.1 norails.passenger.test
|
15
|
-
127.0.0.1 1.passenger.test 2.passenger.test 3.passenger.test
|
16
|
-
127.0.0.1 4.passenger.test 5.passenger.test 6.passenger.test
|
17
|
-
127.0.0.1 7.passenger.test 8.passenger.test 9.passenger.test
|
18
|
-
127.0.0.1 rack.test foobar.test
|
19
|
-
EOF
|
20
|
-
fi
|
21
|
-
|
22
|
-
|
23
|
-
### Update bashrc and bash profile
|
24
|
-
|
25
|
-
if ! grep -q bashrc.mine /etc/bash.bashrc; then
|
26
|
-
echo ". /etc/bash.bashrc.mine" >> /etc/bash.bashrc
|
27
|
-
fi
|
28
|
-
if ! grep -q bashrc.mine /home/vagrant/.bashrc; then
|
29
|
-
echo ". /etc/bash.bashrc.mine" >> /home/vagrant/.bashrc
|
30
|
-
fi
|
31
|
-
if ! grep -q /vagrant /home/vagrant/.profile; then
|
32
|
-
echo "if tty -s; then cd /vagrant; fi" >> /home/vagrant/.profile
|
33
|
-
fi
|
34
|
-
cp /vagrant/dev/vagrant/bashrc /etc/bash.bashrc.mine
|
35
|
-
cp /vagrant/dev/vagrant/sudoers.conf /etc/sudoers.d/passenger
|
36
|
-
chmod 440 /etc/sudoers.d/passenger
|
37
|
-
|
38
|
-
|
39
|
-
### Install native dependencies
|
40
|
-
|
41
|
-
apt-get update
|
42
|
-
apt-get install -y build-essential git bash-completion ccache wget \
|
43
|
-
libxml2-dev libxslt1-dev libsqlite3-dev libcurl4-openssl-dev libpcre3-dev \
|
44
|
-
ruby ruby-dev nodejs npm \
|
45
|
-
apache2-mpm-worker apache2-threaded-dev
|
46
|
-
|
47
|
-
|
48
|
-
### Install basic gems
|
49
|
-
|
50
|
-
if [[ ! -e /usr/local/bin/rake ]]; then
|
51
|
-
gem install rake --no-rdoc --no-ri
|
52
|
-
fi
|
53
|
-
if [[ ! -e /usr/local/bin/drake ]]; then
|
54
|
-
gem install drake --no-rdoc --no-ri
|
55
|
-
fi
|
56
|
-
if [[ ! -e /usr/local/bin/bundler ]]; then
|
57
|
-
gem install bundler --no-rdoc --no-ri
|
58
|
-
fi
|
59
|
-
|
60
|
-
|
61
|
-
### Install Phusion Passenger development dependencies
|
62
|
-
|
63
|
-
pushd /vagrant
|
64
|
-
if [[ ! -e ~/.test_deps_installed ]]; then
|
65
|
-
rake test:install_deps SUDO=1 DEPS_TARGET=~/bundle
|
66
|
-
touch ~/.test_deps_installed
|
67
|
-
else
|
68
|
-
bundle install --path ~/bundle
|
69
|
-
fi
|
70
|
-
popd
|
71
|
-
|
72
|
-
|
73
|
-
### Install Nginx source code
|
74
|
-
|
75
|
-
pushd /home/vagrant
|
76
|
-
if [[ ! -e nginx ]]; then
|
77
|
-
sudo -u vagrant -H git clone -b branches/stable-1.6 https://github.com/nginx/nginx.git
|
78
|
-
fi
|
79
|
-
sudo -u vagrant -H mkdir -p nginx/inst/conf
|
80
|
-
sudo -u vagrant -H cp /vagrant/dev/vagrant/nginx_start nginx/start
|
81
|
-
if [[ ! -e nginx/Rakefile ]]; then
|
82
|
-
sudo -u vagrant -H cp /vagrant/dev/vagrant/nginx_rakefile nginx/Rakefile
|
83
|
-
fi
|
84
|
-
if [[ ! -e nginx/inst/conf/nginx.conf ]]; then
|
85
|
-
sudo -u vagrant -H cp /vagrant/dev/vagrant/nginx.conf nginx/inst/conf/
|
86
|
-
fi
|
87
|
-
if [[ ! -e nginx/nginx.conf && ! -h nginx/nginx.conf ]]; then
|
88
|
-
sudo -u vagrant -H ln -s inst/conf/nginx.conf nginx/nginx.conf
|
89
|
-
fi
|
90
|
-
if [[ ! -e nginx/access.log && ! -h nginx/access.log ]]; then
|
91
|
-
sudo -u vagrant -H ln -s inst/logs/access.log nginx/access.log
|
92
|
-
fi
|
93
|
-
if [[ ! -e nginx/error.log && ! -h nginx/error.log ]]; then
|
94
|
-
sudo -u vagrant -H ln -s inst/logs/error.log nginx/error.log
|
95
|
-
fi
|
96
|
-
popd
|
97
|
-
|
98
|
-
|
99
|
-
### Set up Apache
|
100
|
-
|
101
|
-
should_restart_apache=false
|
102
|
-
cp /vagrant/dev/vagrant/apache_ports.conf /etc/apache2/ports.conf
|
103
|
-
cp /vagrant/dev/vagrant/apache_default_site.conf /etc/apache2/sites-available/000-default.conf
|
104
|
-
if [[ ! -e /etc/apache2/mods-available/passenger.conf ]]; then
|
105
|
-
cp /vagrant/dev/vagrant/apache_passenger.conf /etc/apache2/mods-available/passenger.conf
|
106
|
-
fi
|
107
|
-
if [[ ! -e /etc/apache2/mods-available/passenger.load ]]; then
|
108
|
-
cp /vagrant/dev/vagrant/apache_passenger.load /etc/apache2/mods-available/passenger.load
|
109
|
-
fi
|
110
|
-
if [[ ! -e /etc/apache2/sites-available/010-rack.test.conf ]]; then
|
111
|
-
cp /vagrant/dev/vagrant/apache_rack_test.conf /etc/apache2/sites-available/010-rack.test.conf
|
112
|
-
a2ensite 010-rack.test
|
113
|
-
should_restart_apache=true
|
114
|
-
fi
|
115
|
-
if $should_restart_apache; then
|
116
|
-
service apache2 restart
|
117
|
-
fi
|