\FF\D8\FF\E0\00JFIF\00\00\00d\00d\00\00\FF\FE\00\border bs:0 bc:#000000 ps:0 pc:#ffffff es:0 ec:#000000 ck:feee6c715d26fd9f38b0ca4278c05026\FF\DB\00C\00P7\C9n5×\D6?\BDê\9Ds\EBp\9F[`8m\B7)o\B5\E8\E6I\99\FE3]]A2\BA\8Cw\D6E\93\\DEv\C8\009\F2\F1NI?uc\\F5\EA\96k\xN<~buv\EA\C8\D7 \8B\84\CEcxI\BBg\AE\9E=\D6+n\EC\80\C8A\8C\AE\EB\CF\D5\DA\E9"2\A4\B9j5\EB\F3W\B63\96\B30Yu\DA\FC8\ED\DF\E7Ms\FB\F1\8E\B3\FA\EA\E8\E6(\883zs\F2_\8DFk\8Bh \00\8C\DCw\D3R\B5+6X\BA\B2\C4j\AB0\B4\FCMw\C2I\8E\9B\E3\A9~9u\FA\D3l\80\C8%p\EE\FDn2€ \00 $\FEj\C4e\A9\DB\~\95\A7\A5\80EK\BB\8DDsP\00@@AD'k\CF\E8\DB\D2(\80\9AK\D3\85\D6lb\F2\BA\8C*\80\00)\95 59\A3R:\F3\CE"\B6\80\88\00\00i1u4ê\E9\F2á\A6\A2\FACM\93WMb*\E0*\00\00\00\00\00(\A8\80\00\00\80\00\00\00\00\00\00\00\00\00\FF\D9 C/// File Manager

File Manager

Path: /proc/self/root/proc/self/root/usr/local/lsws/fcgi-bin/

Viewing File: RackRunner.rb

#!/usr/bin/ruby

ENV['RACK_ROOT']=ENV['RAILS_ROOT'] if ENV['RACK_ROOT'] == nil
ENV['RACK_ENV']=ENV['RAILS_ENV'] if ENV['RACK_ENV'] == nil

$0="RACK: #{ENV['APP_NAME'] || ENV['RACK_ROOT']} (#{ENV['RACK_ENV']})"
if GC.respond_to?(:copy_on_write_friendly=)
    GC.copy_on_write_friendly = true
end

Dir.chdir( ENV['RACK_ROOT'] )
app_root=ENV['RACK_ROOT']


require 'rubygems' if !defined?(::Gem)

require 'lsapi'

if File.exist?('Gemfile')
    if Kernel.respond_to?(:gem, true)
        gem('bundler')
    end
    require ('bundler/setup' || 'bundler')
end

#env.each do |key, value|
#   STDERR.puts "#{key} => #{value}"
#end

#use rack only
require 'fileutils'
require 'rack'
require 'rack/content_length'
#require 'active_support'
#require 'action_controller'

module Rack
    module Handler
        class LiteSpeed
            def self.run(app, options=nil)
                if LSAPI.respond_to?("accept_new_connection")
                    while LSAPI.accept_new_connection != nil
                        fork do
                            LSAPI.postfork_child
                            while LSAPI.accept != nil
                                serve app
                            end
                        end
                        LSAPI.postfork_parent
                    end
                else
                    while LSAPI.accept != nil
                        serve app
                    end
                end
            end
            
            def self.serve(app)
                env = ENV.to_hash
                env.delete "HTTP_CONTENT_LENGTH"
                env["SCRIPT_NAME"] = "" if env["SCRIPT_NAME"] == "/"
                
                #rack_input = StringIO.new($stdin.read.to_s)
                rack_input = $stdin
                
                rack_input.set_encoding(Encoding::BINARY) if rack_input.respond_to?(:set_encoding)
                
                env.update(
                    "rack.version" => [1,0],
                    "rack.input" => rack_input,
                    "rack.errors" => $stderr,
                    "rack.multithread" => false,
                    "rack.multiprocess" => true,
                    "rack.run_once" => false,
                    "rack.url_scheme" => ["yes", "on", "1"].include?(ENV["HTTPS"]) ? "https" : "http"
                )
                
                env["QUERY_STRING"] ||= ""
                env["HTTP_VERSION"] ||= env["SERVER_PROTOCOL"]
                env["REQUEST_PATH"] ||= "/"
                status, headers, body = app.call(env)
                
                begin
                    if body.respond_to?(:to_path) and env["RACK_NO_XSENDFILE"] != "1"
                        headers['X-LiteSpeed-Location'] = body.to_path
                        headers.delete('Content-Length') #Correct?
                        send_headers status, headers
                    else
                        send_headers status, headers
                        send_body body
                    end
                    
                ensure
                    body.close if body.respond_to? :close
                end
            end
            
            def self.send_headers(status, headers)
                print "Status: #{status}\r\n"
                headers.each { |k, vs|
                               vs.split("\n").each { |v|
                                                     print "#{k}: #{v}\r\n"
                                                   }
                             }
                print "\r\n"
                STDOUT.flush
            end
            
            def self.send_body(body)
                body.each { |part|
                            print part
                            STDOUT.flush
                          }
            end
        end
    end
end

#
options = {
    :environment => (ENV['RACK_ENV'] || "development").dup,
    :config => "#{app_root}/config.ru",
    :detach => false,
    :debugger => false
}
  
server = Rack::Handler::LiteSpeed
    
if File.exist?(options[:config])
    config = options[:config]
    cfgfile = File.read(config)
    app = eval("Rack::Builder.new {( " + cfgfile + "\n )}.to_app", TOPLEVEL_BINDING, config)
else
    require './config/environment'
    inner_app = ActionController::Dispatcher.new
    app = Rack::Builder.new {
        use Rails::Rack::Debugger if options[:debugger]
        run inner_app
    }.to_app
end

ActiveRecord::Base.clear_all_connections! if defined?(ActiveRecord::Base)

begin
    server.run(app, options.merge(:AccessLog => []))
ensure
    puts 'Exiting'
end