[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Apache2, FastCGI and Rails on Windows

Williams, Chris

12/14/2004 6:16:00 PM

I've been running around in circles trying to enable FastCGI on my rails
install.

I've modified my http.conf to load the fastcgi module and add it as the
handler for .fcgi
I've modified my .htaccess to redirect to dispatch.fcgi, and that is
working.

What happens is that Rails throws back the 500 page with an error, and
Apache's error log show's the following:

[Tue Dec 14 12:56:09 2004] [warn] FastCGI: (dynamic) server
"C:/epc/blog/public/dispatch.fcgi" started (pid 1636)
[Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] (OS 109)The pipe
has been ended. : FastCGI: comm with server
"C:/epc/blog/public/dispatch.fcgi" aborted: GetOverlappedResult() failed
[Tue Dec 14 12:56:11 2004] [warn] FastCGI: (dynamic) server
"C:/epc/blog/public/dispatch.fcgi" (pid 1636) terminated with exit with
status '1'
[Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] FastCGI:
incomplete headers (0 bytes) received from server
"C:/epc/blog/public/dispatch.fcgi"
[Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] File does not
exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico
[Tue Dec 14 12:56:14 2004] [warn] FastCGI: (dynamic) server
"C:/epc/blog/public/dispatch.fcgi" restarted (pid 2472)
[Tue Dec 14 12:56:16 2004] [warn] FastCGI: (dynamic) server
"C:/epc/blog/public/dispatch.fcgi" (pid 2472) terminated with exit with
status '1'
[Tue Dec 14 12:56:19 2004] [warn] FastCGI: (dynamic) server
"C:/epc/blog/public/dispatch.fcgi" restarted (pid 3652)
[Tue Dec 14 12:56:20 2004] [warn] FastCGI: (dynamic) server
"C:/epc/blog/public/dispatch.fcgi" (pid 3652) terminated with exit with
status '1'
[Tue Dec 14 12:56:24 2004] [warn] FastCGI: (dynamic) server
"C:/epc/blog/public/dispatch.fcgi" restarted (pid 2120)
[Tue Dec 14 12:56:26 2004] [warn] FastCGI: (dynamic) server
"C:/epc/blog/public/dispatch.fcgi" (pid 2120) terminated with exit with
status '1'
[Tue Dec 14 12:56:26 2004] [warn] FastCGI: (dynamic) server
"C:/epc/blog/public/dispatch.fcgi" has failed to remain running for 30
seconds given 3 attempts, its restart interval has been backed off to
600 seconds

It seems to be unable to communicate over the default pipe. Has anyone
managed to get this working? What am I doing wrong?

Thanks,
Chris
23 Answers

Sarah Tanembaum

12/14/2004 8:54:00 PM

0

Williams, Chris wrote:
> I've been running around in circles trying to enable FastCGI on my rails
> install.
>
> I've modified my http.conf to load the fastcgi module and add it as the
> handler for .fcgi
> I've modified my .htaccess to redirect to dispatch.fcgi, and that is
> working.
>
> What happens is that Rails throws back the 500 page with an error, and
> Apache's error log show's the following:
>
> [Tue Dec 14 12:56:09 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" started (pid 1636)
> [Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] (OS 109)The pipe
> has been ended. : FastCGI: comm with server
> "C:/epc/blog/public/dispatch.fcgi" aborted: GetOverlappedResult() failed
> [Tue Dec 14 12:56:11 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" (pid 1636) terminated with exit with
> status '1'
> [Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] FastCGI:
> incomplete headers (0 bytes) received from server
> "C:/epc/blog/public/dispatch.fcgi"
> [Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] File does not
> exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico
> [Tue Dec 14 12:56:14 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" restarted (pid 2472)
> [Tue Dec 14 12:56:16 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" (pid 2472) terminated with exit with
> status '1'
> [Tue Dec 14 12:56:19 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" restarted (pid 3652)
> [Tue Dec 14 12:56:20 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" (pid 3652) terminated with exit with
> status '1'
> [Tue Dec 14 12:56:24 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" restarted (pid 2120)
> [Tue Dec 14 12:56:26 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" (pid 2120) terminated with exit with
> status '1'
> [Tue Dec 14 12:56:26 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" has failed to remain running for 30
> seconds given 3 attempts, its restart interval has been backed off to
> 600 seconds
>
> It seems to be unable to communicate over the default pipe. Has anyone
> managed to get this working? What am I doing wrong?
>
> Thanks,
> Chris
>
I went thru all with no luck. I don't think Windows implementation other
than the Ruby core(thanks Matz) is any good, at best it will get you
frustrated. Prior to that I've tried to get Apache2, mod_ruby/eruby to
work, but no luck.

I don't think that they care so much for Windows users. Perhaps anyone
can prove me wrong.

Kent Sibilev

12/14/2004 8:55:00 PM

0

I'm running my rails application on the same environment and it works
fine. Make sure your application doesn't raise any exceptions and dies
killing the communication pipe.

Cheers,
Kent.
On Dec 14, 2004, at 1:16 PM, Williams, Chris wrote:

> I've been running around in circles trying to enable FastCGI on my
> rails
> install.
>
> I've modified my http.conf to load the fastcgi module and add it as the
> handler for .fcgi
> I've modified my .htaccess to redirect to dispatch.fcgi, and that is
> working.
>
> What happens is that Rails throws back the 500 page with an error, and
> Apache's error log show's the following:
>
> [Tue Dec 14 12:56:09 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" started (pid 1636)
> [Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] (OS 109)The pipe
> has been ended. : FastCGI: comm with server
> "C:/epc/blog/public/dispatch.fcgi" aborted: GetOverlappedResult()
> failed
> [Tue Dec 14 12:56:11 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" (pid 1636) terminated with exit with
> status '1'
> [Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] FastCGI:
> incomplete headers (0 bytes) received from server
> "C:/epc/blog/public/dispatch.fcgi"
> [Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] File does not
> exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico
> [Tue Dec 14 12:56:14 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" restarted (pid 2472)
> [Tue Dec 14 12:56:16 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" (pid 2472) terminated with exit with
> status '1'
> [Tue Dec 14 12:56:19 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" restarted (pid 3652)
> [Tue Dec 14 12:56:20 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" (pid 3652) terminated with exit with
> status '1'
> [Tue Dec 14 12:56:24 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" restarted (pid 2120)
> [Tue Dec 14 12:56:26 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" (pid 2120) terminated with exit with
> status '1'
> [Tue Dec 14 12:56:26 2004] [warn] FastCGI: (dynamic) server
> "C:/epc/blog/public/dispatch.fcgi" has failed to remain running for 30
> seconds given 3 attempts, its restart interval has been backed off to
> 600 seconds
>
> It seems to be unable to communicate over the default pipe. Has anyone
> managed to get this working? What am I doing wrong?
>
> Thanks,
> Chris



Kent Sibilev

12/14/2004 10:08:00 PM

0

I agree that it doesn't make too much sense to use Apache2 + mod_ruby
on Windows, simply because Ruby doesn't support native threads. You
still can configure it, but all your requests will be queued to the
single Ruby interpreter. But you can configure Apache2 + mod_fastcgi on
Windows and run as many ruby processes as you want.

Check out http://rubyforge.org/projects/rub...

Cheers,
Kent.
On Dec 14, 2004, at 3:57 PM, Sarah Tanembaum wrote:

> I went thru all with no luck. I don't think Windows implementation
> other than the Ruby core(thanks Matz) is any good, at best it will get
> you frustrated. Prior to that I've tried to get Apache2,
> mod_ruby/eruby to work, but no luck.
>
> I don't think that they care so much for Windows users. Perhaps anyone
> can prove me wrong.
>



Sarah Tanembaum

12/16/2004 6:44:00 PM

0

Kent Sibilev wrote:
> I'm running my rails application on the same environment and it works
> fine. Make sure your application doesn't raise any exceptions and dies
> killing the communication pipe.
>
> Cheers,
> Kent.
> On Dec 14, 2004, at 1:16 PM, Williams, Chris wrote:
>
>> I've been running around in circles trying to enable FastCGI on my rails
>> install.
>>
>> I've modified my http.conf to load the fastcgi module and add it as the
>> handler for .fcgi
>> I've modified my .htaccess to redirect to dispatch.fcgi, and that is
>> working.
>>
>> What happens is that Rails throws back the 500 page with an error, and
>> Apache's error log show's the following:
>>
>> [Tue Dec 14 12:56:09 2004] [warn] FastCGI: (dynamic) server
>> "C:/epc/blog/public/dispatch.fcgi" started (pid 1636)
>> [Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] (OS 109)The pipe
>> has been ended. : FastCGI: comm with server
>> "C:/epc/blog/public/dispatch.fcgi" aborted: GetOverlappedResult() failed
>> [Tue Dec 14 12:56:11 2004] [warn] FastCGI: (dynamic) server
>> "C:/epc/blog/public/dispatch.fcgi" (pid 1636) terminated with exit with
>> status '1'
>> [Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] FastCGI:
>> incomplete headers (0 bytes) received from server
>> "C:/epc/blog/public/dispatch.fcgi"
>> [Tue Dec 14 12:56:11 2004] [error] [client 127.0.0.1] File does not
>> exist: C:/Program Files/Apache Group/Apache2/htdocs/favicon.ico
>> [Tue Dec 14 12:56:14 2004] [warn] FastCGI: (dynamic) server
>> "C:/epc/blog/public/dispatch.fcgi" restarted (pid 2472)
>> [Tue Dec 14 12:56:16 2004] [warn] FastCGI: (dynamic) server
>> "C:/epc/blog/public/dispatch.fcgi" (pid 2472) terminated with exit with
>> status '1'
>> [Tue Dec 14 12:56:19 2004] [warn] FastCGI: (dynamic) server
>> "C:/epc/blog/public/dispatch.fcgi" restarted (pid 3652)
>> [Tue Dec 14 12:56:20 2004] [warn] FastCGI: (dynamic) server
>> "C:/epc/blog/public/dispatch.fcgi" (pid 3652) terminated with exit with
>> status '1'
>> [Tue Dec 14 12:56:24 2004] [warn] FastCGI: (dynamic) server
>> "C:/epc/blog/public/dispatch.fcgi" restarted (pid 2120)
>> [Tue Dec 14 12:56:26 2004] [warn] FastCGI: (dynamic) server
>> "C:/epc/blog/public/dispatch.fcgi" (pid 2120) terminated with exit with
>> status '1'
>> [Tue Dec 14 12:56:26 2004] [warn] FastCGI: (dynamic) server
>> "C:/epc/blog/public/dispatch.fcgi" has failed to remain running for 30
>> seconds given 3 attempts, its restart interval has been backed off to
>> 600 seconds
>>
>> It seems to be unable to communicate over the default pipe. Has anyone
>> managed to get this working? What am I doing wrong?
>>
>> Thanks,
>> Chris
>
>
>
>
How do you test if fastcgi is working? I know that the apache loaded the
fastcgi modules correctly. Now, how do you configure fastcgi in
Apache2 so it will work with ruby. Using just standard cgi, I can run
ruby.cgi with no probs, except the startup time a bit longer than usual.

Thanks.

Kent Sibilev

12/16/2004 7:42:00 PM

0

Oh, This is quite easy. I assume you have Ruby and RubyForApache
installed.

1. Edit Apache's httpd.conf file by adding the following:

LoadModule fastcgi_module modules/mod_fastcgi.so

<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>

2. Create test.fcgi file in (for example) c:\Program Files\Apache
Group\Apache2\cgi-bin directory with this content:

#!c:\ruby\bin\rubyw.exe
require 'fcgi'
counter = 0
FCGI.each_cgi('html3') do |cgi|
counter += 1
cgi.out {
cgi.html {
cgi.body {
cgi.h1 { "Hello World!" } +
cgi.p { "Counter: #{counter}" }
}
}
}
end

3. Hit http://localhost/cgi-bin/test.fcgi

Cheers,
Kent.

On Dec 16, 2004, at 1:47 PM, Sarah Tanembaum wrote:

> How do you test if fastcgi is working? I know that the apache loaded
> the fastcgi modules correctly. Now, how do you configure fastcgi in
> Apache2 so it will work with ruby. Using just standard cgi, I can run
> ruby.cgi with no probs, except the startup time a bit longer than
> usual.
>
> Thanks.
>



Joao Pedrosa

12/16/2004 8:32:00 PM

0

Hi,

Kent, you have been very helpful for us Windows users by putting
together mod_ruby and fastcgi in an easy to install package. Thank you
very much for that. It's like a dream coming true (ok Ruby web support
on Windows.)

Thank you. I hope you can keep it going until the community pick it up. :-)

Cheers,
Joao

On Fri, 17 Dec 2004 04:42:11 +0900, Kent Sibilev <ksibilev@bellsouth.net> wrote:
> Oh, This is quite easy. I assume you have Ruby and RubyForApache
> installed.
>
> 1. Edit Apache's httpd.conf file by adding the following:
>
> LoadModule fastcgi_module modules/mod_fastcgi.so
>
> <IfModule mod_fastcgi.c>
> AddHandler fastcgi-script .fcgi
> </IfModule>
>
> 2. Create test.fcgi file in (for example) c:\Program Files\Apache
> Group\Apache2\cgi-bin directory with this content:
>
> #!c:\ruby\bin\rubyw.exe
> require 'fcgi'
> counter = 0
> FCGI.each_cgi('html3') do |cgi|
> counter += 1
> cgi.out {
> cgi.html {
> cgi.body {
> cgi.h1 { "Hello World!" } +
> cgi.p { "Counter: #{counter}" }
> }
> }
> }
> end
>
> 3. Hit http://localhost/cgi-bin/test.fcgi
>
> Cheers,
> Kent.
>
> On Dec 16, 2004, at 1:47 PM, Sarah Tanembaum wrote:
>
> > How do you test if fastcgi is working? I know that the apache loaded
> > the fastcgi modules correctly. Now, how do you configure fastcgi in
> > Apache2 so it will work with ruby. Using just standard cgi, I can run
> > ruby.cgi with no probs, except the startup time a bit longer than
> > usual.
> >
> > Thanks.
> >
>
>


gabriele renzi

12/16/2004 8:43:00 PM

0

Joao Pedrosa ha scritto:
> Hi,
>
> Kent, you have been very helpful for us Windows users by putting
> together mod_ruby and fastcgi in an easy to install package. Thank you
> very much for that. It's like a dream coming true (ok Ruby web support
> on Windows.)
>
> Thank you. I hope you can keep it going until the community pick it up. :-)
>
> Cheers,
> Joao

+1, and I actually got it even before you announced it :)
btw, I wonder if you could provide some bigger installer with lots of
ggodies (i.e. sqlite, apache itself..)
But maybe that would be a band hog for rubyforge :/

Curt Hibbs

12/16/2004 9:38:00 PM

0

gabriele renzi wrote:
>
> Joao Pedrosa ha scritto:
> > Hi,
> >
> > Kent, you have been very helpful for us Windows users by putting
> > together mod_ruby and fastcgi in an easy to install package. Thank you
> > very much for that. It's like a dream coming true (ok Ruby web support
> > on Windows.)
> >
> > Thank you. I hope you can keep it going until the community
> pick it up. :-)
> >
> > Cheers,
> > Joao
>
> +1, and I actually got it even before you announced it :)
> btw, I wonder if you could provide some bigger installer with lots of
> ggodies (i.e. sqlite, apache itself..)
> But maybe that would be a band hog for rubyforge :/

Darn it, I wanted to keep this quiet for a while, but this is forcing my
hand... :-(

I've been planning a One-Click Ruby Server as a server-side complement to
the One-Click Ruby Installer, that would be precisely what you are asking
for. I've privately asked Kent to join forces on this (although, that was so
recent that he could see this posting first). Don't know if he's interested,
but we'll see.

In the meantime, if anyone wants to send me suggestions on what they would
like to see included, please send me a private email with "One-Click Ruby
Server" in the subject (to avoid my spam filters -- send to curt at hibbs
dot com.

Thanks,
Curt



gabriele renzi

12/16/2004 9:51:00 PM

0

Curt Hibbs ha scritto:

>>+1, and I actually got it even before you announced it :)
>>btw, I wonder if you could provide some bigger installer with lots of
>>ggodies (i.e. sqlite, apache itself..)
>>But maybe that would be a band hog for rubyforge :/
>
>
> Darn it, I wanted to keep this quiet for a while, but this is forcing my
> hand... :-(

sorry for spoiling :/

> I've been planning a One-Click Ruby Server as a server-side complement to
> the One-Click Ruby Installer, that would be precisely what you are asking
> for. I've privately asked Kent to join forces on this (although, that was so
> recent that he could see this posting first). Don't know if he's interested,
> but we'll see.
>
> In the meantime, if anyone wants to send me suggestions on what they would
> like to see included, please send me a private email with "One-Click Ruby
> Server" in the subject (to avoid my spam filters -- send to curt at hibbs
> dot com.
>

I'm starting to feel guilty looking at you handling so many projects,
time to say thanks for everything :)

Kent Sibilev

12/16/2004 11:45:00 PM

0

I'm really sorry about that. I didn't know about your plans. The main
reason I started this project was that my two colleges are 'hopeless'
Windows users and they always complained about their inability to run
our applications on their laptops. But I agree this kind of project
needs some further development and I would gladly join the forces.

Cheers,
Kent.
On Dec 16, 2004, at 4:37 PM, Curt Hibbs wrote:

> Darn it, I wanted to keep this quiet for a while, but this is forcing
> my
> hand... :-(
>
> I've been planning a One-Click Ruby Server as a server-side complement
> to
> the One-Click Ruby Installer, that would be precisely what you are
> asking
> for. I've privately asked Kent to join forces on this (although, that
> was so
> recent that he could see this posting first). Don't know if he's
> interested,
> but we'll see.
>
> In the meantime, if anyone wants to send me suggestions on what they
> would
> like to see included, please send me a private email with "One-Click
> Ruby
> Server" in the subject (to avoid my spam filters -- send to curt at
> hibbs
> dot com.
>
> Thanks,
> Curt
>
>