Well I''ve been warned getting a Rails app running off of FastCGI on Apache would be frustrating, but I seem to be very close to accomplishing this feat except for this last hangup. I installed mod_fastcgi, the fastcgi-devel and the fcgi gem on my Fedora Core 3 box. So far so good. I added the LoadModule fastcgi_module modules/mod_fastcgi.so lin to my httpd.conf as well as the <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc/ AddHandler fastcgi-script .fcgi </IfModule> block. The I restarted apache and got the ''FastCGI: process manager initialized (pid #)'' line in the error_log, which I read means that FastCGI is running correctly. Now I''m ready to fire up a Rails app - 1. I add a line ''FastCgiServer /data/wwwroot/uploadtest.lan/public/ dispatch.fcgi -idle-timeout 10 -initial-env RAILS_ENV=production - processes 5'' into the <IfModule mod_fastcgi.c> block above. 2. I create a virtual server pointing to /data/wwwroot/uploadtest.lan/ public/dispatch.fcgi 3. I changed the top of public/dispatch.fcgi to ''#!/usr/bin/ ruby'' (this is where my ruby exec is) 4. Just to make sure I wouldn''t have permissions problems I chmod''d the whole /data/wwwroot/uploadtest.lan directory to 777. 5. I restart... And the app times out with the ''Rails application failed to start properly'' message. Here is my error_log - any, any help at all would be greatly appreciated. Thanks in advance. [Wed Sep 21 15:41:14 2005] [notice] FastCGI: process manager initialized (pid 19823) [Wed Sep 21 15:41:14 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" started (pid 19824) [Wed Sep 21 15:41:14 2005] [notice] Apache/2.0.53 (Unix) mod_ssl/ 2.0.53 OpenSSL/0.9.7a DAV/2 PHP/5.0.3 mod_fastcgi/2.4.2 configured -- resuming normal operations [Wed Sep 21 15:41:15 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" started (pid 19830) [Wed Sep 21 15:41:16 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" started (pid 19831) [Wed Sep 21 15:41:17 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" started (pid 19832) [Wed Sep 21 15:41:18 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" started (pid 19833) [Wed Sep 21 15:41:24 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" (pid 19824) terminated by calling exit with status ''0'' [Wed Sep 21 15:41:24 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" restarted (pid 19836) [root@evans tmp]# tail /www/logs/error_log [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ uploadtest.lan/public/dispatch.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds [Wed Sep 21 15:41:28 2005] [warn] ... and the log keeps filling up with the last warning
I had some problems getting this working also until I ran across http://forum.textdrive.com/viewtopic.php?id=2972 in particular the last entry. Once I manually reinstalled the fcgi it worked for me. On 9/21/05, cleaner416 <cleaner416-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Well I''ve been warned getting a Rails app running off of FastCGI on > Apache would be frustrating, but I seem to be very close to > accomplishing this feat except for this last hangup. > > I installed mod_fastcgi, the fastcgi-devel and the fcgi gem on my > Fedora Core 3 box. So far so good. > > I added the LoadModule fastcgi_module modules/mod_fastcgi.so lin to > my httpd.conf as well as the > > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc/ > AddHandler fastcgi-script .fcgi > </IfModule> > > block. The I restarted apache and got the ''FastCGI: process manager > initialized (pid #)'' line in the error_log, which I read means that > FastCGI is running correctly. > > Now I''m ready to fire up a Rails app - > > 1. I add a line ''FastCgiServer /data/wwwroot/uploadtest.lan/public/ > dispatch.fcgi -idle-timeout 10 -initial-env RAILS_ENV=production - > processes 5'' into the <IfModule mod_fastcgi.c> block above. > > 2. I create a virtual server pointing to /data/wwwroot/uploadtest.lan/ > public/dispatch.fcgi > > 3. I changed the top of public/dispatch.fcgi to ''#!/usr/bin/ > ruby'' (this is where my ruby exec is) > > 4. Just to make sure I wouldn''t have permissions problems I chmod''d > the whole /data/wwwroot/uploadtest.lan directory to 777. > > 5. I restart... > > And the app times out with the ''Rails application failed to start > properly'' message. > > Here is my error_log - any, any help at all would be greatly > appreciated. Thanks in advance. > > [Wed Sep 21 15:41:14 2005] [notice] FastCGI: process manager > initialized (pid 19823) > [Wed Sep 21 15:41:14 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" started (pid 19824) > [Wed Sep 21 15:41:14 2005] [notice] Apache/2.0.53 (Unix) mod_ssl/ > 2.0.53 OpenSSL/0.9.7a DAV/2 PHP/5.0.3 mod_fastcgi/2.4.2 configured -- > resuming normal operations > [Wed Sep 21 15:41:15 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" started (pid 19830) > [Wed Sep 21 15:41:16 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" started (pid 19831) > [Wed Sep 21 15:41:17 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" started (pid 19832) > [Wed Sep 21 15:41:18 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" started (pid 19833) > [Wed Sep 21 15:41:24 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" (pid 19824) terminated by > calling exit with status ''0'' > [Wed Sep 21 15:41:24 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" restarted (pid 19836) > [root@evans tmp]# tail /www/logs/error_log > [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" has failed to remain running for > 30 seconds given 3 attempts, its restart interval has been backed off > to 600 seconds > [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" has failed to remain running for > 30 seconds given 3 attempts, its restart interval has been backed off > to 600 seconds > [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" has failed to remain running for > 30 seconds given 3 attempts, its restart interval has been backed off > to 600 seconds > [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" has failed to remain running for > 30 seconds given 3 attempts, its restart interval has been backed off > to 600 seconds > [Wed Sep 21 15:41:28 2005] [warn] ... and the log keeps filling up > with the last warning > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Wow. Thanks a million. This tip solved the problem on local Fedora Core 3 box instantly AND a colo''d RH EL3 box too! One gotcha to add - make sure to rm /tmp/ruby* before restarting after following this tip. At first I thought the fix didn''t work and then I remembered this advice from my hours of googling this issue. On Sep 21, 2005, at 4:14 PM, Xavier Toth wrote:> I had some problems getting this working also until I ran across > http://forum.textdrive.com/viewtopic.php?id=2972 in particular the > last entry. Once I manually reinstalled the fcgi it worked for me. > > On 9/21/05, cleaner416 <cleaner416-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote: > Well I''ve been warned getting a Rails app running off of FastCGI on > Apache would be frustrating, but I seem to be very close to > accomplishing this feat except for this last hangup. > > I installed mod_fastcgi, the fastcgi-devel and the fcgi gem on my > Fedora Core 3 box. So far so good. > > I added the LoadModule fastcgi_module modules/mod_fastcgi.so lin to > my httpd.conf as well as the > > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc/ > AddHandler fastcgi-script .fcgi > </IfModule> > > block. The I restarted apache and got the ''FastCGI: process manager > initialized (pid #)'' line in the error_log, which I read means that > FastCGI is running correctly. > > Now I''m ready to fire up a Rails app - > > 1. I add a line ''FastCgiServer /data/wwwroot/uploadtest.lan/public/ > dispatch.fcgi -idle-timeout 10 -initial-env RAILS_ENV=production - > processes 5'' into the <IfModule mod_fastcgi.c> block above. > > 2. I create a virtual server pointing to /data/wwwroot/uploadtest.lan/ > public/dispatch.fcgi > > 3. I changed the top of public/dispatch.fcgi to ''#!/usr/bin/ > ruby'' (this is where my ruby exec is) > > 4. Just to make sure I wouldn''t have permissions problems I chmod''d > the whole /data/wwwroot/uploadtest.lan directory to 777. > > 5. I restart... > > And the app times out with the ''Rails application failed to start > properly'' message. > > Here is my error_log - any, any help at all would be greatly > appreciated. Thanks in advance. > > [Wed Sep 21 15:41:14 2005] [notice] FastCGI: process manager > initialized (pid 19823) > [Wed Sep 21 15:41:14 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" started (pid 19824) > [Wed Sep 21 15:41:14 2005] [notice] Apache/2.0.53 (Unix) mod_ssl/ > 2.0.53 OpenSSL/0.9.7a DAV/2 PHP/5.0.3 mod_fastcgi/2.4.2 configured -- > resuming normal operations > [Wed Sep 21 15:41:15 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" started (pid 19830) > [Wed Sep 21 15:41:16 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" started (pid 19831) > [Wed Sep 21 15:41:17 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" started (pid 19832) > [Wed Sep 21 15:41:18 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" started (pid 19833) > [Wed Sep 21 15:41:24 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" (pid 19824) terminated by > calling exit with status ''0'' > [Wed Sep 21 15:41:24 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" restarted (pid 19836) > [root@evans tmp]# tail /www/logs/error_log > [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" has failed to remain running for > 30 seconds given 3 attempts, its restart interval has been backed off > to 600 seconds > [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" has failed to remain running for > 30 seconds given 3 attempts, its restart interval has been backed off > to 600 seconds > [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" has failed to remain running for > 30 seconds given 3 attempts, its restart interval has been backed off > to 600 seconds > [Wed Sep 21 15:41:28 2005] [warn] FastCGI: server "/data/wwwroot/ > uploadtest.lan/public/dispatch.fcgi" has failed to remain running for > 30 seconds given 3 attempts, its restart interval has been backed off > to 600 seconds > [Wed Sep 21 15:41:28 2005] [warn] ... and the log keeps filling up > with the last warning > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails