Jeroen Heijmans
2006-Mar-15 07:31 UTC
[Rails] Apache (both 1.3 & 2) not calling dispatch.fcgi on Debian
We''re trying to run Ruby on Rails on Debian with Apache and FastCGI, but can''t get it to work. As far as we can tell, it seems to go wrong in the final stages; Apache appears not to be doing anything with dispatch.fcgi, even though FastCGI looks to be set up correctly. We''ve followed several "how to"s, but we don''t get any other results. What we''ve done: * In general, we''ve followed instructions as listed on the Rails Wiki, the Agile Web Development with Rails book, and another website with basically the same instructions (don''t have URL handy now, sorry). Other resources on the web don''t appear to have different information. * We have a test application with a simple fake controller made to check if everything works. This resides in /home/user/testapp, but we have a symlink set up in /var/www/test linking to the public/ dir under the application. * We have Apache 2 running (although we later tried with 1.3, giving the same problem). * We installed the latest version of mod_fastcgi (after installing the Developers Kit). * We installed the fcgi gem for Ruby. * We have the following server configuration in httpd.conf (essentially straight from the Agile book): <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc FastCgiServer /var/www/dispatch.fcgi \ -initial-env RAILS_ENV=production \ -processes 3 -idle-timeout 60 </IfModule> * With this set up, we see that Apache starts three FastCGI threads, showing up in both the apache logs and the fastcgi.crash.log in the Rails application. * To be sure: we made the public and log directories available for Apache, as well as the /tmp/fcgi_ipc directory mentioned in the configuration. (In fact, Apache will complain if this is not set up correctly). * The line in .htaccess has been changed to use dispatch.fcgi rather than dispatch.cgi. * We tried this on two different machines, but with the same effect. What goes wrong: When we try to approach our application on localhost, we get the the static welcoming page from our application, but that is as far as we get. As soon as we try to ask for our controller, we get a 404, and the Apache error log tells us that it cannot find the file at /var/www/test/fake (fake being the name of our controller, which has a index.rhtml page in the views dir). That''s all the information we get, nothing is listed in any other logs. Of course, this request should have been handled by dispatch.fcgi, but it seems to us this was never called. We think the problem lies there, as FastCGI itself appears to be installed correctly (with Apache starting up the threads). However, we haven''t been able to find anything wrong. Any suggestions or tips as to what the problem might be would be very much appreciated. thanks, Jeroen Heijmans -- Posted via http://www.ruby-forum.com/.
Craig White
2006-Mar-15 07:37 UTC
[Rails] Apache (both 1.3 & 2) not calling dispatch.fcgi on Debian
On Wed, 2006-03-15 at 08:31 +0100, Jeroen Heijmans wrote:> We''re trying to run Ruby on Rails on Debian with Apache and FastCGI, but > can''t get it to work. As far as we can tell, it seems to go wrong in the > final stages; Apache appears not to be doing anything with > dispatch.fcgi, even though FastCGI looks to be set up correctly. We''ve > followed several "how to"s, but we don''t get any other results. > > What we''ve done: > * In general, we''ve followed instructions as listed on the Rails Wiki, > the Agile Web Development with Rails book, and another website with > basically the same instructions (don''t have URL handy now, sorry). Other > resources on the web don''t appear to have different information. > * We have a test application with a simple fake controller made to check > if everything works. This resides in /home/user/testapp, but we have a > symlink set up in /var/www/test linking to the public/ dir under the > application. > * We have Apache 2 running (although we later tried with 1.3, giving the > same problem). > * We installed the latest version of mod_fastcgi (after installing the > Developers Kit). > * We installed the fcgi gem for Ruby. > * We have the following server configuration in httpd.conf (essentially > straight from the Agile book): > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc > FastCgiServer /var/www/dispatch.fcgi \ > -initial-env RAILS_ENV=production \ > -processes 3 -idle-timeout 60 > </IfModule> > * With this set up, we see that Apache starts three FastCGI threads, > showing up in both the apache logs and the fastcgi.crash.log in the > Rails application. > * To be sure: we made the public and log directories available for > Apache, as well as the /tmp/fcgi_ipc directory mentioned in the > configuration. (In fact, Apache will complain if this is not set up > correctly). > * The line in .htaccess has been changed to use dispatch.fcgi rather > than dispatch.cgi. > * We tried this on two different machines, but with the same effect. > > What goes wrong: > When we try to approach our application on localhost, we get the the > static welcoming page from our application, but that is as far as we > get. As soon as we try to ask for our controller, we get a 404, and the > Apache error log tells us that it cannot find the file at > /var/www/test/fake (fake being the name of our controller, which has a > index.rhtml page in the views dir). That''s all the information we get, > nothing is listed in any other logs. Of course, this request should have > been handled by dispatch.fcgi, but it seems to us this was never called. > We think the problem lies there, as FastCGI itself appears to be > installed correctly (with Apache starting up the threads). However, we > haven''t been able to find anything wrong. > > Any suggestions or tips as to what the problem might be would be very > much appreciated. >---- It''s late, I''m tired and may not be of much help but I was clobbered by this and it turned out that the very last ''ReWrite'' line of public/.htaccess had to be... RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] or it didn''t work (I had it further up the file). make sure that you delete all /tmp/session files after your restart apache and before you try to use a browswer. Craig
Joseph
2006-Mar-15 13:05 UTC
[Rails] Apache (both 1.3 & 2) not calling dispatch.fcgi on Debian
Does your Apache installation have mod_rewrite installed? regards, Joseph On 3/15/06, Jeroen Heijmans <jeroenh@3icommunication.com> wrote:> > We''re trying to run Ruby on Rails on Debian with Apache and FastCGI, but > can''t get it to work. As far as we can tell, it seems to go wrong in the > final stages; Apache appears not to be doing anything with > dispatch.fcgi, even though FastCGI looks to be set up correctly. We''ve > followed several "how to"s, but we don''t get any other results. > > What we''ve done: > * In general, we''ve followed instructions as listed on the Rails Wiki, > the Agile Web Development with Rails book, and another website with > basically the same instructions (don''t have URL handy now, sorry). Other > resources on the web don''t appear to have different information. > * We have a test application with a simple fake controller made to check > if everything works. This resides in /home/user/testapp, but we have a > symlink set up in /var/www/test linking to the public/ dir under the > application. > * We have Apache 2 running (although we later tried with 1.3, giving the > same problem). > * We installed the latest version of mod_fastcgi (after installing the > Developers Kit). > * We installed the fcgi gem for Ruby. > * We have the following server configuration in httpd.conf (essentially > straight from the Agile book): > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc > FastCgiServer /var/www/dispatch.fcgi \ > -initial-env RAILS_ENV=production \ > -processes 3 -idle-timeout 60 > </IfModule> > * With this set up, we see that Apache starts three FastCGI threads, > showing up in both the apache logs and the fastcgi.crash.log in the > Rails application. > * To be sure: we made the public and log directories available for > Apache, as well as the /tmp/fcgi_ipc directory mentioned in the > configuration. (In fact, Apache will complain if this is not set up > correctly). > * The line in .htaccess has been changed to use dispatch.fcgi rather > than dispatch.cgi. > * We tried this on two different machines, but with the same effect. > > What goes wrong: > When we try to approach our application on localhost, we get the the > static welcoming page from our application, but that is as far as we > get. As soon as we try to ask for our controller, we get a 404, and the > Apache error log tells us that it cannot find the file at > /var/www/test/fake (fake being the name of our controller, which has a > index.rhtml page in the views dir). That''s all the information we get, > nothing is listed in any other logs. Of course, this request should have > been handled by dispatch.fcgi, but it seems to us this was never called. > We think the problem lies there, as FastCGI itself appears to be > installed correctly (with Apache starting up the threads). However, we > haven''t been able to find anything wrong. > > Any suggestions or tips as to what the problem might be would be very > much appreciated. > > thanks, > > Jeroen Heijmans > > > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060315/eba3e873/attachment.html
Norman Timmler
2006-Mar-15 13:42 UTC
[Rails] Apache (both 1.3 & 2) not calling dispatch.fcgi on Debian
Am Mittwoch, den 15.03.2006, 00:37 -0700 schrieb Craig White:> On Wed, 2006-03-15 at 08:31 +0100, Jeroen Heijmans wrote: > > We''re trying to run Ruby on Rails on Debian with Apache and FastCGI, but > > can''t get it to work. As far as we can tell, it seems to go wrong in the > > final stages; Apache appears not to be doing anything with > > dispatch.fcgi, even though FastCGI looks to be set up correctly. We''ve > > followed several "how to"s, but we don''t get any other results. > > > > What we''ve done: > > * In general, we''ve followed instructions as listed on the Rails Wiki, > > the Agile Web Development with Rails book, and another website with > > basically the same instructions (don''t have URL handy now, sorry). Other > > resources on the web don''t appear to have different information. > > * We have a test application with a simple fake controller made to check > > if everything works. This resides in /home/user/testapp, but we have a > > symlink set up in /var/www/test linking to the public/ dir under the > > application. > > * We have Apache 2 running (although we later tried with 1.3, giving the > > same problem). > > * We installed the latest version of mod_fastcgi (after installing the > > Developers Kit). > > * We installed the fcgi gem for Ruby. > > * We have the following server configuration in httpd.conf (essentially > > straight from the Agile book): > > <IfModule mod_fastcgi.c> > > FastCgiIpcDir /tmp/fcgi_ipc > > FastCgiServer /var/www/dispatch.fcgi \ > > -initial-env RAILS_ENV=production \ > > -processes 3 -idle-timeout 60 > > </IfModule> > > * With this set up, we see that Apache starts three FastCGI threads, > > showing up in both the apache logs and the fastcgi.crash.log in the > > Rails application. > > * To be sure: we made the public and log directories available for > > Apache, as well as the /tmp/fcgi_ipc directory mentioned in the > > configuration. (In fact, Apache will complain if this is not set up > > correctly). > > * The line in .htaccess has been changed to use dispatch.fcgi rather > > than dispatch.cgi. > > * We tried this on two different machines, but with the same effect. > > > > What goes wrong: > > When we try to approach our application on localhost, we get the the > > static welcoming page from our application, but that is as far as we > > get. As soon as we try to ask for our controller, we get a 404, and the > > Apache error log tells us that it cannot find the file at > > /var/www/test/fake (fake being the name of our controller, which has a > > index.rhtml page in the views dir). That''s all the information we get, > > nothing is listed in any other logs. Of course, this request should have > > been handled by dispatch.fcgi, but it seems to us this was never called. > > We think the problem lies there, as FastCGI itself appears to be > > installed correctly (with Apache starting up the threads). However, we > > haven''t been able to find anything wrong. > > > > Any suggestions or tips as to what the problem might be would be very > > much appreciated. > > > ---- > It''s late, I''m tired and may not be of much help but I was clobbered by > this and it turned out that the very last ''ReWrite'' line of > public/.htaccess had to be... > > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > > or it didn''t work (I had it further up the file). > > make sure that you delete all /tmp/session files after your restart > apache and before you try to use a browswer.Try to enable the rewrite log and examine what is happening. http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritelog -- Norman Timmler http://blog.inlet-media.de
Guest
2006-Mar-15 16:08 UTC
[Rails] Re: Apache (both 1.3 & 2) not calling dispatch.fcgi on Debia
Jeroen Heijmans wrote:> We''re trying to run Ruby on Rails on Debian with Apache and FastCGI, but > can''t get it to work. > ... > What we''ve done: > ... > ... This resides in /home/user/testapp, but we have a > symlink set up in /var/www/test linking to the public/ dir under the > application. > ...Why did you symlink to the subdirectory named ''public''? Please provide the URL advising you to do this. Why did you specify /var/www/dispatch.fcgi in your Apache config if your rails application is in /home/user/testapp? Please provide the URL advising you to do this. Given the above setup, I don''t know how rails would figure out that it should look in /home/user/testapp/... directories for various components and scripts. Please provide the URLs so we can ask the authors to stop confusing people. -- Posted via http://www.ruby-forum.com/.
Jeroen Heijmans
2006-Mar-16 13:00 UTC
[Rails] Re: Apache (both 1.3 & 2) not calling dispatch.fcgi on Debia
Thanks for the replies, everybody. I managed to get it running (with Apache 2). It appears that I just need to enable the modules (fcgi, rewrite) and the site (testapp) using the utils a2enmod and a2ensite. After that, everything worked. -- Posted via http://www.ruby-forum.com/.