subimage interactive
2005-Dec-13 03:22 UTC
Apache / FastCGI freak out in PRODUCTION mode on my new rails app
Here I go again with another question. I''ve been banging my head for the better part of a week against this one, so responses would be really appreciated. I have a Rails application that I''ve been developing under Apache/FastCGI in _development_ mode. All is well and works wonderfully, until I change my httpd.conf from this: <IfModule mod_fastcgi.c> FastCgiServer /var/www/genselect/public/dispatch.fcgi \ -initial-env RAILS_ENV=development \ -processes 2 \ -idle-timeout 60 </IfModule> To this: <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc FastCgiServer /var/www/genselect/public/dispatch.fcgi \ -initial-env RAILS_ENV=production \ -processes 2 \ -idle-timeout 60 </IfModule> When I do that, the site won''t come up at all in my browser and I get this in my apache error_log: [Mon Dec 12 19:01:09 2005] [error] [client 192.169.1.1] FastCGI: comm with server "/var/www/genselect/public/dispatch.fcgi" aborted: idle timeout (60 sec) [Mon Dec 12 19:01:09 2005] [error] [client 192.169.1.1] FastCGI: incomplete headers (0 bytes) received from server "/var/www/genselect/public/dispatch.fcgi" I have another rails application running in production mode on the same machine, and it works fine - so I know how to get it done. I''ve even removed my previous rails app from the httpd.conf to test if there is some sort of FCGI collision going on, but there''s not - my new app still fails to start up in production mode. My _old_ rails app is something I started on 0.13 (and I''m pretty sure I haven''t updated). I noticed the environment.rb files are very different between the two, but the 0.13 one still works just fine. (My new rails app is 0.14.4) My database settings are all kosher (I''ve even pointed production / development mode to the same database with no luck), and I''ve cleared sessions out of my DB between restarts. I''ve commented everything out of production.rb, but still no luck. I''m going crazy here - does anyone have an idea what could be causing my problems? -- seth at subimage interactive http://www.subimage.com/sublog/ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
subimage interactive
2005-Dec-13 03:33 UTC
Re: Apache / FastCGI freak out in PRODUCTION mode on my new rails app
Alright - I feel really stupid, but I just solved it literally seconds after I posted the message. Someone on the irc channel suggested that I run webrick in prodcution mode. It gave me this /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:73:in `establish_connection'': production database is not configured (ActiveRecord::AdapterNotSpecified) So I checked out my database.yml file again and found out that I had a SPACE on the line between test and production mode, and THAT was causing the problem. Just in case someone else has the same problem one day - look at your database.yml file really closely. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Mike Zornek
2005-Dec-13 15:07 UTC
Re: Apache / FastCGI freak out in PRODUCTION mode on my new rails app
On 12/12/05 10:22 PM, "subimage interactive" <subimage-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve commented everything out of production.rb, but still no luck. I''m going > crazy here - does anyone have an idea what could be causing my problems?A few notes that might help... I''m personally having an issue wherein I''m using a very similar FastCGI config line, but it''s not passing the production flag over to the app properly -- and thus is was always trying to start in development. Mine looks like: <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc FastCgiServer /webserver/cbwebsite/releases/rel29/public/dispatch.fcgi \ -initial-env RAILS_ENV=production -processes 5 -idle-timeout 120 </IfModule> To fix it I''ve temporarily told Rails to run in production by hand in the environment.rb file but I''d really like to know why the above isn''t working. Some issues I ran into before but are now solved: For some reason the temp folder (/tmp/fcgi_ipc) was initially owned by my user, and then when I tried to boot the server www couldn''t write into it. I deleted it, restarted apache and only then could it create a new folder that was owned by www and would work. Finally, another issue I once has was the shebang line in dispatch.fcgi -- it was pointed to a previous ruby install, and not my current one which knew where to find FastCGI. Good luck. ~ Mike -- http://MikeZornek.com