rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / Atom feed
* Configuring rack based on lighttpd for ruby app.
@ 2011-09-02  8:35 coolesting
  2011-09-05  2:27 ` Joshua Ballanco
  0 siblings, 1 reply; 2+ messages in thread
From: coolesting @ 2011-09-02  8:35 UTC (permalink / raw)
  To: Rack Development

Hi, guys,

My version is ruby 1.9.2, rack 1.2.3, and web server is lighttpd that
is very strange to me how to configure.

I according to this post { http://devcenter.heroku.com/articles/rack }
to create a  pure ruby web application based on rack , and then use
the command 'rackup' to start the web application that is success.

Here is problem, i want to use the lighttpd to start this project.
Now, how do i configure this rack application.

My project directory like this :
(root directory) -- /var/www/htdocs/ruby_app/
config.ru
Gemfile
Gemfile.lock
README
public
tmp

The public and tmp is empty, other is file,
the config.ru code as the following :
run lambda { |env| [200, {'Content-Type'=>'text/plain'},
StringIO.new("Hello Ruby APP!\n")] }

this code is successful to run based on rakeup command in terminal,

and the fastcgi configuration file as the following:
$HTTP["host"] == "localhost" {
        server.document-root  = server_root + "/ruby_app"
        server.error-handler-404 = server_root + "/ruby_app/public/
404.html"
        fastcgi.server = ( ".ru" =>
                ((
                "host" => "127.0.0.1",
                "port" => 4000,
                "bin-path" => server_root + "/ruby_app/config.ru",
                "check-local" => "disable",
                "max-procs" => 1
                ))
        )
}

So, i got this error message as the following:
2011-09-02 01:30:15: (log.c.166) server started
2011-09-02 01:30:15: (mod_fastcgi.c.1103) the fastcgi-backend /var/www/
ruby_app/config.ru failed to start:
2011-09-02 01:30:15: (mod_fastcgi.c.1107) child exited with status 2 /
var/www/ruby_app/config.ru
2011-09-02 01:30:15: (mod_fastcgi.c.1110) If you're trying to run your
app as a FastCGI backend, make sure you're using the FastCGI-enabled
version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2011-09-02 01:30:15: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi
failed.
2011-09-02 01:30:15: (server.c.945) Configuration of plugins failed.
Going down.


Thanks in advance, i very very need the helps.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Configuring rack based on lighttpd for ruby app.
  2011-09-02  8:35 Configuring rack based on lighttpd for ruby app coolesting
@ 2011-09-05  2:27 ` Joshua Ballanco
  0 siblings, 0 replies; 2+ messages in thread
From: Joshua Ballanco @ 2011-09-05  2:27 UTC (permalink / raw)
  To: rack-devel

[-- Attachment #1: Type: text/plain, Size: 2405 bytes --]

You have your config.ru set as your binary to execute via FastCGI. Are you
sure that's what you want? Do you have a shebang in the config.ru? Have you
set the executable bit?

On Fri, Sep 2, 2011 at 4:35 AM, coolesting <coolesting@gmail.com> wrote:

> Hi, guys,
>
> My version is ruby 1.9.2, rack 1.2.3, and web server is lighttpd that
> is very strange to me how to configure.
>
> I according to this post { http://devcenter.heroku.com/articles/rack }
> to create a  pure ruby web application based on rack , and then use
> the command 'rackup' to start the web application that is success.
>
> Here is problem, i want to use the lighttpd to start this project.
> Now, how do i configure this rack application.
>
> My project directory like this :
> (root directory) -- /var/www/htdocs/ruby_app/
> config.ru
> Gemfile
> Gemfile.lock
> README
> public
> tmp
>
> The public and tmp is empty, other is file,
> the config.ru code as the following :
> run lambda { |env| [200, {'Content-Type'=>'text/plain'},
> StringIO.new("Hello Ruby APP!\n")] }
>
> this code is successful to run based on rakeup command in terminal,
>
> and the fastcgi configuration file as the following:
> $HTTP["host"] == "localhost" {
>        server.document-root  = server_root + "/ruby_app"
>        server.error-handler-404 = server_root + "/ruby_app/public/
> 404.html"
>        fastcgi.server = ( ".ru" =>
>                ((
>                "host" => "127.0.0.1",
>                "port" => 4000,
>                "bin-path" => server_root + "/ruby_app/config.ru",
>                "check-local" => "disable",
>                "max-procs" => 1
>                ))
>        )
> }
>
> So, i got this error message as the following:
> 2011-09-02 01:30:15: (log.c.166) server started
> 2011-09-02 01:30:15: (mod_fastcgi.c.1103) the fastcgi-backend /var/www/
> ruby_app/config.ru failed to start:
> 2011-09-02 01:30:15: (mod_fastcgi.c.1107) child exited with status 2 /
> var/www/ruby_app/config.ru
> 2011-09-02 01:30:15: (mod_fastcgi.c.1110) If you're trying to run your
> app as a FastCGI backend, make sure you're using the FastCGI-enabled
> version.
> If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
> 2011-09-02 01:30:15: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi
> failed.
> 2011-09-02 01:30:15: (server.c.945) Configuration of plugins failed.
> Going down.
>
>
> Thanks in advance, i very very need the helps.
>

[-- Attachment #2: Type: text/html, Size: 3491 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-05  2:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-02  8:35 Configuring rack based on lighttpd for ruby app coolesting
2011-09-05  2:27 ` Joshua Ballanco

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/rack.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).