Permalink
Browse files

Fixed the Passenger 4gb seg fixup errors.

  • Loading branch information...
1 parent 45ec84d commit ac1e00be10b7866dadfd6ba2441410086fad38ec @pauldowman committed Oct 25, 2009
Showing with 10 additions and 1 deletion.
  1. +10 −1 server/rakefile.rb
View
@@ -157,6 +157,14 @@
desc "Install nginx from source"
task :install_nginx => [:require_root, :install_packages, :install_gems] do |t|
unless_completed(t) do
+
+ # To work around a Passenger bug, we need to edit the Rakefile.
+ # Unfortunately this is a bit brittle and will break when Passenger is updated
+ # The bug: http://code.google.com/p/phusion-passenger/issues/detail?id=316
+ # The solution is to add -mno-tls-direct-seg-refs to the compiler options:
+ # http://blog.pacharest.com/2009/08/a-bit-technical-nginx-passenger-4gb-seg-fixup/
+ 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)
+
nginx_version = "nginx-0.7.60"
nginx_tar = "#{nginx_version}.tar.gz"
@@ -171,6 +179,7 @@
--sbin-path=/usr/sbin \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
+ --error-log-path=/mnt/log/nginx/default_error.log \
--with-http_ssl_module \
--with-http_stub_status_module \
--add-module=`/usr/bin/passenger-config --root`/ext/nginx && \
@@ -266,4 +275,4 @@ def replace(file, pattern, text)
File.open(file, 'w') do |f|
contents.each {|line| f << line}
end
-end
+end

0 comments on commit ac1e00b

Please sign in to comment.