-
-
Save paultreny/5711567 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddHandler fcgid-script .fcgi | |
AddHandler cgi-script .cgi | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/home2/salatecs/.rvm/rubies/ruby-1.9.3-p194/bin/ruby | |
require 'rubygems' | |
fastcgi_log = File.open("fastcgi.log", "a") | |
STDOUT.reopen fastcgi_log | |
STDERR.reopen fastcgi_log | |
STDOUT.sync = true | |
print %x[which ruby] | |
# You must put the gems on the path | |
ENV["GEM_HOME"] = "/home2/salatecs/.rvm/gems/ruby-1.9.3-p194@global" | |
# sinatra should load now | |
require 'sinatra' | |
module Rack | |
class Request | |
def path_info | |
@env["REDIRECT_URL"].to_s | |
end | |
def path_info=(s) | |
@env["REDIRECT_URL"] = s.to_s | |
end | |
end | |
end | |
require_relative 'app' | |
builder = Rack::Builder.new do | |
use Rack::ShowStatus | |
use Rack::ShowExceptions | |
run Sinatra::Application | |
end | |
Rack::Handler::FastCGI.run(builder) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment