Forum: Ruby on Rails fastcgi on apache

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.
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-01-06 06:07
(Received via mailing list)
Running on Fedora Core

I have been playing with some of the tutorials and one of them had me
install lighttpd and lighttpd-fastcgi and that was much faster than
apache seems to be.

How do I get fastcgi stuff to work on apache...

I have this setup for my tutorial environment in httpd.conf

<VirtualHost *>
  DocumentRoot /home/craig/cookbook/public
  ServerName cookbook
  <Directory "/home/craig/cookbook/public">
        Options ExecCGI FollowSymLinks
        AllowOverride all
        allow from all
  </Directory>
</VirtualHost>

and it's considerably slower than the lighttpd server.

Thanks

Craig
953c18019bceaa294ae0429bef6ab388?d=identicon&s=25 Norman Timmler (Guest)
on 2006-01-06 10:31
(Received via mailing list)
Am Donnerstag, den 05.01.2006, 22:06 -0700 schrieb Craig White:
> <VirtualHost *>
>   DocumentRoot /home/craig/cookbook/public
>   ServerName cookbook
>   <Directory "/home/craig/cookbook/public">
>         Options ExecCGI FollowSymLinks
>         AllowOverride all
>         allow from all
>   </Directory>
> </VirtualHost>
>
> and it's considerably slower than the lighttpd server.

It seems to me, that you are not starting any FCGI processes. I am
missing a line like this in your apache configuration:

FastCgiServer /var/www/myrailsapp/public/dispatch.fcgi -initial-env
RAILS_ENV=production -processes 3 -idle-timeout 60
866edcb271e88be4bfd935eea7947730?d=identicon&s=25 Bojan Mihelac (Guest)
on 2006-01-06 10:43
(Received via mailing list)
Norman Timmler wrote:
>> I have this setup for my tutorial environment in httpd.conf
>>
>> and it's considerably slower than the lighttpd server.
>>
>
> It seems to me, that you are not starting any FCGI processes. I am
> missing a line like this in your apache configuration:
>
> FastCgiServer /var/www/myrailsapp/public/dispatch.fcgi -initial-env
> RAILS_ENV=production -processes 3 -idle-timeout 60
>
>
In my Apache configuration these line is in <Directory> directive:
      AddHandler fastcgi-script .fcgi

And .htaccess from rails public directory is updated to use FCGI
dispatcher instead of CGI one:
    RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
953c18019bceaa294ae0429bef6ab388?d=identicon&s=25 Norman Timmler (Guest)
on 2006-01-06 11:14
(Received via mailing list)
Am Freitag, den 06.01.2006, 10:40 +0100 schrieb Bojan Mihelac:
> > >
> > > </VirtualHost>
> >
> In my Apache configuration these line is in <Directory> directive:
>       AddHandler fastcgi-script .fcgi
>
> And .htaccess from rails public directory is updated to use FCGI
> dispatcher instead of CGI one:
>     RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

Ok, i checked this: If you have no FastCgiServer directive, Apache
starts up a new FCGI processes every time all other FCGI processes are
busy. The first time you send a request to your application, the first
process is spawned. If my understanding is right, this could end in
uncountable FCGI processes if your server is under heavy load. So it is
better to control the process spawning with the FastCGIServer directive.

But this was not your question: If you set the your RewriteRule to
dispatch.fcgi you should run under FCGI. You can check if some processes
like

/usr/local/bin/ruby /var/www/myrailsapp/public/dispatch.fcgi

exist after requesting your application.

Maybe LightHttpd is faster, at all ;)
This topic is locked and can not be replied to.