Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 266446 - www-servers/nginx-0.6.36 supports passenger (USE flag request)
Summary: www-servers/nginx-0.6.36 supports passenger (USE flag request)
Status: RESOLVED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High enhancement with 1 vote (vote)
Assignee: Konstantin Arkhipov (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-16 22:58 UTC by David Smalley
Modified: 2010-03-07 10:51 UTC (History)
12 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Initial ebuild to add 'passenger' USE flag for nginx-0.6.36 (nginx-0.6.36.ebuild,2.99 KB, text/plain)
2009-04-25 16:15 UTC, Thomas Nichols
Details
Simplistic patch to add passenger support (enable-passenger-with-sandbox.patch,962 bytes, patch)
2009-08-04 15:43 UTC, Thomas Nichols
Details | Diff
www-misc\passenger\passenger-2.2.5.ebuild (passenger-2.2.5.ebuild,740 bytes, text/plain)
2009-10-02 14:44 UTC, Subhash Chandra
Details
patch for nginx to add support for passenger (nginx.ebuild.patch,1.16 KB, patch)
2009-10-02 14:49 UTC, Subhash Chandra
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Smalley 2009-04-16 22:58:45 UTC
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/
Comment 1 Thomas Nichols 2009-04-25 16:15:19 UTC
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
Comment 2 Ed Wildgoose 2009-04-27 10:15:52 UTC
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...)
Comment 3 Thomas Nichols 2009-04-27 11:38:30 UTC
(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...)
> 

Comment 4 Tim O'Kelly 2009-05-22 21:22:51 UTC
What about passenger support in nginx 0.7.x ?
Comment 5 Thomas Nichols 2009-05-23 10:47:37 UTC
(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



Comment 6 Tim O'Kelly 2009-06-23 16:10:08 UTC
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...
Comment 7 Nicholas Orr 2009-06-27 10:06:17 UTC
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 :)
Comment 8 Hans de Graaff gentoo-dev Security 2009-07-04 07:59:09 UTC
(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.
Comment 9 Thomas Nichols 2009-08-04 15:43:55 UTC
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.
Comment 10 Subhash Chandra 2009-10-02 14:44:26 UTC
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.
Comment 11 Subhash Chandra 2009-10-02 14:49:31 UTC
Created attachment 205847 [details, diff]
patch for nginx to add support for passenger

to be used with the passenger ebuild
Comment 12 Subhash Chandra 2009-10-14 07:07:14 UTC
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="&gt;=dev-lang/ruby-1.8.6"
>

>
>RDEPEND="${DEPEND}
>
>	&gt;=dev-ruby/rubygems-1.3.2"
>

>
>src_install() {
>
>	gems_src_install
>
>	use nginx &amp;&amp;
>
>	    pushd "${D}/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.5/ext/nginx" &amp;&amp;
>
>	    rake nginx &amp;&amp;
>
>		popd
>

>
>}
>
></PRE></BODY></HTML>
Comment 13 Subhash Chandra 2009-10-14 07:08:00 UTC
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="&gt;=dev-lang/ruby-1.8.6"
>

>
>RDEPEND="${DEPEND}
>
>	&gt;=dev-ruby/rubygems-1.3.2"
>

>
>src_install() {
>
>	gems_src_install
>
>	use nginx &amp;&amp;
>
>	    pushd "${D}/usr/lib64/ruby/gems/1.8/gems/passenger-2.2.5/ext/nginx" &amp;&amp;
>
>	    rake nginx &amp;&amp;
>
>		popd
>

>
>}
>
></PRE></BODY></HTML>
Comment 14 jon R-B 2009-10-15 09:06:45 UTC
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.

Comment 15 Jeremy Wohl 2009-12-05 04:28:00 UTC
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?
Comment 16 Dirkjan Ochtman (RETIRED) gentoo-dev 2010-01-03 21:02:17 UTC
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.
Comment 17 Alex Legler (RETIRED) archtester gentoo-dev Security 2010-01-03 21:04:31 UTC
There's LATER for that.
Comment 18 Gonçalo Silva 2010-01-03 23:37:07 UTC
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.
Comment 19 Nicholas Orr 2010-01-04 02:04:22 UTC
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.
Comment 20 Gonçalo Silva 2010-02-23 12:05:27 UTC
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?
Comment 21 Thomas Nichols 2010-02-24 22:51:20 UTC
(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
Comment 22 Alex Legler (RETIRED) archtester gentoo-dev Security 2010-03-07 10:19:50 UTC
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.

Comment 23 Benedikt Böhm (RETIRED) gentoo-dev 2010-03-07 10:51:45 UTC
already supported with 0.8.34-r1