Apache2, FastCGI and Rails on Windows

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'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

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.

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/rubyforapache

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.

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.

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.

···

On Dec 14, 2004, at 1:16 PM, Williams, Chris 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.

Kent Sibilev wrote:

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/rubyforapache

Cheers,
Kent.

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, you are an angel and thanks for your fine contribution.
I've search and tried many different method to get mod_ruby and fcgi to work for quite a while, and for the first time, I can get it to work with many of fcgi sample scripts(that was never work before, but now they do) including yours as well.

Thanks again and now I can actually start learning Programing Ruby for the Web.

Sarah

···

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

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. :slight_smile:

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.
>

Kent Sibilev 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.

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.

May be I did something wrong. I have not been able to run fcgi, and yes, I did try your sample script. So, I test using 'irb' if there are error ...

% irb
LoadError: No such file to load -- fcgi
from c:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require__'
from c:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require' from (irb):1
irb(main):002:0>

Any idea?

Sarah

···

On Dec 16, 2004, at 1:47 PM, Sarah Tanembaum 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. :slight_smile:

Cheers,
Joao

+1, and I actually got it even before you announced it :slight_smile:
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 :confused:

Hi,

Kent Sibilev 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.
>
>
>> 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.
>>
>
>
>
May be I did something wrong. I have not been able to run fcgi, and yes,
I did try your sample script. So, I test using 'irb' if there are error ...

% irb
LoadError: No such file to load -- fcgi
from
c:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in
`require__'
from
c:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in
`require' from (irb):1
irb(main):002:0>

Any idea?

Sarah

Please confirm that the files are where they are supposed to be. For
comparision, I'm providing the locations of the files on my system:
C:\desenvolvimento\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt\fcgi.so
C:\Arquivos de programas\Apache Group\Apache2\modules\mod_fastcgi.so

My httpd.conf has this:

LoadModule fastcgi_module modules/mod_fastcgi.so

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

LoadModule ruby_module modules/mod_ruby.so

<IfModule mod_ruby.c>
# for Apache::RubyRun
RubyRequire apache/ruby-run

# exec files under /ruby as ruby scripts.
<Location /ruby>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
Options +ExecCGI
</Location>

# exec *.rbx as ruby scripts.
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
</IfModule>

And finally, my sample scripts:
C:\Arquivos de programas\Apache Group\Apache2\cgi-bin\hm.fcgi

#!C:/desenvolvimento/ruby/bin/ruby.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

And:
C:\Arquivos de programas\Apache Group\Apache2\htdocs\ruby\hw.rbx
require "cgi"

cgi = CGI.new
print cgi.header("type"=>"text/plain")
print "hello world"

I have been able to setup rails using fastcgi on Windows, thanks to Kent. :slight_smile:

Cheers,
Joao

···

On Fri, 17 Dec 2004 23:07:12 +0900, Sarah Tanembaum <sarahtanembaum@yahoo.com> wrote:

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

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. :slight_smile:
>
> Cheers,
> Joao

+1, and I actually got it even before you announced it :slight_smile:
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 :confused:

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

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

Joao Pedrosa wrote:

Hi,

Kent Sibilev 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.

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.

May be I did something wrong. I have not been able to run fcgi, and yes,
I did try your sample script. So, I test using 'irb' if there are error ...

% irb
LoadError: No such file to load -- fcgi
from
c:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in
`require__'
from
c:/apps/ruby/ruby-1.8/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in
`require' from (irb):1
irb(main):002:0>

Any idea?

Sarah

Please confirm that the files are where they are supposed to be. For
comparision, I'm providing the locations of the files on my system:
C:\desenvolvimento\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt\fcgi.so
C:\Arquivos de programas\Apache Group\Apache2\modules\mod_fastcgi.so

My httpd.conf has this:

LoadModule fastcgi_module modules/mod_fastcgi.so

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

LoadModule ruby_module modules/mod_ruby.so

<IfModule mod_ruby.c>
# for Apache::RubyRun
RubyRequire apache/ruby-run

# exec files under /ruby as ruby scripts.
<Location /ruby>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
Options +ExecCGI </Location>

# exec *.rbx as ruby scripts.
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
</IfModule>

And finally, my sample scripts:
C:\Arquivos de programas\Apache Group\Apache2\cgi-bin\hm.fcgi

#!C:/desenvolvimento/ruby/bin/ruby.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

And:
C:\Arquivos de programas\Apache Group\Apache2\htdocs\ruby\hw.rbx
require "cgi"

cgi = CGI.new
print cgi.header("type"=>"text/plain")
print "hello world"

I have been able to setup rails using fastcgi on Windows, thanks to Kent. :slight_smile:

Cheers,
Joao

Hi Joao, thanks for walking me thru. You are right, I have no fcgi.o in the path you specified. Where can I download fcgi.o for mswin32?

Thanks a bunch

Sarah

···

On Fri, 17 Dec 2004 23:07:12 +0900, Sarah Tanembaum > <sarahtanembaum@yahoo.com> wrote:

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

Curt Hibbs ha scritto:

+1, and I actually got it even before you announced it :slight_smile:
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 :confused:

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

sorry for spoiling :confused:

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 :slight_smile:

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... :frowning:

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

Hi,

Hi Joao, thanks for walking me thru. You are right, I have no fcgi.o in
the path you specified. Where can I download fcgi.o for mswin32?

Thanks a bunch

Sarah

You can download the package by Kent at:
http://rubyforge.org/frs/download.php/2183/RubyForApache-beta1.exe

It will install the files for you, as long as you provide the
installer with the correct paths. At least for me, the installer
sometimes added an extra /RubyForApache at the wrong time, so if I
just clicked to install the files there they would get installed in
the wrong directory. So you have to be careful to correct the
installer when needed.

You will need to provide 3 paths for it. One will be the apache
directory, another will be the Ruby directory, and the last will be a
RubyForApache directory. I'm not sure about the order in which they
will be asked, just make sure they are correct. So in my system they
would be:

1) C:\Arquivos de programas\Apache Group\Apache2

2) C:\desenvolvimento\ruby

3) C:\desenvolvimento\ruby\RubyForApache

Make the necessary adjustments for you system and you should get it
installed correctly. :slight_smile:

Cheers,
Joao

Kent Sibilev tp:

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.

Excellent! We can discuss how to get this rolling off-list.

Curt

···

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... :frowning:
>
> 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
>
>

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.805 / Virus Database: 547 - Release Date: 12/3/2004

gabriele renzi wrote:

Curt Hibbs ha scritto:

>>+1, and I actually got it even before you announced it :slight_smile:
>>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 :confused:
>
>
> Darn it, I wanted to keep this quiet for a while, but this is forcing my
> hand... :frowning:

sorry for spoiling :confused:

> 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 :slight_smile:

Your welcome... and thanks for the vote of confidence!

Curt

PS
   Please *do* let me know what you think should be included in a one-click
ruby server.

Joao Pedrosa wrote:

Hi,

Hi Joao, thanks for walking me thru. You are right, I have no fcgi.o in
the path you specified. Where can I download fcgi.o for mswin32?

Thanks a bunch

Sarah

You can download the package by Kent at:
http://rubyforge.org/frs/download.php/2183/RubyForApache-beta1.exe

It will install the files for you, as long as you provide the
installer with the correct paths. At least for me, the installer
sometimes added an extra /RubyForApache at the wrong time, so if I
just clicked to install the files there they would get installed in
the wrong directory. So you have to be careful to correct the
installer when needed.

You will need to provide 3 paths for it. One will be the apache
directory, another will be the Ruby directory, and the last will be a
RubyForApache directory. I'm not sure about the order in which they
will be asked, just make sure they are correct. So in my system they
would be:

1) C:\Arquivos de programas\Apache Group\Apache2

2) C:\desenvolvimento\ruby

3) C:\desenvolvimento\ruby\RubyForApache

Make the necessary adjustments for you system and you should get it
installed correctly. :slight_smile:

Cheers,
Joao

Thanks for sharing your experience with me, now I can run Ruby fcgi/fastcgi and mod_ruby on Windows for the first time. Thanks.

All the software you need and dead-simple instructions for getting it
working :slight_smile: Plus a bunch of links telling me why I should _care_ about
Apache2, etc. (I already know about FastCGI and Rails, but I guess
they should get the same treatment.)

Gavin

···

On Friday, December 17, 2004, 2:43:17 PM, Curt wrote:

   Please *do* let me know what you think should be included in a one-click
ruby server.