Skip to content

Commit ac1e00b

Browse files
committed
Fixed the Passenger 4gb seg fixup errors.
1 parent 45ec84d commit ac1e00b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

server/rakefile.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@
157157
desc "Install nginx from source"
158158
task :install_nginx => [:require_root, :install_packages, :install_gems] do |t|
159159
unless_completed(t) do
160+
161+
# To work around a Passenger bug, we need to edit the Rakefile.
162+
# Unfortunately this is a bit brittle and will break when Passenger is updated
163+
# The bug: http://code.google.com/p/phusion-passenger/issues/detail?id=316
164+
# The solution is to add -mno-tls-direct-seg-refs to the compiler options:
165+
# http://blog.pacharest.com/2009/08/a-bit-technical-nginx-passenger-4gb-seg-fixup/
166+
replace_line("#{@fs_dir}/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/Rakefile", %q(EXTRA_CXXFLAGS = "-Wall -mno-tls-direct-seg-refs #{OPTIMIZATION_FLAGS}"), 50)
167+
160168
nginx_version = "nginx-0.7.60"
161169
nginx_tar = "#{nginx_version}.tar.gz"
162170

@@ -171,6 +179,7 @@
171179
--sbin-path=/usr/sbin \
172180
--conf-path=/etc/nginx/nginx.conf \
173181
--pid-path=/var/run/nginx.pid \
182+
--error-log-path=/mnt/log/nginx/default_error.log \
174183
--with-http_ssl_module \
175184
--with-http_stub_status_module \
176185
--add-module=`/usr/bin/passenger-config --root`/ext/nginx && \
@@ -266,4 +275,4 @@ def replace(file, pattern, text)
266275
File.open(file, 'w') do |f|
267276
contents.each {|line| f << line}
268277
end
269-
end
278+
end

0 commit comments

Comments
 (0)