Nginx now supports compiling with the passenger (http://modrails.org) module that allows it to run Ruby on Rails and any Rack compatible applications seamlessly. It would be nice if the nginx ebuild supported a USE flag to download and compile this module along with nginx. http://blog.phusion.nl/2009/04/16/phusions-one-year-anniversary-gift-phusion-passenger-220/
Created attachment 189396 [details] Initial ebuild to add 'passenger' USE flag for nginx-0.6.36 Here's a quick attempt at this, which relies on FEATURES="-sandbox" since passenger-install-nginx-module attempts to create a workdir inside the passenger gem install dir. This is strictly a "works for me" attempt and needs attention from someone who knows what they're doing. Use at your own peril. # install from this bug: wget http://bugs.gentoo.org/attachment.cgi?id=###### /nginx-0.6.36.ebuild /usr/portage/www-servers/nginx/nginx-0.6.36.ebuild # the tarfile is not yet in portage so we need to get it from sysoev.ru: ebuild /usr/portage/www-servers/nginx/nginx-0.6.36.ebuild digest echo 'www-servers/nginx **' >> /etc/portage/package.keywords # if using Ruby Enterprise Edition, make sure we use the correct `passenger-config`: export PATH=/opt/ruby-enterprise-1.8.6-20090421/bin:$PATH # WARNING: this disabling sandboxing is *exceedingly* dangerous, since it allows this ebuild totally to trash your system! FEATURES="-sandbox" RUBYOPT="" emerge -av =www-servers/nginx-0.6.36 nginx # check that the 'ssl' and 'passenger' USE flags are enabled Now follow http://www.modrails.com/documentation/Users%20guide%20Nginx.html
I'm only eyeballing the patch, but is this "workdir", the "fakeroot" variable? If you check the apache passenger gentoo patches this is overridden to point to the ebuild work dir? (A slotted ruby EEE install would be quite nice also if anyone wanted to have a crack at that...)
(In reply to comment #2) > I'm only eyeballing the patch, but is this "workdir", the "fakeroot" variable? > If you check the apache passenger gentoo patches this is overridden to point to > the ebuild work dir? Not sure what effect setting fakeroot will have but without FEATURES=-sandbox the emerge fails with an ACCESS VIOLATION error trying to mkdir within the *passenger* gem dir (not the nginx install dir); in my case the 'libboost_oxt' dir in /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/passenger-2.2.1/ext/nginx > (A slotted ruby EEE install would be quite nice also if anyone wanted to have a > crack at that...) >
What about passenger support in nginx 0.7.x ?
(In reply to comment #4) > What about passenger support in nginx 0.7.x ? Passenger will only work with HEAD nginx 0.7.x (and with 0.6.x) according to http://code.google.com/p/phusion-passenger/issues/detail?id=252 Not tested it though. -- Thomas
http://article.gmane.org/gmane.comp.web.nginx.english/12430 0.7.x branch became stable. Could anyone help with the USE flag? It would be nice to test the new nginx with passenger...
I installed ruby by compiling it myself (portage handled ruby doesn't quite do it for me...). Then I installed the passenger gem 2.2.4. After installing passenger gem went to the root passenger dir and ran "rake nginx" to get the helperserver needed. Then I copied the nginx-0.7.61.ebuild and modified it to include the use flag passenger. Then using the hint from the ebuild attached to this bug got the full path for the nginx passenger module and put that into my ebuild. Then added the passenger use flag to /etc/portage/package.use for nginx and emerged nginx 0.7.61 with passenger. Added the config info to /etc/nginx.conf and I'm away everything works very nicely :)
(In reply to comment #7) > I installed ruby by compiling it myself (portage handled ruby doesn't quite do > it for me...). Feel free to open a separate bug with your wishes, they might be useful for a wider audience.
Created attachment 200158 [details, diff] Simplistic patch to add passenger support Here's a very simplistic patch against nginx-0.8.4-r1.ebuild that Works For Me as per instructions in comment #1. Just adds a passenger use flag, no attempt yet to fix the FEATURES= and PATH= hackery. The version of Ruby Enterprise Edition in the 'ruby' overlay needs some love too, so I'm assuming anyone using this in earnest is doing source installation of REE instead of using portage.
Created attachment 205845 [details] www-misc\passenger\passenger-2.2.5.ebuild I created a new ebuild for passenger and added the rake task for nginx and it worked fine within the sandbox.
Created attachment 205847 [details, diff] patch for nginx to add support for passenger to be used with the passenger ebuild
Comment on attachment 205845 [details] www-misc\passenger\passenger-2.2.5.ebuild ><HTML><HEAD/><BODY><PRE># Copyright 1999-2009 Gentoo Foundation > ># Distributed under the terms of the GNU General Public License v2 > ># $Header: /var/cvsroot/gentoo-x86/dev-ruby/rails/rails-2.3.4.ebuild,v 1.6 2009/09/25 18:20:04 ranger Exp $ > > >inherit ruby gems > >USE_RUBY="ruby18 ruby19" > > >DESCRIPTION="Passenger gem for use with nginx or apache" > >HOMEPAGE="http://www.modrails.com" > > >LICENSE="MIT" > >KEYWORDS="amd64 ia64 ppc ppc64 sparc x86 ~x86-fbsd" > > >IUSE="nginx" > >DEPEND=">=dev-lang/ruby-1.8.6" > > >RDEPEND="${DEPEND} > > >=dev-ruby/rubygems-1.3.2" > > >src_install() { > > gems_src_install > > use nginx && > > pushd "${D}/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.5/ext/nginx" && > > rake nginx && > > popd > > >} > ></PRE></BODY></HTML>
bump, could something be done about this? having passenger depending on apache, while initially was needed/good has become almost redundant now that it has nginx support.
I've been using an install with Subhash's ebuilds for a few weeks now -- updated for nginx 0.7.64 and passenger 2.2.7 -- with fine results. Any chance these are going in the tree?
At this time I don't want to increase the maintenance load by pulling in more stuff from outside the distribution, so closing as WONTFIX.
There's LATER for that.
Sad to see passenger for nginx is not making it into the tree, since it's the only liable solution for scalable rails implementations in servers. One negative point to Gentoo, I guess.
Passenger + Nginx != only reliable solution to scale... Unicorn + Nginx works Thin + Monit/other + haproxy + Nginx works Passenger + Nginx is a "simple" and "automatic" (even then, might as well have idle thin instances or unicorn) scale out solution - it is not the "only" solution. I wont use Passenger until it has a "zero block" feature. When spooling up an instance other running instances still serve requests.
I didn't intend to flame on this issue. I just think that supporting Passenger for Nginx (besides Passenger for Apache) is a natural solution. About what I said regarding scalability, you are correct: Passenger for Nginx is the only *simple* scalable solution for Rails applications. There are others, of course. Is there any intent of officially supporting this?
(In reply to comment #20) > Is there any intent of officially supporting this? A useful first step might be to prepare it for the sunrise overlay - * http://www.gentoo.org/proj/en/sunrise/ * http://overlays.gentoo.org/proj/sunrise/wiki/HandyLinks The sunrise people would help anyone interested to get the ebuild up to QA standards; I won't have time for that at present, though. Anyone? -- Thomas
Hollow, as the a new nxinx maintainer, are you maybe interested in supporting this? If you need any help from the Ruby team, please feel free to contact us.
already supported with 0.8.34-r1