I want to make an app for a friend but he has shared hosting and the only option is fcgi and I can't find any documentation on how to do it. Is there anyways to run rails 3 on FCGI?
Put in public/whatever.fcgi
#!/usr/bin/ruby
require_relative '../config/environment'
class Rack::PathInfoRewriter
def initialize(app)
@app = app
end
def call(env)
env.delete('SCRIPT_NAME')
parts = env['REQUEST_URI'].split('?')
env['PATH_INFO'] = parts[0]
env['QUERY_STRING'] = parts[1].to_s
@app.call(env)
end
end
Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(YOURAPPNAME::Application)
Check the example app here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With