Dan Tenenbaum
2006-Feb-15 19:18 UTC
[Rails] dispatch.cgi error affecting specific browsers
I have a rails app that is accessed through Apache 2 (just using cgi now; will add fastcgi later when everything is working). The app works fine with some os/browser combos at my work site: windows/IE Mac/safari Mac/firefox Linux/firefox But it fails on windows/firefox and my colleague''s (at a different site) mac/safari (we are running the same os version and version of safari) The actual error reported in the browser is: Application error Rails application failed to start properly And in the apache error log: Premature end of script headers: dispatch.cgi I have read numerous postings about this error and have made sure that: -permissions on my app are set correctly -hashbang line is correct in dispatch.cgi -line endings are correct in dispatch.cgi What seems to be different than most other reports of this problem is the fact that it works on some browsers but not others. Any ideas? Thanks -- Posted via http://www.ruby-forum.com/.
Ben Reubenstein
2006-Feb-15 19:58 UTC
[Rails] dispatch.cgi error affecting specific browsers
Hi Dan ~ What OS are you serving from? I had many issues with Windows hosting and Apache. I would highly recommend the switch to FastCGI. I personally had numerous issues with Apache+FastCGI, and jumped ship for Light. Never been happier. ~ Ben On 2/15/06, Dan Tenenbaum <dandante@dandante.com> wrote:> > I have a rails app that is accessed through Apache 2 (just using cgi > now; will add fastcgi later when everything is working). > > The app works fine with some os/browser combos at my work site: > windows/IE > Mac/safari > Mac/firefox > Linux/firefox > > But it fails on windows/firefox and my colleague''s (at a different site) > mac/safari (we are running the same os version and version of safari) > > The actual error reported in the browser is: > Application error > Rails application failed to start properly > > And in the apache error log: > Premature end of script headers: dispatch.cgi > > I have read numerous postings about this error and have made sure that: > -permissions on my app are set correctly > -hashbang line is correct in dispatch.cgi > -line endings are correct in dispatch.cgi > > What seems to be different than most other reports of this problem is > the fact that it works on some browsers but not others. Any ideas? > Thanks > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Ben Reubenstein http://www.benr75.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060215/108b78fe/attachment.html
Dan Tenenbaum
2006-Feb-15 20:05 UTC
[Rails] Re: dispatch.cgi error affecting specific browsers
Ben Reubenstein wrote:> Hi Dan ~ > > What OS are you serving from? I had many issues with Windows hosting and > Apache.Serving from Fedora Core 4 Linux.> > I would highly recommend the switch to FastCGI. I personally had > numerous > issues with Apache+FastCGI, and jumped ship for Light. Never been > happier.I''ve had trouble getting lighttpd to work, also we have some limitations which may dicate using apache. I think fastcgi is a good idea, but I also think it''s a good idea to make sure everything works using cgi first. I may be wrong. Still having the problem...hope this rings a bell with someone........ -- Posted via http://www.ruby-forum.com/.
Craig White
2006-Feb-15 21:14 UTC
[Rails] Re: dispatch.cgi error affecting specific browsers
On Wed, 2006-02-15 at 21:05 +0100, Dan Tenenbaum wrote:> Ben Reubenstein wrote: > > Hi Dan ~ > > > > What OS are you serving from? I had many issues with Windows hosting and > > Apache. > > Serving from Fedora Core 4 Linux. > > > > > I would highly recommend the switch to FastCGI. I personally had > > numerous > > issues with Apache+FastCGI, and jumped ship for Light. Never been > > happier. > > I''ve had trouble getting lighttpd to work, also we have some limitations > which may dicate using apache. I think fastcgi is a good idea, but I > also think it''s a good idea to make sure everything works using cgi > first. I may be wrong. > > Still having the problem...hope this rings a bell with someone........---- try (for S & G) service httpd stop rm /tmp/ruby.sess* rm -fr /tmp/fcgi* service httpd start (just to make sure that all session data has been cleared out before you start httpd) Craig
Dan Tenenbaum
2006-Feb-15 21:27 UTC
[Rails] Re: Re: dispatch.cgi error affecting specific browsers
Craig White wrote:>> Still having the problem...hope this rings a bell with someone........ > ---- > try (for S & G) > > service httpd stop > > rm /tmp/ruby.sess* > rm -fr /tmp/fcgi* > > service httpd start > > (just to make sure that all session data has been cleared out before you > start httpd) > > CraigThat worked! Thanks. BTW, what do you mean by S & G? Also, what are the best practices for removing the session files? The agile book suggests a cron script to remove all scripts over 6 hours old. Is it a good idea to remove all session files when restarting the web server? Do you know what the mechanics of this problem are? In other words, how exactly does a session file cause a "premature end of script headers" error? Just trying to understand and help prevent the problem in future. Thanks again -- Posted via http://www.ruby-forum.com/.
Craig White
2006-Feb-15 21:56 UTC
[Rails] Re: Re: dispatch.cgi error affecting specific browsers
On Wed, 2006-02-15 at 22:27 +0100, Dan Tenenbaum wrote:> Craig White wrote: > >> Still having the problem...hope this rings a bell with someone........ > > ---- > > try (for S & G) > > > > service httpd stop > > > > rm /tmp/ruby.sess* > > rm -fr /tmp/fcgi* > > > > service httpd start > > > > (just to make sure that all session data has been cleared out before you > > start httpd) > > > > Craig > > That worked! > > Thanks. BTW, what do you mean by S & G?---- sh*ts and grins - obtuse expression that stuck with me after I first heard it ----> > Also, what are the best practices for removing the session files? The > agile book suggests a cron script to remove all scripts over 6 hours > old.---- makes sense but I took that out to 8 hours (just in case) ----> > Is it a good idea to remove all session files when restarting the web > server?---- I think experience is gonna teach me some of this...I have less than little ----> Do you know what the mechanics of this problem are? In other words, how > exactly does a session file cause a "premature end of script headers" > error? Just trying to understand and help prevent the problem in future.---- I doubt I can give you a very good explanation but by wag is simply that you have a browser open that is attached to a session and the server methodology has changed but the browser is still attached to the session and so it remains...by deleting the session, it makes the server create a new session with the new methodology/parameters. Craig