Wednesday, January 2, 2008

Ruby on Rails fcgi - fastcgi NOT WORKING AT SERVAGE HOSTING

Jan 01 - 17:58 GMT
Customer
Hi it seems like your fcgi or fastcgi isn't working properly:

Try here: http://biblio.t3pack.org

It shows you a working Ruby on Rails Application.
Switching to fcgi/fastcgi will cause that the dispatch.fcgi won't get parsed. It will show up as text!!!

You can test tis when you change in www/biblio/.htaccess
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
#RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

to

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
-----------------------------------------

Line 32/33 .htaccess
--------------------
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

will display the ruby and rails application "biblio" and you can edit save ... with no problem

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
#RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

will display a text file (dispatch.fcgi)
-------------------------------------
#!/usr/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# and the GC period is nil (turned off). A reasonable number of requests
# could range from 10-100 depending on the memory footprint of your app.
#
# Example:
# # Default log path, normal GC behavior.
# RailsFCGIHandler.process!
#
# # Default log path, 50 requests between GC.
# RailsFCGIHandler.process! nil, 50
#
# # Custom log path, normal GC behavior.
# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
#
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'

RailsFCGIHandler.process!
------------------------------------

in comparison dispatch.cgi looks like this:
------------------------------------
#!/usr/bin/ruby

require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)

# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
require "dispatcher"

ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
Dispatcher.dispatch
------------------------------
NOTE: I switched to cgi mode in .htaccess
as fcgi isn't working at all.
------------------------------
==============================
Could you please check why fcgi isn't working and let's dispatch.fcgi not parsed and upshowing as text file? Thanks!

Please Check all Ruby on Rails applications we tested with the same problem. None of them is working in fcgi mode

http://www.t3log.info (/1_redmine - REDMINE)
http://typo.t3pack.info (/www/TYPO_rails - TYPO - Typosphere)
http://biblio.t3pack.info (/www/biblio - Test Case to locate the problem why no ror is working on servage hosting)


Jan 01 - 18:21 GMT
Customer

Hi Servage
YIPPI It is working but only with CGI!!

So please check fcgi - somethings seems to be wrong here in your server configuration:

I got Redmine Working using cgi instead of fcgi.
I copied the settings from our biblio example to redmine
.htaccess
dispatch.cgi
dispatch.fcgi

Then it was working

In other words something seems to be wrong with your fcgi and this was holding us up now since over 2 weeks!!! and delayed our progress a lot!

I hope you can fix the fcgi problem in the next 8 hours (our night here - but your day!) We will check tomorrow as like you write in your faq fcgi is 10times faster then cgi

CU Andi

Jan 02 - 03:52 GMT
Customer

ANY NEWS on the FCGI Front as ruby on rails is still not working with fcgi on SERVAGE HOSTING and therefore pretty slow

No comments: