Lets dwell into the technical world that had me captive for a couples hours, last week:
The installation of NGINX & Phusion Passenger should be very straight forward and no cause for a blog post. Except, and the fun start here, if you are compiling both from source, inside Amazon AWS, on a small EC2 instance (32 bits) and your dom0 is 64bits (no way of knowing, but most should) and Amazon gave you a slice of memory over the 4gb of normally addressable slot (small windows of opportunity, but still). How bad can it get ? Well, you will be flooded by the dreaded “4gb seg fixup” error message in your log files and your ruby process will drop to an almost standstill speed.
Your god, Google, will advice you to do stuff (which you should have already tried):
apt-get install libc6-xen
echo ‘hwcap 0 nosegneg’ > /etc/ld.so.conf.d/libc6-xen.conf ; ldconfig
mv /lib/tls /lib/tls.disabled
And this is where you will start to despair, because, of the 26 200 Google results for “4gb seg fixup“, 26 000 are either linking to a post asking the same question or answering with one of those two answers and 200 are for 4gb usb key. Neither of which will help the message to go away from your syslog and bring it back NGINX/Ruby to decent speed.
So. At this point, where you are starting to think about wiping everything and starting back from scratch (which won’t help), try this little procedure. The principle is to remove the passenger gem from your system, reinstall it (which will only download the source), modify the makefile, recompile NGINX (which in turn automatically compile the Phusion Passenger module) and take a beer while your system serve ruby pages without (systems) errors.
#> gem uninstall passenger
#> gem install passenger
We have a valid passenger gem source code in /var/lib/gems/1.8/gems/passenger-2.2.4 - version can vary and location is valid for Ubuntu/Debian, but could change on others distro. We will be modifying the optimization flags given to the compiler. Since Phusion Passenger does not accept command line argument and variables declarations, we have no other choices than to modify the rake file pre-compilation.
#> sed ‘s/EXTRA_CXXFLAGS = “-Wall #{OPTIMIZATION_FLAGS}”/EXTRA_CXXFLAGS = “-Wall -mno-tls-direct-seg-refs #{OPTIMIZATION_FLAGS}”/g’ /tmp/rakefile
#> mv /tmp/rakefile /var/lib/gems/1.8/gems/passenger-2.2.4/Rakefile
This being done, we will start an NGINX compilation process which will, in turn, start passenger-2.2.4 compilation. Using the -mno-tls-direct-seg-refs will allows us to work arround the 4gb seg fixup error.
#> CFLAGS=”-mno-tls-direct-seg-refs” CXXFLAGS=”-mno-tls-direct-seg-refs” ./configure –prefix=’/usr/local/nginx-0.7.61′ –add-module=’/var/lib/gems/1.8/gems/passenger-2.2.4/ext/nginx’ –with-http_ssl_module –with-http_stub_status_module
There you go.
Paying a small cost the reverse cell phone lookup internet site provides you in addition to an intact comment whilst has only in relation to every you’ll call for while stumble on by the side of concerning who owns the phone. You’ll locate next to with reference to the felony history, their identity while well while avenue address.
Thanks for the great post on your blog, it really gives me an insight on this topic.~`*’:
I just added your RSS Feed on my RSS reader, it is so nice to read your blog.”`:,-
Have you already setup a fan page on Facebook ?:;`-’
I really love the way you discuss this kind of topic.~’,~~
http://www.thoughts.com/bestcigarettesonline/best-cigarettes-affordable-smoking-without-high-taxes best cigarettes
Sometimes your blog is loading slowly, better find a better host.-,”.;
Oh i really envy the way you post topics, how i wish i could write like that.-,-*;
I’m new to your blog and i really appreciate the nice posts and great layout.,”~’,
You can increase your blog visitors by having a fan page on facebook..,.`:
http://www.thoughts.com/quitsmokingfast/quit-smoking-easy-and-natural-way-to-do-it quit smoking
You can increase your blog visitors by having a fan page on facebook.;:`;.
Man that was very entertaining and at the same time informative..~”"*
The thing i like about your blog is that you always post direct to the point info.:;””
You can also put a chatbox on your blog for more interactivity among readers.-~:’”
http://www.thoughts.com/scholarshipsite/scholarship-10k-in-free-money-for-school scholarship
You are so cool man, the post on your blogs are super great.-’~:,
What would be your next topic next week on your blog…”~*
http://www.thoughts.com/cheapcarinsurancesites/cheap-car-insurance-easiest-way-to-get-cheap-rates cheap car insurance
Great blog post and nice discussion among the comments.~*–,
I always visit your blog everyday to read new topics..~*“
I just added your RSS Feed on my RSS reader, it is so nice to read your blog..~*~`
Only a few blogger would discuss this topic the way you do.**”~~
Well, another blogger already posted a topic like this.-’:~’
A blog like yours should be earning much money from adsense.,,~:.
I will invite all my friends to your blog, you really got a great blog.*.~”`
Hey, what kind of anti-spam plugin do you use for your blog..~’.`
I really love the way you discuss this kind of topic.;”:”~