Well, after many hours of tinkering and internet browsing I just can''t get Fast CGI to work with Rails and Apache 1.3 on FreeBSD 5.4 Normal CGI works fine, but as soon as I enable FastCGI in .htaccess I get the message: Application error Rails application failed to start properly Here''s what I''ve done so far: - I''ve installed all the necessary software for rails and fast cgi. - FastCGI does seem to be configured correctly in the apache config file. I''ve added the necessary virtual host settings and other apache directives, as per the instructions on the Rails wiki. - In .htaccess I changed RewriteRule ^(.*)$ dispatch.cgi [QSA,L] to RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] - Cleared out rails related temporary files from /tmp. - I''ve restarted apache. - I''ve restarted my browser. - I''ve made sure dispatch.fcgi contains the line "require ''fcgi_handler''" (without quotes, of course). - I set the /log directory permissions to 755. Heck, I even set the entire rails directory to 777 (it''s on a local intranet, so security isn''t a big issue right now). But despite my best efforts I''m not getting any love from rails and fast cgi, and I''m completely stuck. Any help would be GREATLY appreciated. -- Posted via http://www.ruby-forum.com/.
I experienced the (approximately, I''m using Apache 2.x) same problems. To keep a long story short, I''m using Lighttpd now. The long story is here: http://www.mindshards.net/?p=15 amongst others. In the end Apache did work but still unsatisfactory. Rails developers should _really_ start supporting Apache for real.>From a glace at your post I''d same you need to point to your fcgiserver. MenDAKE wrote:> Well, after many hours of tinkering and internet browsing I just can''t > get Fast CGI to work with Rails and Apache 1.3 on FreeBSD 5.4 Normal CGI > works fine, but as soon as I enable FastCGI in .htaccess I get the > message: > > Application error > Rails application failed to start properly > > Here''s what I''ve done so far: > > - I''ve installed all the necessary software for rails and fast cgi. > > - FastCGI does seem to be configured correctly in the apache config > file. I''ve added the necessary virtual host settings and other apache > directives, as per the instructions on the Rails wiki. > > - In .htaccess I changed > > RewriteRule ^(.*)$ dispatch.cgi [QSA,L] > > to > > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > > - Cleared out rails related temporary files from /tmp. > > - I''ve restarted apache. > > - I''ve restarted my browser. > > - I''ve made sure dispatch.fcgi contains the line "require > ''fcgi_handler''" (without quotes, of course). > > - I set the /log directory permissions to 755. Heck, I even set the > entire rails directory to 777 (it''s on a local intranet, so security > isn''t a big issue right now). > > But despite my best efforts I''m not getting any love from rails and fast > cgi, and I''m completely stuck. Any help would be GREATLY appreciated.-- Posted via http://www.ruby-forum.com/.
though i''m using ligthttpd on os x, i had a similar problem the other day. in my case the solution was to make public/dispatch.fcgi executable: chmod +x dispatch.fcgi john ________________________________________ John McGrath http://fryolator.com> Date: Sat, 4 Mar 2006 20:21:11 +0100 > From: MenDAKE <mendake_ddude@yahoo.com> > Subject: [Rails] Can''t get Fast CGI working. > To: rails@lists.rubyonrails.org > > Well, after many hours of tinkering and internet browsing I just can''t > get Fast CGI to work with Rails and Apache 1.3 on FreeBSD 5.4 Normal CGI > works fine, but as soon as I enable FastCGI in .htaccess I get the > message: > > Application error > Rails application failed to start properly > > Here''s what I''ve done so far: > > - I''ve installed all the necessary software for rails and fast cgi. > > - FastCGI does seem to be configured correctly in the apache config > file. I''ve added the necessary virtual host settings and other apache > directives, as per the instructions on the Rails wiki. > > - In .htaccess I changed > > RewriteRule ^(.*)$ dispatch.cgi [QSA,L] > > to > > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > > - Cleared out rails related temporary files from /tmp. > > - I''ve restarted apache. > > - I''ve restarted my browser. > > - I''ve made sure dispatch.fcgi contains the line "require > ''fcgi_handler''" (without quotes, of course). > > - I set the /log directory permissions to 755. Heck, I even set the > entire rails directory to 777 (it''s on a local intranet, so security > isn''t a big issue right now). > > But despite my best efforts I''m not getting any love from rails and fast > cgi, and I''m completely stuck. Any help would be GREATLY appreciated. > > -- > Posted via http://www.ruby-forum.com/. > > > ------------------------------ > > Message: 10 > Date: Sat, 4 Mar 2006 13:22:52 -0600 > From: "Rick Olson" <technoweenie@gmail.com> > Subject: Re: [Rails] Declaring ActiveRecord observers > To: rails@lists.rubyonrails.org > Message-ID: > <48fe25b0603041122l4fcd5c3ajdeac824a917c8f57@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On 3/4/06, Juan Lupi?n <pantulis@gmail.com> wrote: > > Hello > > > > I''m using the ''act_as_authenticated'' plugin to implement a small and > > simple authentication system in my app. Everything is working just > > fine and the world is a better place to live in. The plugin creates a > > ActiveRecord observer in order to send the newly registered user a > > confirmation e-mail. > > > > Per the API docs [1], one should declare the observer in the > > config/environment.rb file under the ''config.active_record.observers > > :comment_observer, :signup_observer''. > > > > But reading the generated source code, the plugin author recommends > > declaring the observer in my ApplicationController with a ''observer > > :user_observer'' clause. > > > > The observer gets triggered in both cases, but I am curious about this, > > > > So, what is the "Rails way" of activating observers? > > > > > > 1. http://rubyonrails.org/api/classes/ActiveRecord/Observer.html > > > > Using config.active_record.observers ensures the Observer is always > loaded. It''s actually probably a better way to go, because you don''t > have to make sure to load it when in script/console. (On the > flipside, it''s always running.. so creating users from script/console > will send the emails out). > > The only reason I don''t use it is because it didn''t seem to work > correctly in dev mode. They would work the first request, but not > after because of the class reloading. This may have been fixed > though. Try it out and let me know if everything works fine. > > -- > Rick Olson > http://techno-weenie.net > > > ------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > End of Rails Digest, Vol 18, Issue 91 > ************************************* > >---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Thanks for the response, Anon. What do you mean about needing to point to my fcgi server? -- Posted via http://www.ruby-forum.com/.
Am Samstag, den 04.03.2006, 20:21 +0100 schrieb MenDAKE:> But despite my best efforts I''m not getting any love from rails and fast > cgi, and I''m completely stuck. Any help would be GREATLY appreciated.Call ruby public/dispatch.fcgi from your Rails root directory and see if some exceptions appear. -- Norman Timmler http://blog.inlet-media.de
Well I run apache2 and have this file /etc/apache2/mod-available/fastcgi.conf which is something like a httpd.conf exerpt. In there I have: AddHandler fastcgi-script .fcgi FastCgiIpcDir /var/lib/apache2/fastcgi FastCgiServer /path/to/your/apps/public/dispatch.fcgi -processes 2 -idle-timeout 60 Which points to your fastcgi server. MenDAKE wrote:> Thanks for the response, Anon. What do you mean about needing to point > to my fcgi server?-- Posted via http://www.ruby-forum.com/.
anon wrote:> Well I run apache2 and have this file > /etc/apache2/mod-available/fastcgi.conf which is something like a > httpd.conf exerpt. In there I have: > AddHandler fastcgi-script .fcgi > FastCgiIpcDir /var/lib/apache2/fastcgi > FastCgiServer /path/to/your/apps/public/dispatch.fcgi -processes 2 > -idle-timeout 60 > > Which points to your fastcgi server. > > MenDAKE wrote: >> Thanks for the response, Anon. What do you mean about needing to point >> to my fcgi server?That was it! I never read anywhere that the above lines need to be added to the apache file, but that completely fixed my problem. Rails is now blazingly fast. Thank you VERY much for your help. -- Posted via http://www.ruby-forum.com/.