Forum: Ruby on Rails Rails on Resin

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Paul B. (Guest)
on 2006-01-14 20:00
(Received via mailing list)
Anyone figured out how to get rails/fastcgi to run on Resin.

I assume it would be similar to PHP, which there are directions here:

http://www.caucho.com/resin-3.0/thirdparty/php.xtp

One thing that confuses me is that it wants a server address:

<server-address>localhost:8002</server-address>

Apparently you start the php process, like this:

php -b 8002

And then the PHP process listens on that port.  Is that how you would do
it
with rails?  If so, what process do you start?
Adam D. (Guest)
on 2006-01-14 20:45
(Received via mailing list)
not entirely familiar with resin, but rails as an app server listens
on 3000 for requests.  This can be overridden with -p to
script/server..

i.e.,  script/server -p 8002 -e production

or something like that

adam
Philip R. (Guest)
on 2006-01-14 23:34
(Received via mailing list)
Paul B. wrote:
> Apparently you start the php process, like this:
>
> php -b 8002
>
> And then the PHP process listens on that port.  Is that how you would do
> it with rails?  If so, what process do you start?

The equivalent of the php command is probably:

script/spawner --port=8002 --instances=1

This will start a Rails FCGI server on port 8002. You'll need to have
lighttpd around to run this command though. The script uses the
spawn-fcgi command that is included with lighttpd.


Phil

--
Philip R.
http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby
Alex Y. (Guest)
on 2006-01-15 11:38
(Received via mailing list)
Adam D. wrote:
> not entirely familiar with resin, but rails as an app server listens
> on 3000 for requests.  This can be overridden with -p to
> script/server..
>
> i.e.,  script/server -p 8002 -e production
>
> or something like that

Not for FCGI, you don't.  There's no need to fire up WEBRick (the
process that listens on port 3000) or lighttpd in that case.  You want
the dispatch.fcgi script in the public/ directory of the app.  There is
an example parallel installation of FCGI PHP and rails on lighttpd here,
which may help:

http://textsnippets.com/posts/show/299
There's an example of configuring rails fcgi to listen on a port rather
than a socket here:
http://defendem.com/read/chapter/6

But I don't know how current that is...
Tom F. (Guest)
on 2006-01-16 08:04
(Received via mailing list)
Even if you get Resin to talk to your Rails app through FastCGI, from
looking at the Resin code, you are limited to a single FastCGI process
per
app, since Resin only takes a single host/port, and Rails only runs with
a
single process per port.

I think Resin's FastCGI support is designed for minimal use of
functionality
you can't get any other way, not for full scale app hosting.
Paul B. (Guest)
on 2006-01-21 16:39
(Received via mailing list)
Isn't that WEBrick that listens in port 3000?  I thought WEBrick was
only
for development?
Jarkko L. (Guest)
on 2006-01-21 16:40
(Received via mailing list)
On 14.1.2006, at 22.29, Paul B. wrote:

> Isn't that WEBrick that listens in port 3000?  I thought WEBrick
> was only for development?

Rails nowadays uses lighttpd if it's found on the system. However,
3000 is still the default port unless your lighty config file says
otherwise.

//jarkko
Paul B. (Guest)
on 2006-01-21 16:40
(Received via mailing list)
So in order to use FastCGI with Resin, you would have to use lighttpd as
well?
This topic is locked and can not be replied to.